toolchain/share/doc/as.html/M68K_002dSyntax.html

104 lines
6.9 KiB
HTML
Raw Normal View History

2024-01-10 05:24:32 +00:00
<html lang="en">
<head>
<title>M68K-Syntax - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="M68K_002dDependent.html#M68K_002dDependent" title="M68K-Dependent">
<link rel="prev" href="M68K_002dOpts.html#M68K_002dOpts" title="M68K-Opts">
<link rel="next" href="M68K_002dMoto_002dSyntax.html#M68K_002dMoto_002dSyntax" title="M68K-Moto-Syntax">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/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">
<a name="M68K-Syntax"></a>
<a name="M68K_002dSyntax"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="M68K_002dMoto_002dSyntax.html#M68K_002dMoto_002dSyntax">M68K-Moto-Syntax</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="M68K_002dOpts.html#M68K_002dOpts">M68K-Opts</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="M68K_002dDependent.html#M68K_002dDependent">M68K-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.22.2 Syntax</h4>
<p><a name="index-g_t_0040sc_007bmit_007d-1420"></a>This syntax for the Motorola 680x0 was developed at <span class="sc">mit</span>.
<p><a name="index-M680x0-syntax-1421"></a><a name="index-syntax_002c-M680x0-1422"></a><a name="index-M680x0-size-modifiers-1423"></a><a name="index-size-modifiers_002c-M680x0-1424"></a>The 680x0 version of <code>as</code> uses instructions names and
syntax compatible with the Sun assembler. Intervening periods are
ignored; for example, &lsquo;<samp><span class="samp">movl</span></samp>&rsquo; is equivalent to &lsquo;<samp><span class="samp">mov.l</span></samp>&rsquo;.
<p>In the following table <var>apc</var> stands for any of the address registers
(&lsquo;<samp><span class="samp">%a0</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%a7</span></samp>&rsquo;), the program counter (&lsquo;<samp><span class="samp">%pc</span></samp>&rsquo;), the
zero-address relative to the program counter (&lsquo;<samp><span class="samp">%zpc</span></samp>&rsquo;), a suppressed
address register (&lsquo;<samp><span class="samp">%za0</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%za7</span></samp>&rsquo;), or it may be omitted
entirely. The use of <var>size</var> means one of &lsquo;<samp><span class="samp">w</span></samp>&rsquo; or &lsquo;<samp><span class="samp">l</span></samp>&rsquo;, and
it may be omitted, along with the leading colon, unless a scale is also
specified. The use of <var>scale</var> means one of &lsquo;<samp><span class="samp">1</span></samp>&rsquo;, &lsquo;<samp><span class="samp">2</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">4</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">8</span></samp>&rsquo;, and it may always be omitted along with the
leading colon.
<p><a name="index-M680x0-addressing-modes-1425"></a><a name="index-addressing-modes_002c-M680x0-1426"></a>The following addressing modes are understood:
<dl>
<dt><dfn>Immediate</dfn><dd>&lsquo;<samp><span class="samp">#</span><var>number</var></samp>&rsquo;
<br><dt><dfn>Data Register</dfn><dd>&lsquo;<samp><span class="samp">%d0</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%d7</span></samp>&rsquo;
<br><dt><dfn>Address Register</dfn><dd>&lsquo;<samp><span class="samp">%a0</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%a7</span></samp>&rsquo;<br>
&lsquo;<samp><span class="samp">%a7</span></samp>&rsquo; is also known as &lsquo;<samp><span class="samp">%sp</span></samp>&rsquo;, i.e., the Stack Pointer. <code>%a6</code>
is also known as &lsquo;<samp><span class="samp">%fp</span></samp>&rsquo;, the Frame Pointer.
<br><dt><dfn>Address Register Indirect</dfn><dd>&lsquo;<samp><span class="samp">%a0@</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%a7@</span></samp>&rsquo;
<br><dt><dfn>Address Register Postincrement</dfn><dd>&lsquo;<samp><span class="samp">%a0@+</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%a7@+</span></samp>&rsquo;
<br><dt><dfn>Address Register Predecrement</dfn><dd>&lsquo;<samp><span class="samp">%a0@-</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%a7@-</span></samp>&rsquo;
<br><dt><dfn>Indirect Plus Offset</dfn><dd>&lsquo;<samp><var>apc</var><span class="samp">@(</span><var>number</var><span class="samp">)</span></samp>&rsquo;
<br><dt><dfn>Index</dfn><dd>&lsquo;<samp><var>apc</var><span class="samp">@(</span><var>number</var><span class="samp">,</span><var>register</var><span class="samp">:</span><var>size</var><span class="samp">:</span><var>scale</var><span class="samp">)</span></samp>&rsquo;
<p>The <var>number</var> may be omitted.
<br><dt><dfn>Postindex</dfn><dd>&lsquo;<samp><var>apc</var><span class="samp">@(</span><var>number</var><span class="samp">)@(</span><var>onumber</var><span class="samp">,</span><var>register</var><span class="samp">:</span><var>size</var><span class="samp">:</span><var>scale</var><span class="samp">)</span></samp>&rsquo;
<p>The <var>onumber</var> or the <var>register</var>, but not both, may be omitted.
<br><dt><dfn>Preindex</dfn><dd>&lsquo;<samp><var>apc</var><span class="samp">@(</span><var>number</var><span class="samp">,</span><var>register</var><span class="samp">:</span><var>size</var><span class="samp">:</span><var>scale</var><span class="samp">)@(</span><var>onumber</var><span class="samp">)</span></samp>&rsquo;
<p>The <var>number</var> may be omitted. Omitting the <var>register</var> produces
the Postindex addressing mode.
<br><dt><dfn>Absolute</dfn><dd>&lsquo;<samp><var>symbol</var></samp>&rsquo;, or &lsquo;<samp><var>digits</var></samp>&rsquo;, optionally followed by
&lsquo;<samp><span class="samp">:b</span></samp>&rsquo;, &lsquo;<samp><span class="samp">:w</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">:l</span></samp>&rsquo;.
</dl>
</body></html>