Files
rgbds/test/asm/redef-equ.asm
Rangi cee3d1c859 Add more test coverage for RGBASM (#1256)
This also fixes two bugs: `-1 >>> 32` was -1 not 0, and `macro_FreeArgs` should have been called but wasn't.
2023-11-29 15:16:05 -05:00

26 lines
379 B
NASM

DEF n EQU 0
REDEF n EQU 1
; prints "$1"
PRINTLN n
MACRO list
DEF LIST_NAME EQUS "\1"
DEF LENGTH_{LIST_NAME} EQU 0
ENDM
MACRO item
REDEF LENGTH_{LIST_NAME} EQU LENGTH_{LIST_NAME} + 1
DEF {LIST_NAME}_{d:LENGTH_{LIST_NAME}} EQU \1
ENDM
list SQUARES
item 1
item 4
item 9
println LENGTH_SQUARES, SQUARES_1, SQUARES_2, SQUARES_3
REDEF NEW EQU 7
DEF N EQUS "X"
REDEF N EQU 42