Add link-time RST instruction

This allows using a label as the argument to a `rst` instruction
Fixes rednex#448
This commit is contained in:
ISSOtm
2020-01-14 00:02:22 +01:00
parent 359a048b6e
commit b1cd730db2
14 changed files with 98 additions and 4 deletions

35
test/asm/rst.asm Normal file
View File

@@ -0,0 +1,35 @@
SECTION "calls", ROM0[0]
; The values are not known at this point, forcing the assembler to emit an
; expression
rst rst00
rst rst08
rst rst10
rst rst18
rst rst20
rst rst28
rst rst30
rst rst38
rst rst2A
defRST: MACRO
; FIXME: This is required, otherwise the lexer does not paste the two tokens
ADDR equs "$\1"
SECTION "rst\1", ROM0[ADDR]
rst\1:
PURGE ADDR
ENDM
defRST 00
defRST 08
defRST 10
defRST 18
defRST 20
defRST 28
defRST 30
defRST 38
defRST 2A ; Define a nonsensical RST, because RGBASM cannot catch it