English
Language : 

45111 Datasheet, PDF (64/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
7 The SASM Assembler
{macro definitions and other code appears above this point}
M1
{arguments here}
NOEXPAND
M2
EXPAND
{arguments here}
M1
{arguments here}
The above code will result in a list file with the first and last macro calls expanded and the second
macro call unexpanded. Note that expand is the default so the expand directive was not used above the
first macro call. Additionally, the list file will always show addresses and assembly within a macro
regardless of the use of expand and noexpand directives.
7.4.6 Formal Parameters
Formal parameters may be declared by count or by name. If the MACRO directive has one or more
names as arguments, those names are the formal parameters. If it has a single constant expression (well-
defined in pass 1) that is the exact number of arguments required, the formal parameters are unnamed.
If the MACRO directive is not followed by either a constant expression or names of arguments, then
any number of arguments may be passed, and the formal parameters are unnamed.
If the formal parameters are named, then any occurrence of a formal parameter name in the macro body
will be replaced by the exact text of the actual parameter (defined below) from the macro invocation.
Formal parameter names are case sensitive. That is, a formal parameter named "Foo" on the MACRO
directive will be matched by the string "Foo" in the body, not by "foo", "FOO", or any other variations.
Whether or not the formal parameters are named, any occurrence of a backslash ("\") followed by a
numeric constant in the current radix will be replaced by the exact text of the corresponding actual
parameter from the macro invocation. The sequence "\0" will be replaced by the number of actual
parameters available.
In order for the REPT directive to be useful to scan all arguments of a macro, the sequence "\%" will be
replaced by the exact text of the actual parameter corresponding to the current iteration of the enclosing
REPT directive.
Note that the value after the backslash must be either 0, non-zero and positive, or the percent character.
All consecutive digits up to the first non-digit character will be used to form the parameter number.
In all cases, parameter substitution will occur at any point in the input where the reference to a formal
parameter is discovered. Parameter names are recognized when delimited by white space, the
beginning of a line, a comment or end of line, or one of the macro operators or quote mechanisms
described later.
Note that formal parameter substitution does not occur inside of quoted strings or comments.
Page 64 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.