Implement \# to expand to all unshifted macro arguments

Fixes #596
This commit is contained in:
Rangi
2020-12-12 18:23:26 -05:00
committed by Eldred Habert
parent ce58f6d6be
commit 0e40543757
7 changed files with 127 additions and 13 deletions

46
test/asm/macro-#.asm Normal file
View File

@@ -0,0 +1,46 @@
SECTION "Test", ROM0
list: MACRO
db _NARG
if _NARG > 0
db \#
endc
db -1
ENDM
list
list 42
list $aa, $bb, $cc, $dd, $ee
person: MACRO
db \1, \2, \3, \4, \5
ENDM
object: MACRO
x = \1
y = \2
shift 2
person y, x, \#
ENDM
person 5, 10, $33, $44, $55
object 12, 6, $66, $77, $88
echo: MACRO
printt "\#\n"
ENDM
R EQUS "S"
echo P
echo Q,R, {R}, T
echo 42,$2a
print: MACRO
printt STRCAT(\#)
printt "\n"
ENDM
print
print "A"
print "B", "C", "D"

0
test/asm/macro-#.err Normal file
View File

6
test/asm/macro-#.out Normal file
View File

@@ -0,0 +1,6 @@
P
Q,R,S,T
42,$2a
A
BCD

BIN
test/asm/macro-#.out.bin Normal file

Binary file not shown.