Files
rgbds/test/asm/label-macro-arg.asm
2023-11-02 10:18:59 +01:00

40 lines
495 B
NASM

MACRO m1
def x\1
ENDM
DEF S EQUS "y"
DEF S2 EQUS "yy"
MACRO m2
S\1 ; can't use DEF, so this will EQUS expand
ENDM
m1 = 5
m2 = 6
m1 x = 7
m2 2 = 8
println x
println y
println xx
println yy
MACRO test_char
DEF VAR_DEF equs "DEF sizeof_\1something = 0"
VAR_DEF
DEF sizeof_\1something = 1
PURGE VAR_DEF
DEF VAR_PRINT equs "println \"sizeof_\1something equals {sizeof_\1something}\""
VAR_PRINT
PURGE VAR_PRINT
ENDM
test_char _
test_char @
test_char #
test_char .
test_char :