English
Language : 

45111 Datasheet, PDF (65/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
7 The SASM Assembler
7.4.7 Macro Invocation
Once defined, a macro is used by invoking it with appropriate actual values to be used in place of the
formal parameters. When invoked, the macro body is interpolated in place of the invocation, with each
reference to a formal parameter replaced by the actual value of that parameter.
The invocation has the form:
<macroname> <parameter1> [, <parameter2> ...]
where macroname must match the name of a previously defined macro, and the number of parameters
must agree with that definition.
7.4.8 Actual Values of Parameters
The actual value of a formal parameter is the exact text of the parameter after leading and trailing white
space characters are removed. Parameters are separated by commas. The last parameter is terminated
by a comment or the end of the line.
If a comma or white space must be passed as part of an actual parameter, then the parameter value may
be enclosed in curly braces which will be removed before the value is substituted.
Grouping with curly braces does not prevent any formal parameter (of an enclosing macro) inside the
text from being recognized and substituted. Note that ordinary quotes in an actual parameter are
preserved, and also prevent formal parameter substitution. See Section 7.4.10 - Quoting on quoting.
7.4.9 Token Pasting
The token pasting operator may be used to concatenate a formal parameter to other text to form a larger
token. The token pasting operator effectively works as a zero-width space character which provides an
opportunity for the formal parameter reference to be seen, and disappears from the source text for all
further processing.
The notation C<token??token> will "paste" the two tokens together into a single token. Either token
may be the name of a formal parameter or an index of a parameter in the C<\1> notation which will be
substituted by its actual value, or any other text which will be preserved. The resulting text is taken as a
single token and must be legal at the point where it appears or a suitable error will occur.
Token pasting is useful for including an actual parameter value as part of an instruction mnemonic or
symbol name.
7.4.10 Quoting
On a macro invocation line, curly braces have the effect of collecting all the text they contain as a single
actual parameter to the macro. The actual parameter consists of the text enclosed by the braces, which
are discarded. Note that if the invocation line is part of the body of a macro definition, any formal
parameters in that text will be substituted before the text is used as an actual parameter.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 65