delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/11/13/16:27:49

Message-ID: <328A3956.2B1E@tempe.vlsi.com>
Date: Wed, 13 Nov 1996 14:10:46 -0700
From: Charles Marslett <charles DOT marslett AT tempe DOT vlsi DOT com>
Organization: VLSI Technology, Inc.
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com, dj AT delorie DOT com
CC: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Subject: Re: Cannot symlink when basename is 8 chars
References: <9611131808 DOT AA11718 AT clio DOT rice DOT edu>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019