blob: de2eef1f7aefa91b67df66809d83b1c2e024705c [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file documents the GNU Assembler "as".
Copyright (C) 1991-2013 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".
-->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using as: M68K-Moto-Syntax</title>
<meta name="description" content="Using as: M68K-Moto-Syntax">
<meta name="keywords" content="Using as: M68K-Moto-Syntax">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="M68K_002dDependent.html#M68K_002dDependent" rel="up" title="M68K-Dependent">
<link href="M68K_002dFloat.html#M68K_002dFloat" rel="next" title="M68K-Float">
<link href="M68K_002dSyntax.html#M68K_002dSyntax" rel="prev" title="M68K-Syntax">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="M68K_002dMoto_002dSyntax"></a>
<div class="header">
<p>
Next: <a href="M68K_002dFloat.html#M68K_002dFloat" accesskey="n" rel="next">M68K-Float</a>, Previous: <a href="M68K_002dSyntax.html#M68K_002dSyntax" accesskey="p" rel="prev">M68K-Syntax</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>
</div>
<hr>
<a name="Motorola-Syntax"></a>
<h4 class="subsection">9.23.3 Motorola Syntax</h4>
<a name="index-Motorola-syntax-for-the-680x0"></a>
<a name="index-alternate-syntax-for-the-680x0"></a>
<p>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 <small>MIT</small> syntax is used for
other operands in the same instruction. The two kinds of syntax are
fully compatible.
</p>
<p>In the following table <var>apc</var> stands for any of the address registers
(&lsquo;<samp>%a0</samp>&rsquo; through &lsquo;<samp>%a7</samp>&rsquo;), the program counter (&lsquo;<samp>%pc</samp>&rsquo;), the
zero-address relative to the program counter (&lsquo;<samp>%zpc</samp>&rsquo;), or a
suppressed address register (&lsquo;<samp>%za0</samp>&rsquo; through &lsquo;<samp>%za7</samp>&rsquo;). The use
of <var>size</var> means one of &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>l</samp>&rsquo;, and it may always be
omitted along with the leading dot. The use of <var>scale</var> means one of
&lsquo;<samp>1</samp>&rsquo;, &lsquo;<samp>2</samp>&rsquo;, &lsquo;<samp>4</samp>&rsquo;, or &lsquo;<samp>8</samp>&rsquo;, and it may always be omitted
along with the leading asterisk.
</p>
<p>The following additional addressing modes are understood:
</p>
<dl compact="compact">
<dt><em>Address Register Indirect</em></dt>
<dd><p>&lsquo;<samp>(%a0)</samp>&rsquo; through &lsquo;<samp>(%a7)</samp>&rsquo;<br>
&lsquo;<samp>%a7</samp>&rsquo; is also known as &lsquo;<samp>%sp</samp>&rsquo;, i.e., the Stack Pointer. <code>%a6</code>
is also known as &lsquo;<samp>%fp</samp>&rsquo;, the Frame Pointer.
</p>
</dd>
<dt><em>Address Register Postincrement</em></dt>
<dd><p>&lsquo;<samp>(%a0)+</samp>&rsquo; through &lsquo;<samp>(%a7)+</samp>&rsquo;
</p>
</dd>
<dt><em>Address Register Predecrement</em></dt>
<dd><p>&lsquo;<samp>-(%a0)</samp>&rsquo; through &lsquo;<samp>-(%a7)</samp>&rsquo;
</p>
</dd>
<dt><em>Indirect Plus Offset</em></dt>
<dd><p>&lsquo;<samp><var>number</var>(<var>%a0</var>)</samp>&rsquo; through &lsquo;<samp><var>number</var>(<var>%a7</var>)</samp>&rsquo;,
or &lsquo;<samp><var>number</var>(<var>%pc</var>)</samp>&rsquo;.
</p>
<p>The <var>number</var> may also appear within the parentheses, as in
&lsquo;<samp>(<var>number</var>,<var>%a0</var>)</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).
</p>
</dd>
<dt><em>Index</em></dt>
<dd><p>&lsquo;<samp><var>number</var>(<var>apc</var>,<var>register</var>.<var>size</var>*<var>scale</var>)</samp>&rsquo;
</p>
<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.
</p>
</dd>
<dt><em>Postindex</em></dt>
<dd><p>&lsquo;<samp>([<var>number</var>,<var>apc</var>],<var>register</var>.<var>size</var>*<var>scale</var>,<var>onumber</var>)</samp>&rsquo;
</p>
<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.
</p>
</dd>
<dt><em>Preindex</em></dt>
<dd><p>&lsquo;<samp>([<var>number</var>,<var>apc</var>,<var>register</var>.<var>size</var>*<var>scale</var>],<var>onumber</var>)</samp>&rsquo;
</p>
<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.
</p></dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="M68K_002dFloat.html#M68K_002dFloat" accesskey="n" rel="next">M68K-Float</a>, Previous: <a href="M68K_002dSyntax.html#M68K_002dSyntax" accesskey="p" rel="prev">M68K-Syntax</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>
</div>
</body>
</html>