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.

XGATE_002dSyntax.html 7.5KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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>XGATE-Syntax (Using as)</title>
  16. <meta name="description" content="XGATE-Syntax (Using as)">
  17. <meta name="keywords" content="XGATE-Syntax (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="XGATE_002dDependent.html#XGATE_002dDependent" rel="up" title="XGATE-Dependent">
  25. <link href="XGATE_002dDirectives.html#XGATE_002dDirectives" rel="next" title="XGATE-Directives">
  26. <link href="XGATE_002dOpts.html#XGATE_002dOpts" rel="prev" title="XGATE-Opts">
  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="XGATE_002dSyntax"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="XGATE_002dDirectives.html#XGATE_002dDirectives" accesskey="n" rel="next">XGATE-Directives</a>, Previous: <a href="XGATE_002dOpts.html#XGATE_002dOpts" accesskey="p" rel="prev">XGATE-Opts</a>, Up: <a href="XGATE_002dDependent.html#XGATE_002dDependent" accesskey="u" rel="up">XGATE-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="Syntax-33"></a>
  63. <h4 class="subsection">9.53.2 Syntax</h4>
  64. <a name="index-XGATE-syntax"></a>
  65. <a name="index-syntax_002c-XGATE"></a>
  66. <p>In XGATE RISC syntax, the instruction name comes first and it may
  67. be followed by up to three operands. Operands are separated by commas
  68. (&lsquo;<samp>,</samp>&rsquo;). <code>as</code> will complain if too many operands are specified
  69. for a given instruction. The same will happen if you specified too few
  70. operands.
  71. </p>
  72. <div class="smallexample">
  73. <pre class="smallexample">nop
  74. ldl #23
  75. CMP R1, R2
  76. </pre></div>
  77. <a name="index-line-comment-character_002c-XGATE"></a>
  78. <a name="index-XGATE-line-comment-character"></a>
  79. <p>The presence of a &lsquo;<samp>;</samp>&rsquo; character or a &lsquo;<samp>!</samp>&rsquo; character anywhere
  80. on a line indicates the start of a comment that extends to the end of
  81. that line.
  82. </p>
  83. <p>A &lsquo;<samp>*</samp>&rsquo; or a &lsquo;<samp>#</samp>&rsquo; character at the start of a line also
  84. introduces a line comment, but these characters do not work elsewhere
  85. on the line. If the first character of the line is a &lsquo;<samp>#</samp>&rsquo; then as
  86. well as starting a comment, the line could also be logical line number
  87. directive (see <a href="Comments.html#Comments">Comments</a>) or a preprocessor control command
  88. (see <a href="Preprocessing.html#Preprocessing">Preprocessing</a>).
  89. </p>
  90. <a name="index-line-separator_002c-XGATE"></a>
  91. <a name="index-statement-separator_002c-XGATE"></a>
  92. <a name="index-XGATE-line-separator"></a>
  93. <p>The XGATE assembler does not currently support a line separator
  94. character.
  95. </p>
  96. <a name="index-XGATE-addressing-modes"></a>
  97. <a name="index-addressing-modes_002c-XGATE"></a>
  98. <p>The following addressing modes are understood for XGATE:
  99. </p><dl compact="compact">
  100. <dt><em>Inherent</em></dt>
  101. <dd><p>&lsquo;<samp></samp>&rsquo;
  102. </p>
  103. </dd>
  104. <dt><em>Immediate 3 Bit Wide</em></dt>
  105. <dd><p>&lsquo;<samp>#<var>number</var></samp>&rsquo;
  106. </p>
  107. </dd>
  108. <dt><em>Immediate 4 Bit Wide</em></dt>
  109. <dd><p>&lsquo;<samp>#<var>number</var></samp>&rsquo;
  110. </p>
  111. </dd>
  112. <dt><em>Immediate 8 Bit Wide</em></dt>
  113. <dd><p>&lsquo;<samp>#<var>number</var></samp>&rsquo;
  114. </p>
  115. </dd>
  116. <dt><em>Monadic Addressing</em></dt>
  117. <dd><p>&lsquo;<samp><var>reg</var></samp>&rsquo;
  118. </p>
  119. </dd>
  120. <dt><em>Dyadic Addressing</em></dt>
  121. <dd><p>&lsquo;<samp><var>reg</var>, <var>reg</var></samp>&rsquo;
  122. </p>
  123. </dd>
  124. <dt><em>Triadic Addressing</em></dt>
  125. <dd><p>&lsquo;<samp><var>reg</var>, <var>reg</var>, <var>reg</var></samp>&rsquo;
  126. </p>
  127. </dd>
  128. <dt><em>Relative Addressing 9 Bit Wide</em></dt>
  129. <dd><p>&lsquo;<samp>*<var>symbol</var></samp>&rsquo;
  130. </p>
  131. </dd>
  132. <dt><em>Relative Addressing 10 Bit Wide</em></dt>
  133. <dd><p>&lsquo;<samp>*<var>symbol</var></samp>&rsquo;
  134. </p>
  135. </dd>
  136. <dt><em>Index Register plus Immediate Offset</em></dt>
  137. <dd><p>&lsquo;<samp><var>reg</var>, (<var>reg</var>, #<var>number</var>)</samp>&rsquo;
  138. </p>
  139. </dd>
  140. <dt><em>Index Register plus Register Offset</em></dt>
  141. <dd><p>&lsquo;<samp><var>reg</var>, <var>reg</var>, <var>reg</var></samp>&rsquo;
  142. </p>
  143. </dd>
  144. <dt><em>Index Register plus Register Offset with Post-increment</em></dt>
  145. <dd><p>&lsquo;<samp><var>reg</var>, <var>reg</var>, <var>reg</var>+</samp>&rsquo;
  146. </p>
  147. </dd>
  148. <dt><em>Index Register plus Register Offset with Pre-decrement</em></dt>
  149. <dd><p>&lsquo;<samp><var>reg</var>, <var>reg</var>, -<var>reg</var></samp>&rsquo;
  150. </p>
  151. <p>The register can be either &lsquo;<samp>R0</samp>&rsquo;, &lsquo;<samp>R1</samp>&rsquo;, &lsquo;<samp>R2</samp>&rsquo;, &lsquo;<samp>R3</samp>&rsquo;,
  152. &lsquo;<samp>R4</samp>&rsquo;, &lsquo;<samp>R5</samp>&rsquo;, &lsquo;<samp>R6</samp>&rsquo; or &lsquo;<samp>R7</samp>&rsquo;.
  153. </p>
  154. </dd>
  155. </dl>
  156. <p>Convene macro opcodes to deal with 16-bit values have been added.
  157. </p>
  158. <dl compact="compact">
  159. <dt><em>Immediate 16 Bit Wide</em></dt>
  160. <dd><p>&lsquo;<samp>#<var>number</var></samp>&rsquo;, or &lsquo;<samp>*<var>symbol</var></samp>&rsquo;
  161. </p>
  162. <p>For example:
  163. </p>
  164. <div class="smallexample">
  165. <pre class="smallexample">ldw R1, #1024
  166. ldw R3, timer
  167. ldw R1, (R1, #0)
  168. COM R1
  169. stw R2, (R1, #0)
  170. </pre></div>
  171. </dd>
  172. </dl>
  173. <hr>
  174. <div class="header">
  175. <p>
  176. Next: <a href="XGATE_002dDirectives.html#XGATE_002dDirectives" accesskey="n" rel="next">XGATE-Directives</a>, Previous: <a href="XGATE_002dOpts.html#XGATE_002dOpts" accesskey="p" rel="prev">XGATE-Opts</a>, Up: <a href="XGATE_002dDependent.html#XGATE_002dDependent" accesskey="u" rel="up">XGATE-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>
  177. </div>
  178. </body>
  179. </html>