M68K_002dSyntax.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>Using as: M68K-Syntax</title>
  15. <meta name="description" content="Using as: M68K-Syntax">
  16. <meta name="keywords" content="Using as: M68K-Syntax">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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="M68K_002dDependent.html#M68K_002dDependent" rel="up" title="M68K-Dependent">
  25. <link href="M68K_002dMoto_002dSyntax.html#M68K_002dMoto_002dSyntax" rel="next" title="M68K-Moto-Syntax">
  26. <link href="M68K_002dOpts.html#M68K_002dOpts" rel="prev" title="M68K-Opts">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.smallquotation {font-size: smaller}
  31. div.display {margin-left: 3.2em}
  32. div.example {margin-left: 3.2em}
  33. div.indentedblock {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  49. span.nolinebreak {white-space:nowrap}
  50. span.roman {font-family:serif; font-weight:normal}
  51. span.sansserif {font-family:sans-serif; font-weight:normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  57. <a name="M68K_002dSyntax"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="M68K_002dMoto_002dSyntax.html#M68K_002dMoto_002dSyntax" accesskey="n" rel="next">M68K-Moto-Syntax</a>, Previous: <a href="M68K_002dOpts.html#M68K_002dOpts" accesskey="p" rel="prev">M68K-Opts</a>, Up: <a href="M68K_002dDependent.html#M68K_002dDependent" accesskey="u" rel="up">M68K-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>
  61. </div>
  62. <hr>
  63. <a name="Syntax-16"></a>
  64. <h4 class="subsection">9.23.2 Syntax</h4>
  65. <a name="index-MIT"></a>
  66. <p>This syntax for the Motorola 680x0 was developed at <small>MIT</small>.
  67. </p>
  68. <a name="index-M680x0-syntax"></a>
  69. <a name="index-syntax_002c-M680x0"></a>
  70. <a name="index-M680x0-size-modifiers"></a>
  71. <a name="index-size-modifiers_002c-M680x0"></a>
  72. <p>The 680x0 version of <code>as</code> uses instructions names and
  73. syntax compatible with the Sun assembler. Intervening periods are
  74. ignored; for example, &lsquo;<samp>movl</samp>&rsquo; is equivalent to &lsquo;<samp>mov.l</samp>&rsquo;.
  75. </p>
  76. <p>In the following table <var>apc</var> stands for any of the address registers
  77. (&lsquo;<samp>%a0</samp>&rsquo; through &lsquo;<samp>%a7</samp>&rsquo;), the program counter (&lsquo;<samp>%pc</samp>&rsquo;), the
  78. zero-address relative to the program counter (&lsquo;<samp>%zpc</samp>&rsquo;), a suppressed
  79. address register (&lsquo;<samp>%za0</samp>&rsquo; through &lsquo;<samp>%za7</samp>&rsquo;), or it may be omitted
  80. entirely. The use of <var>size</var> means one of &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>l</samp>&rsquo;, and
  81. it may be omitted, along with the leading colon, unless a scale is also
  82. specified. The use of <var>scale</var> means one of &lsquo;<samp>1</samp>&rsquo;, &lsquo;<samp>2</samp>&rsquo;,
  83. &lsquo;<samp>4</samp>&rsquo;, or &lsquo;<samp>8</samp>&rsquo;, and it may always be omitted along with the
  84. leading colon.
  85. </p>
  86. <a name="index-M680x0-addressing-modes"></a>
  87. <a name="index-addressing-modes_002c-M680x0"></a>
  88. <p>The following addressing modes are understood:
  89. </p><dl compact="compact">
  90. <dt><em>Immediate</em></dt>
  91. <dd><p>&lsquo;<samp>#<var>number</var></samp>&rsquo;
  92. </p>
  93. </dd>
  94. <dt><em>Data Register</em></dt>
  95. <dd><p>&lsquo;<samp>%d0</samp>&rsquo; through &lsquo;<samp>%d7</samp>&rsquo;
  96. </p>
  97. </dd>
  98. <dt><em>Address Register</em></dt>
  99. <dd><p>&lsquo;<samp>%a0</samp>&rsquo; through &lsquo;<samp>%a7</samp>&rsquo;<br>
  100. &lsquo;<samp>%a7</samp>&rsquo; is also known as &lsquo;<samp>%sp</samp>&rsquo;, i.e., the Stack Pointer. <code>%a6</code>
  101. is also known as &lsquo;<samp>%fp</samp>&rsquo;, the Frame Pointer.
  102. </p>
  103. </dd>
  104. <dt><em>Address Register Indirect</em></dt>
  105. <dd><p>&lsquo;<samp>%a0@</samp>&rsquo; through &lsquo;<samp>%a7@</samp>&rsquo;
  106. </p>
  107. </dd>
  108. <dt><em>Address Register Postincrement</em></dt>
  109. <dd><p>&lsquo;<samp>%a0@+</samp>&rsquo; through &lsquo;<samp>%a7@+</samp>&rsquo;
  110. </p>
  111. </dd>
  112. <dt><em>Address Register Predecrement</em></dt>
  113. <dd><p>&lsquo;<samp>%a0@-</samp>&rsquo; through &lsquo;<samp>%a7@-</samp>&rsquo;
  114. </p>
  115. </dd>
  116. <dt><em>Indirect Plus Offset</em></dt>
  117. <dd><p>&lsquo;<samp><var>apc</var>@(<var>number</var>)</samp>&rsquo;
  118. </p>
  119. </dd>
  120. <dt><em>Index</em></dt>
  121. <dd><p>&lsquo;<samp><var>apc</var>@(<var>number</var>,<var>register</var>:<var>size</var>:<var>scale</var>)</samp>&rsquo;
  122. </p>
  123. <p>The <var>number</var> may be omitted.
  124. </p>
  125. </dd>
  126. <dt><em>Postindex</em></dt>
  127. <dd><p>&lsquo;<samp><var>apc</var>@(<var>number</var>)@(<var>onumber</var>,<var>register</var>:<var>size</var>:<var>scale</var>)</samp>&rsquo;
  128. </p>
  129. <p>The <var>onumber</var> or the <var>register</var>, but not both, may be omitted.
  130. </p>
  131. </dd>
  132. <dt><em>Preindex</em></dt>
  133. <dd><p>&lsquo;<samp><var>apc</var>@(<var>number</var>,<var>register</var>:<var>size</var>:<var>scale</var>)@(<var>onumber</var>)</samp>&rsquo;
  134. </p>
  135. <p>The <var>number</var> may be omitted. Omitting the <var>register</var> produces
  136. the Postindex addressing mode.
  137. </p>
  138. </dd>
  139. <dt><em>Absolute</em></dt>
  140. <dd><p>&lsquo;<samp><var>symbol</var></samp>&rsquo;, or &lsquo;<samp><var>digits</var></samp>&rsquo;, optionally followed by
  141. &lsquo;<samp>:b</samp>&rsquo;, &lsquo;<samp>:w</samp>&rsquo;, or &lsquo;<samp>:l</samp>&rsquo;.
  142. </p></dd>
  143. </dl>
  144. <hr>
  145. <div class="header">
  146. <p>
  147. Next: <a href="M68K_002dMoto_002dSyntax.html#M68K_002dMoto_002dSyntax" accesskey="n" rel="next">M68K-Moto-Syntax</a>, Previous: <a href="M68K_002dOpts.html#M68K_002dOpts" accesskey="p" rel="prev">M68K-Opts</a>, Up: <a href="M68K_002dDependent.html#M68K_002dDependent" accesskey="u" rel="up">M68K-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>
  148. </div>
  149. </body>
  150. </html>