mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-27 21:42:06 +00:00
Let RGBASM write JR offsets in floating sections
This requires some special-casing for `jr @` because the `jr` opcode has already been emitted, but not the operand, so PC points to the middle. Moved the RGBLINK test to RGBASM's folder, and created a new RGBLINK test.
This commit is contained in:
7
test/asm/jr-@.asm
Normal file
7
test/asm/jr-@.asm
Normal file
@@ -0,0 +1,7 @@
|
||||
SECTION "fixed", ROM0[0]
|
||||
jr @
|
||||
; We need this section to be floating because RGBASM can know the value of PC
|
||||
; otherwise, leading to different behavior
|
||||
; FIXME: we rely on this landing at address 2, which isn't *guaranteed*...
|
||||
SECTION "floating", ROM0
|
||||
jr @
|
||||
0
test/asm/jr-@.err
Normal file
0
test/asm/jr-@.err
Normal file
0
test/asm/jr-@.out
Normal file
0
test/asm/jr-@.out
Normal file
1
test/asm/jr-@.out.bin
Normal file
1
test/asm/jr-@.out.bin
Normal file
@@ -0,0 +1 @@
|
||||
<18><18>
|
||||
5
test/asm/jr-section.asm
Normal file
5
test/asm/jr-section.asm
Normal file
@@ -0,0 +1,5 @@
|
||||
SECTION "Test", ROM0
|
||||
|
||||
Label:
|
||||
jr Label
|
||||
PRINTV Label - @
|
||||
0
test/asm/jr-section.err
Normal file
0
test/asm/jr-section.err
Normal file
1
test/asm/jr-section.out
Normal file
1
test/asm/jr-section.out
Normal file
@@ -0,0 +1 @@
|
||||
$FFFFFFFE
|
||||
1
test/asm/jr-section.out.bin
Normal file
1
test/asm/jr-section.out.bin
Normal file
@@ -0,0 +1 @@
|
||||
<18>
|
||||
@@ -1,7 +1,3 @@
|
||||
SECTION "fixed", ROM0[0]
|
||||
jr @
|
||||
; We need this section to be floating because RGBASM can know the value of PC
|
||||
; otherwise, leading to different behavior
|
||||
; FIXME: we rely on this landing at address 2, which isn't *guaranteed*...
|
||||
SECTION "floating", ROM0
|
||||
jr @
|
||||
SECTION "Floating", ROM0
|
||||
; RGBASM knows how to compute `jr @` by itself, but this will evade it
|
||||
jr @ - 1 + 1
|
||||
|
||||
@@ -1 +1 @@
|
||||
<18><18>
|
||||
<18>
|
||||
Reference in New Issue
Block a user