Mail Archives: djgpp-workers/1996/11/13/16:27:49
Charles Sandmann wrote:
>
> Change:
> > mov [bx], al ; al = 0
> To:
> movb [bx], 0
>
> Only adds one byte to the size of the stub, and last time I checked we had
> at least one to spare :-)
>
> > If I'm right, this problem is IMHO serious enough to justify another
> > update of djdev.
>
> I'm not so sure of that, since noone seems to have noticed it until now.
> Maybe a patched stub.exe might be made available...
Should you want that, the following sequence is the same size and would
make patching easier (I haven't compiled it, but I think the size
adjustments
marked with "***" balance out, note the change to LOOPNZ from LOOP):
;-----------------------------------------------------------------------------
; Replace the stub's file name with the link's name after the directory
mov cx, 8 ; max length of basename
mov di, stubinfo_basename ; pointer to new basename
dec bx ; *** ADDS 1 BYTE
@b1:
mov al, [di] ; get next character
inc di
inc bx ; *** ADDS 1 BYTE
or al, al ; end of basename?
;*** je @f1 ; *** SAVES 2 BYTES
mov [bx], al ; store character
;*** inc bx ; *** SAVES 1 BYTE
loopNZ @b1 ; eight characters?
@f1:
movd [bx+0], 0x4558452e ; append ".EXE"
add bx, 4
;*** mov [bx], al ; al = 0 *** SAVES 2 BYTES
mov [bx], 0 ; *** ADDS 3 BYTES
mov [loadname_nul], bx ; remember nul so we can change
--Charles
- Raw text -