as: TIC54X-Macros
9.44.10 Macros
--------------
Macros do not require explicit dereferencing of arguments (i.e., \ARG).
During macro expansion, the macro parameters are converted to
subsyms. If the number of arguments passed the macro invocation exceeds
the number of parameters defined, the last parameter is assigned the
string equivalent of all remaining arguments. If fewer arguments are
given than parameters, the missing parameters are assigned empty
strings. To include a comma in an argument, you must enclose the
argument in quotes.
The following built-in subsym functions allow examination of the
string value of subsyms (or ordinary strings). The arguments are
strings unless otherwise indicated (subsyms passed as args will be
replaced by the strings they represent).
'$symlen(STR)'
Returns the length of STR.
'$symcmp(STR1,STR2)'
Returns 0 if STR1 == STR2, non-zero otherwise.
'$firstch(STR,CH)'
Returns index of the first occurrence of character constant CH in
STR.
'$lastch(STR,CH)'
Returns index of the last occurrence of character constant CH in
STR.
'$isdefed(SYMBOL)'
Returns zero if the symbol SYMBOL is not in the symbol table,
non-zero otherwise.
'$ismember(SYMBOL,LIST)'
Assign the first member of comma-separated string LIST to SYMBOL;
LIST is reassigned the remainder of the list. Returns zero if LIST
is a null string. Both arguments must be subsyms.
'$iscons(EXPR)'
Returns 1 if string EXPR is binary, 2 if octal, 3 if hexadecimal, 4
if a character, 5 if decimal, and zero if not an integer.
'$isname(NAME)'
Returns 1 if NAME is a valid symbol name, zero otherwise.
'$isreg(REG)'
Returns 1 if REG is a valid predefined register name (AR0-AR7
only).
'$structsz(STAG)'
Returns the size of the structure or union represented by STAG.
'$structacc(STAG)'
Returns the reference point of the structure or union represented
by STAG. Always returns zero.