Files
rgbds/test/asm/redef-equs.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
397 B
NASM

DEF s EQUS "Hello, "
REDEF s EQUS "{s}world!"
; prints "Hello, world!"
PRINTLN "{s}"
MACRO list
DEF LIST_NAME EQUS "\1"
REDEF {LIST_NAME} EQUS "["
REPT _NARG - 1
REDEF {LIST_NAME} EQUS "{{LIST_NAME}}\2;"
SHIFT
ENDR
REDEF {LIST_NAME} EQUS "{{LIST_NAME}}]"
PURGE LIST_NAME
ENDM
list FOO
PRINTLN "{FOO}"
list FOO, 1, A, 2, B
PRINTLN "{FOO}"
REDEF NEW EQUS "NEW"
DEF N EQU 42
REDEF N EQUS "X"