shithub: rgbds

ref: b06e3b239d128826a33c97f38217cda0c25fee54
dir: /test/asm/redef-equs.asm/

View raw version
s EQUS "Hello, "
REDEF s EQUS "{s}world!"
; prints "Hello, world!"
PRINTLN "{s}"

list: MACRO
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}"

N EQU 42
REDEF N EQUS "X"