mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-20 13:54:33 +00:00
Negative macro arguments count from the end, i.e. `\<-1>` is equivalent to `\<_NARG>`, even after `shift`ing them. Negative arguments cannot be used to access shifted values.
23 lines
384 B
NASM
23 lines
384 B
NASM
MACRO test
|
|
static_assert _NARG == 10
|
|
println _NARG
|
|
println \1, \<10>, \<-1>, \<-10>
|
|
println \<999>
|
|
println \<-999>
|
|
shift 3
|
|
println _NARG
|
|
println \1, \7, \<-1>, \<-7>
|
|
println \<8>
|
|
println \<-8>
|
|
println \<-999>
|
|
shift 7
|
|
println _NARG
|
|
println \1
|
|
println \<-1>
|
|
shift -10
|
|
println _NARG
|
|
println \<-2_147_483_648>
|
|
ENDM
|
|
|
|
test "a", "b", "c", "d", "e", "f", "g", "h", "i", "j"
|