<html lang="en">
<head>
<title>TIC54X-Macros - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="TIC54X_002dDependent.html#TIC54X_002dDependent" title="TIC54X-Dependent">
<link rel="prev" href="TIC54X_002dDirectives.html#TIC54X_002dDirectives" title="TIC54X-Directives">
<link rel="next" href="TIC54X_002dMMRegs.html#TIC54X_002dMMRegs" title="TIC54X-MMRegs">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.css");
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="TIC54X-Macros"></a>
<a name="TIC54X_002dMacros"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="TIC54X_002dMMRegs.html#TIC54X_002dMMRegs">TIC54X-MMRegs</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="TIC54X_002dDirectives.html#TIC54X_002dDirectives">TIC54X-Directives</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="TIC54X_002dDependent.html#TIC54X_002dDependent">TIC54X-Dependent</a>
<hr>
</div>

<h4 class="subsection">8.29.10 Macros</h4>

<p><a name="index-TIC54X_002dspecific-macros-1578"></a><a name="index-macros_002c-TIC54X-1579"></a>Macros do not require explicit dereferencing of arguments (i.e. \ARG).

   <p>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.

   <p><a name="index-subsym-builtins_002c-TIC54X-1580"></a><a name="index-TIC54X-subsym-builtins-1581"></a><a name="index-builtin-subsym-functions_002c-TIC54X-1582"></a>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).
     
<a name="index-g_t_0040code_007b_0024symlen_007d-subsym-builtin_002c-TIC54X-1583"></a>
<dl><dt><code>$symlen(</code><var>str</var><code>)</code><dd>Returns the length of <var>str</var>.

     <p><a name="index-g_t_0040code_007b_0024symcmp_007d-subsym-builtin_002c-TIC54X-1584"></a><br><dt><code>$symcmp(</code><var>str1</var><code>,</code><var>str2</var><code>)</code><dd>Returns 0 if <var>str1</var> == <var>str2</var>, non-zero otherwise.

     <p><a name="index-g_t_0040code_007b_0024firstch_007d-subsym-builtin_002c-TIC54X-1585"></a><br><dt><code>$firstch(</code><var>str</var><code>,</code><var>ch</var><code>)</code><dd>Returns index of the first occurrence of character constant <var>ch</var> in
<var>str</var>.

     <p><a name="index-g_t_0040code_007b_0024lastch_007d-subsym-builtin_002c-TIC54X-1586"></a><br><dt><code>$lastch(</code><var>str</var><code>,</code><var>ch</var><code>)</code><dd>Returns index of the last occurrence of character constant <var>ch</var> in
<var>str</var>.

     <p><a name="index-g_t_0040code_007b_0024isdefed_007d-subsym-builtin_002c-TIC54X-1587"></a><br><dt><code>$isdefed(</code><var>symbol</var><code>)</code><dd>Returns zero if the symbol <var>symbol</var> is not in the symbol table,
non-zero otherwise.

     <p><a name="index-g_t_0040code_007b_0024ismember_007d-subsym-builtin_002c-TIC54X-1588"></a><br><dt><code>$ismember(</code><var>symbol</var><code>,</code><var>list</var><code>)</code><dd>Assign the first member of comma-separated string <var>list</var> to
<var>symbol</var>; <var>list</var> is reassigned the remainder of the list.  Returns
zero if <var>list</var> is a null string.  Both arguments must be subsyms.

     <p><a name="index-g_t_0040code_007b_0024iscons_007d-subsym-builtin_002c-TIC54X-1589"></a><br><dt><code>$iscons(</code><var>expr</var><code>)</code><dd>Returns 1 if string <var>expr</var> is binary, 2 if octal, 3 if hexadecimal,
4 if a character, 5 if decimal, and zero if not an integer.

     <p><a name="index-g_t_0040code_007b_0024isname_007d-subsym-builtin_002c-TIC54X-1590"></a><br><dt><code>$isname(</code><var>name</var><code>)</code><dd>Returns 1 if <var>name</var> is a valid symbol name, zero otherwise.

     <p><a name="index-g_t_0040code_007b_0024isreg_007d-subsym-builtin_002c-TIC54X-1591"></a><br><dt><code>$isreg(</code><var>reg</var><code>)</code><dd>Returns 1 if <var>reg</var> is a valid predefined register name (AR0-AR7 only).

     <p><a name="index-g_t_0040code_007b_0024structsz_007d-subsym-builtin_002c-TIC54X-1592"></a><br><dt><code>$structsz(</code><var>stag</var><code>)</code><dd>Returns the size of the structure or union represented by <var>stag</var>.

     <p><a name="index-g_t_0040code_007b_0024structacc_007d-subsym-builtin_002c-TIC54X-1593"></a><br><dt><code>$structacc(</code><var>stag</var><code>)</code><dd>Returns the reference point of the structure or union represented by
<var>stag</var>.   Always returns zero.

   </dl>

   </body></html>

