mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 12:02:08 +00:00
Allow negative values to count macro arguments from the end (#1670)
This commit is contained in:
21
test/asm/negative-macro-args.asm
Normal file
21
test/asm/negative-macro-args.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
MACRO mac
|
||||
for i, -1, -_NARG - 1, -1
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
endr
|
||||
; error cases
|
||||
def i = 0
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
def i = -_NARG - 1
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
def i = $7fff_ffff
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
; signed/unsigned difference error cases
|
||||
def i = $8000_0000
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
println "{u:i}: \<i> == \<{u:i}>"
|
||||
def i = $ffff_ffff
|
||||
println "{d:i}: \<i> == \<{d:i}>"
|
||||
println "{u:i}: \<i> == \<{u:i}>"
|
||||
ENDM
|
||||
|
||||
mac A, B, C, D, E, F, G
|
||||
Reference in New Issue
Block a user