Specifications
Saturn Macros 5-7
Psy-Q Development System
SHIFT, NARG
Description These directives cater for a macro having a variable parameter list as its operand. The
NARG symbol is the number of arguments on the macro invocation line; the SHIFT
directive shifts all the arguments one place to the left, losing the leftmost argument.
Syntax directive NARG
...
SHIFT
where NARG is a reserved, predefined symbol.
See Also Extended Parameters
Examples routes macro
rept narg
if strcmp('\1','0')
dc.w 0
else
dc.w \1-routebase
endif
shift
endr
endm
...
routes 0,gosouth_1
This example goes through the list of parameters given to the macro and defines a
half word of $0000 if the argument is zero or a 16 bit offset into the ‘routebase’ table
of the given label.