Browse Source

sinclairql: added startup code support for the 'packed' relocation table format in vlink. disabled for now.

git-svn-id: trunk@49211 -
Károly Balogh 4 years ago
parent
commit
0d5260396c
1 changed files with 24 additions and 0 deletions
  1. 24 0
      rtl/sinclairql/si_prc.pp

+ 24 - 0
rtl/sinclairql/si_prc.pp

@@ -79,12 +79,36 @@ asm
     move.l (a1)+,d7
     move.l (a1)+,d7
     beq @noreloc
     beq @noreloc
 
 
+{.$DEFINE PACKEDRELOCS}
+{$IFNDEF PACKEDRELOCS}
 @relocloop:
 @relocloop:
     { we read the offsets and relocate them }
     { we read the offsets and relocate them }
     move.l (a1)+,d1
     move.l (a1)+,d1
     add.l d0,(a0,d1)
     add.l d0,(a0,d1)
     subq.l #1,d7
     subq.l #1,d7
     bne @relocloop
     bne @relocloop
+{$ELSE PACKEDRELOCS}
+    moveq #0,d2
+@relocloop:
+    { we read the offsets and relocate them }
+    moveq #0,d1
+    move.b (a1)+,d1
+    bne @addoffs
+    { if byte = 0, we have a long offset following }
+    move.b (a1)+,d1
+    lsl.w #8,d1
+    move.b (a1)+,d1
+    swap d1
+    move.b (a1)+,d1
+    lsl.w #8,d1
+    move.b (a1)+,d1
+    subq.l #4,d7
+@addoffs:
+    add.l d1,d2
+    add.l d0,(a0,d2)
+    subq.l #1,d7
+    bpl @relocloop
+{$ENDIF PACKEDRELOCS}
 
 
 @noreloc:
 @noreloc:
     move.l a7,a0
     move.l a7,a0