wok-6.x diff syslinux/stuff/iso2exe/lzcom.S @ rev 18909
Add gnubg
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 22 21:29:18 2016 +0100 (2016-02-22) |
parents | 7d300004a3b8 |
children |
line diff
1.1 --- a/syslinux/stuff/iso2exe/lzcom.S Thu Dec 13 14:33:27 2012 +0100 1.2 +++ b/syslinux/stuff/iso2exe/lzcom.S Mon Feb 22 21:29:18 2016 +0100 1.3 @@ -3,33 +3,78 @@ 1.4 1.5 ORGCOM = 0x100 1.6 STKSZ = 0x4000 // unlzma needs 16Kb 1.7 -CODESZ = (0x10000-STKSZ)/2 // max < 16 sectors = 32Kb 1.8 1.9 +#undef USE_CX_LOADER // CX should be set by loader 1.10 +#undef SETUP_SS // extends max code size from 47k to 63k 1.11 + 1.12 +#ifdef SETUP_SS 1.13 +STKROOM = 256 1.14 +#else 1.15 +STKROOM = STKSZ 1.16 +#endif 1.17 + 1.18 +CODESZ = (0x10000-STKROOM)/2 // max < 16 sectors = 32Kb 1.19 .org 0 1.20 1.21 .globl _start 1.22 _start: 1.23 - cld 1.24 - movw $packedcode-unpack, %ax 1.25 - movw $packedcode+ORGCOM, %si 1.26 - movw $-STKSZ-CODESZ, %di 1.27 - subw %ax, %di 1.28 - pushw %di 1.29 - movw $CODESZ/2, %cx 1.30 - rep 1.31 - movsw // packed code 1.32 - movw $unpack+ORGCOM, %si 1.33 - movw %di, %bx 1.34 - xchgw %ax, %cx 1.35 + movw $ORGCOM, %ax 1.36 + pushw %ax 1.37 + movw $packedcode+ORGCOM-1, %si 1.38 +#ifdef USE_CX_LOADER 1.39 + pushw %cx 1.40 +#endif 1.41 + movw $-STKROOM-1, %di 1.42 + movw $packedcode-unpack-1, %cx 1.43 + std 1.44 +// * max ~47k | 17k 1.45 +// oouuuuppppppppppppppppppppp-------------------S---16k---- 1.46 rep 1.47 movsb // decompressor 1.48 - movw $ORGCOM, %di 1.49 - popw %si 1.50 +// oo----ppppppppppppppppppppp---------------uuuuS---16k---- 1.51 +#ifdef USE_CX_LOADER 1.52 + popw %cx 1.53 pushw %di 1.54 - pushw %bx 1.55 + movsb 1.56 + movw $packedcode+ORGCOM-1, %si 1.57 + addw %cx, %si 1.58 +#else 1.59 + pushw %di 1.60 + movsb 1.61 +#if (CODESZ % 256) == 0 1.62 + movb $CODESZ/256, %ch 1.63 +#else 1.64 + movw $CODESZ, %cx // the loader should update CX ... 1.65 +#endif 1.66 + movw $packedcode+ORGCOM+CODESZ-1, %si 1.67 +// unsigned char *code; // But we can patch later: 1.68 +// size -= * (unsigned short *) (code + 19); 1.69 +// * (unsigned short *) (code + 19) += size; 1.70 +// * (unsigned short *) (code + 22) += size; 1.71 +#endif 1.72 + rep 1.73 + movsb // packed code 1.74 +// oo--------------------ppppppppppppppppppppuuuuS---16k---- 1.75 +// * 1.76 + cld 1.77 + incw %di 1.78 + xchgw %ax, %di 1.79 + xchgw %ax, %si 1.80 ret 1.81 +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx------uuuuS---16k---- 1.82 +// * max ~47k | 17k 1.83 1.84 unpack: 1.85 +#ifdef SETUP_SS 1.86 + movw %ss, %bx 1.87 + leaw STKSZ/16(%bx), %ax 1.88 + movw %ax, %ss 1.89 + pushw %bx 1.90 + call dounpack 1.91 + popw %ss 1.92 + ret 1.93 +dounpack: 1.94 +#endif 1.95 #define FLAT16 1.96 #include "unlzma.S" 1.97