You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TIC54X_002dMacros.html 7.3KB

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2020 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>TIC54X-Macros (Using as)</title>
  16. <meta name="description" content="TIC54X-Macros (Using as)">
  17. <meta name="keywords" content="TIC54X-Macros (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="TIC54X_002dDependent.html#TIC54X_002dDependent" rel="up" title="TIC54X-Dependent">
  25. <link href="TIC54X_002dMMRegs.html#TIC54X_002dMMRegs" rel="next" title="TIC54X-MMRegs">
  26. <link href="TIC54X_002dDirectives.html#TIC54X_002dDirectives" rel="prev" title="TIC54X-Directives">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style: oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="TIC54X_002dMacros"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="TIC54X_002dMMRegs.html#TIC54X_002dMMRegs" accesskey="n" rel="next">TIC54X-MMRegs</a>, Previous: <a href="TIC54X_002dDirectives.html#TIC54X_002dDirectives" accesskey="p" rel="prev">TIC54X-Directives</a>, Up: <a href="TIC54X_002dDependent.html#TIC54X_002dDependent" accesskey="u" rel="up">TIC54X-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Macros-1"></a>
  63. <h4 class="subsection">9.45.10 Macros</h4>
  64. <a name="index-TIC54X_002dspecific-macros"></a>
  65. <a name="index-macros_002c-TIC54X"></a>
  66. <p>Macros do not require explicit dereferencing of arguments (i.e., \ARG).
  67. </p>
  68. <p>During macro expansion, the macro parameters are converted to subsyms.
  69. If the number of arguments passed the macro invocation exceeds the
  70. number of parameters defined, the last parameter is assigned the string
  71. equivalent of all remaining arguments. If fewer arguments are given
  72. than parameters, the missing parameters are assigned empty strings. To
  73. include a comma in an argument, you must enclose the argument in quotes.
  74. </p>
  75. <a name="index-subsym-builtins_002c-TIC54X"></a>
  76. <a name="index-TIC54X-subsym-builtins"></a>
  77. <a name="index-builtin-subsym-functions_002c-TIC54X"></a>
  78. <p>The following built-in subsym functions allow examination of the string
  79. value of subsyms (or ordinary strings). The arguments are strings
  80. unless otherwise indicated (subsyms passed as args will be replaced by
  81. the strings they represent).
  82. </p><dl compact="compact">
  83. <dd><a name="index-_0024symlen-subsym-builtin_002c-TIC54X"></a>
  84. </dd>
  85. <dt><code><code>$symlen(<var>str</var>)</code></code></dt>
  86. <dd><p>Returns the length of <var>str</var>.
  87. </p>
  88. <a name="index-_0024symcmp-subsym-builtin_002c-TIC54X"></a>
  89. </dd>
  90. <dt><code><code>$symcmp(<var>str1</var>,<var>str2</var>)</code></code></dt>
  91. <dd><p>Returns 0 if <var>str1</var> == <var>str2</var>, non-zero otherwise.
  92. </p>
  93. <a name="index-_0024firstch-subsym-builtin_002c-TIC54X"></a>
  94. </dd>
  95. <dt><code><code>$firstch(<var>str</var>,<var>ch</var>)</code></code></dt>
  96. <dd><p>Returns index of the first occurrence of character constant <var>ch</var> in
  97. <var>str</var>.
  98. </p>
  99. <a name="index-_0024lastch-subsym-builtin_002c-TIC54X"></a>
  100. </dd>
  101. <dt><code><code>$lastch(<var>str</var>,<var>ch</var>)</code></code></dt>
  102. <dd><p>Returns index of the last occurrence of character constant <var>ch</var> in
  103. <var>str</var>.
  104. </p>
  105. <a name="index-_0024isdefed-subsym-builtin_002c-TIC54X"></a>
  106. </dd>
  107. <dt><code><code>$isdefed(<var>symbol</var>)</code></code></dt>
  108. <dd><p>Returns zero if the symbol <var>symbol</var> is not in the symbol table,
  109. non-zero otherwise.
  110. </p>
  111. <a name="index-_0024ismember-subsym-builtin_002c-TIC54X"></a>
  112. </dd>
  113. <dt><code><code>$ismember(<var>symbol</var>,<var>list</var>)</code></code></dt>
  114. <dd><p>Assign the first member of comma-separated string <var>list</var> to
  115. <var>symbol</var>; <var>list</var> is reassigned the remainder of the list. Returns
  116. zero if <var>list</var> is a null string. Both arguments must be subsyms.
  117. </p>
  118. <a name="index-_0024iscons-subsym-builtin_002c-TIC54X"></a>
  119. </dd>
  120. <dt><code><code>$iscons(<var>expr</var>)</code></code></dt>
  121. <dd><p>Returns 1 if string <var>expr</var> is binary, 2 if octal, 3 if hexadecimal,
  122. 4 if a character, 5 if decimal, and zero if not an integer.
  123. </p>
  124. <a name="index-_0024isname-subsym-builtin_002c-TIC54X"></a>
  125. </dd>
  126. <dt><code><code>$isname(<var>name</var>)</code></code></dt>
  127. <dd><p>Returns 1 if <var>name</var> is a valid symbol name, zero otherwise.
  128. </p>
  129. <a name="index-_0024isreg-subsym-builtin_002c-TIC54X"></a>
  130. </dd>
  131. <dt><code><code>$isreg(<var>reg</var>)</code></code></dt>
  132. <dd><p>Returns 1 if <var>reg</var> is a valid predefined register name (AR0-AR7 only).
  133. </p>
  134. <a name="index-_0024structsz-subsym-builtin_002c-TIC54X"></a>
  135. </dd>
  136. <dt><code><code>$structsz(<var>stag</var>)</code></code></dt>
  137. <dd><p>Returns the size of the structure or union represented by <var>stag</var>.
  138. </p>
  139. <a name="index-_0024structacc-subsym-builtin_002c-TIC54X"></a>
  140. </dd>
  141. <dt><code><code>$structacc(<var>stag</var>)</code></code></dt>
  142. <dd><p>Returns the reference point of the structure or union represented by
  143. <var>stag</var>. Always returns zero.
  144. </p>
  145. </dd>
  146. </dl>
  147. <hr>
  148. <div class="header">
  149. <p>
  150. Next: <a href="TIC54X_002dMMRegs.html#TIC54X_002dMMRegs" accesskey="n" rel="next">TIC54X-MMRegs</a>, Previous: <a href="TIC54X_002dDirectives.html#TIC54X_002dDirectives" accesskey="p" rel="prev">TIC54X-Directives</a>, Up: <a href="TIC54X_002dDependent.html#TIC54X_002dDependent" accesskey="u" rel="up">TIC54X-Dependent</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  151. </div>
  152. </body>
  153. </html>