blob: a3e02f3a8cbd985220ee8a30e42553bfdc837d0b [file] [log] [blame]
<html lang="en">
<head>
<title>M68K-Moto-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_002dSyntax.html#M68K_002dSyntax" title="M68K-Syntax">
<link rel="next" href="M68K_002dFloat.html#M68K_002dFloat" title="M68K-Float">
<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-Moto-Syntax"></a>
<a name="M68K_002dMoto_002dSyntax"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="M68K_002dFloat.html#M68K_002dFloat">M68K-Float</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="M68K_002dSyntax.html#M68K_002dSyntax">M68K-Syntax</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="M68K_002dDependent.html#M68K_002dDependent">M68K-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.22.3 Motorola Syntax</h4>
<p><a name="index-Motorola-syntax-for-the-680x0-1427"></a><a name="index-alternate-syntax-for-the-680x0-1428"></a>
The standard Motorola syntax for this chip differs from the syntax
already discussed (see <a href="M68K_002dSyntax.html#M68K_002dSyntax">Syntax</a>). <code>as</code> can
accept Motorola syntax for operands, even if <span class="sc">mit</span> syntax is used for
other operands in the same instruction. The two kinds of syntax are
fully compatible.
<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;), or a
suppressed address register (&lsquo;<samp><span class="samp">%za0</span></samp>&rsquo; through &lsquo;<samp><span class="samp">%za7</span></samp>&rsquo;). 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 always be
omitted along with the leading dot. 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 asterisk.
<p>The following additional addressing modes are understood:
<dl>
<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>
&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 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>number</var><span class="samp">(</span><var>%a0</var><span class="samp">)</span></samp>&rsquo; through &lsquo;<samp><var>number</var><span class="samp">(</span><var>%a7</var><span class="samp">)</span></samp>&rsquo;,
or &lsquo;<samp><var>number</var><span class="samp">(</span><var>%pc</var><span class="samp">)</span></samp>&rsquo;.
<p>The <var>number</var> may also appear within the parentheses, as in
&lsquo;<samp><span class="samp">(</span><var>number</var><span class="samp">,</span><var>%a0</var><span class="samp">)</span></samp>&rsquo;. When used with the <var>pc</var>, the
<var>number</var> may be omitted (with an address register, omitting the
<var>number</var> produces Address Register Indirect mode).
<br><dt><dfn>Index</dfn><dd>&lsquo;<samp><var>number</var><span class="samp">(</span><var>apc</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, or it may appear within the
parentheses. The <var>apc</var> may be omitted. The <var>register</var> and the
<var>apc</var> may appear in either order. If both <var>apc</var> and
<var>register</var> are address registers, and the <var>size</var> and <var>scale</var>
are omitted, then the first register is taken as the base register, and
the second as the index register.
<br><dt><dfn>Postindex</dfn><dd>&lsquo;<samp><span class="samp">([</span><var>number</var><span class="samp">,</span><var>apc</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>onumber</var>, or the <var>register</var>, or both, may be omitted.
Either the <var>number</var> or the <var>apc</var> may be omitted, but not both.
<br><dt><dfn>Preindex</dfn><dd>&lsquo;<samp><span class="samp">([</span><var>number</var><span class="samp">,</span><var>apc</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>, or the <var>apc</var>, or the <var>register</var>, or any two of
them, may be omitted. The <var>onumber</var> may be omitted. The
<var>register</var> and the <var>apc</var> may appear in either order. If both
<var>apc</var> and <var>register</var> are address registers, and the <var>size</var>
and <var>scale</var> are omitted, then the first register is taken as the
base register, and the second as the index register.
</dl>
</body></html>