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:
ISSOtm
2020-07-27 18:11:42 +02:00
parent b1adbcc77c
commit 762474d3ac
13 changed files with 47 additions and 25 deletions

View File

@@ -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

View File

@@ -1 +1 @@
<18><18>
<18>