Next: TIC54X-MMRegs, Previous: TIC54X-Directives, Up: TIC54X-Dependent

#### 8.29.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.