Fix incorrect PC in LOAD blocks at link time

This commit is contained in:
ISSOtm
2020-04-07 12:23:42 +02:00
parent 5b6c1569a4
commit 927c65e863
10 changed files with 112 additions and 86 deletions

View File

@@ -1,8 +1,14 @@
SECTION "test", ROM0[1]
call Target
LOAD "new", WRAM0[$C001]
PRINTT "PC in ROM: {@}\n"
LOAD "new", WRAMX[$D001],BANK[1]
PRINTT "PC in WRAM: {@}\n"
assert @ == $D001
Target: dl DEAD << 16 | BEEF
db BANK(@)
jr .end
.end
jr .end
ds 2, $2A
ENDL
After:
@@ -10,16 +16,16 @@ After:
ld hl, Word
dw Byte, Target.end, After
SECTION "dead", WRAMX[$DEAD]
SECTION "dead", WRAMX[$DEAD],BANK[2]
DEAD:
SECTION "beef", SRAM[$BEEF]
BEEF:
SECTION "ram test", WRAM0 ; Should end up at $C005
SECTION "ram test", WRAMX,BANK[1] ; Should end up at $D005
Word:
dw
SECTION "small ram test", WRAM0 ; Should end up at $C000
SECTION "small ram test", WRAMX,BANK[1] ; Should end up at $D000
Byte:
db

View File

@@ -1,3 +1,5 @@
$C001
$C005
$A
PC in ROM: $4
PC in WRAM: $D001
$D001
$D008
$F

Binary file not shown.