4Fermer6
PpHdLe 26/04/2013 à 20:56
Je crois que j'ai une solution avec -2 octets smile
diff --git a/src/sld.asm b/src/sld.asm
index d477fff..66e7344 100644
--- a/src/sld.asm
+++ b/src/sld.asm
@@ -1183,7 +1183,9 @@ kernel::ExtractFromPack:
 kernel::LibsExec:
        movem.l d0-d7/a0-a6,-(a7)                       ; 
        GET_DATA_PTR                                    ; Get Preos Data Ptr
-       moveq   #0,d7                                   ; Set Error
+       move.l  (4*17)(a7),a2                           ; Get Library name^M
+       move.b  (4*18+2)(a7),d3                         ; Minimum Library version^M
+       clr.l   (4*17)(a7)                              ; Set Error^M
        pea     (12).w                                  ; Create a list (Next, RealReturnAddr, LibPtr)
        ROM_THROW HeapAllocPtr                          ; Alloc Node
        move.l  a0,(a7)                                 ; Ok ?
@@ -1192,8 +1194,6 @@ kernel::LibsExec:
        move.l  (LibsExecList-Ref)(a6),(a3)+            ; Save Next node in List 
        move.l  (4*16)(a7),(a3)+                        ; Save Real Return Address
        move.l  a3,(LibsExecList-Ref)(a6)               ; Update list head
-       move.l  (4*17)(a7),a2                           ; Get Library name
-       move.b  (4*18+2)(a7),d3                         ; Minimum Library version
        bsr     kernel::FindLib                         ; Find the library
        move.l  a0,(a3)                                 ; Save the lib & Check for success
        beq.s   \FreeNode
@@ -1216,6 +1216,7 @@ kernel::LibsExec:
        rts                                             ; Jump to the function and return \next
 
 \next  subq.l  #8,a7                                   ; Fix stack ptr.
+       st.b    (a7)                                    ; Set success^M
        movem.l d0-d7/a0-a7,-(a7)                       ; Pop a7 to increase Stack Frame
        GET_DATA_PTR                                    ; Get a6 
        subq.l  #4,a7                                   ; Create Stack Frame
@@ -1229,10 +1230,8 @@ kernel::LibsExec:
        move.l  -(a3),(LibsExecList-Ref)(a6)            ; Set new head
        move.l  a3,(a7)
        ROM_THROW HeapFreePtr                           ; Free Node
-       moveq   #1,d7                                   ; Set no error
 \AllocError
        addq.l  #4,a7                                   ; Fix stack
-       move.l  d7,(4*16)(a7)                           ; Set error
 \end:  movem.l (a7)+,d0-d7/a0-a6
        rts