as: TIC54X-Macros

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