You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
7.3 KiB
HTML
112 lines
7.3 KiB
HTML
4 years ago
|
<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-2015 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: <a rel="next" accesskey="n" href="M68K_002dFloat.html#M68K_002dFloat">M68K-Float</a>,
|
||
|
Previous: <a rel="previous" accesskey="p" href="M68K_002dSyntax.html#M68K_002dSyntax">M68K-Syntax</a>,
|
||
|
Up: <a rel="up" accesskey="u" href="M68K_002dDependent.html#M68K_002dDependent">M68K-Dependent</a>
|
||
|
<hr>
|
||
|
</div>
|
||
|
|
||
|
<h4 class="subsection">9.23.3 Motorola Syntax</h4>
|
||
|
|
||
|
<p><a name="index-Motorola-syntax-for-the-680x0-1359"></a><a name="index-alternate-syntax-for-the-680x0-1360"></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
|
||
|
(‘<samp><span class="samp">%a0</span></samp>’ through ‘<samp><span class="samp">%a7</span></samp>’), the program counter (‘<samp><span class="samp">%pc</span></samp>’), the
|
||
|
zero-address relative to the program counter (‘<samp><span class="samp">%zpc</span></samp>’), or a
|
||
|
suppressed address register (‘<samp><span class="samp">%za0</span></samp>’ through ‘<samp><span class="samp">%za7</span></samp>’). The use
|
||
|
of <var>size</var> means one of ‘<samp><span class="samp">w</span></samp>’ or ‘<samp><span class="samp">l</span></samp>’, and it may always be
|
||
|
omitted along with the leading dot. The use of <var>scale</var> means one of
|
||
|
‘<samp><span class="samp">1</span></samp>’, ‘<samp><span class="samp">2</span></samp>’, ‘<samp><span class="samp">4</span></samp>’, or ‘<samp><span class="samp">8</span></samp>’, 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>‘<samp><span class="samp">(%a0)</span></samp>’ through ‘<samp><span class="samp">(%a7)</span></samp>’<br>
|
||
|
‘<samp><span class="samp">%a7</span></samp>’ is also known as ‘<samp><span class="samp">%sp</span></samp>’, i.e., the Stack Pointer. <code>%a6</code>
|
||
|
is also known as ‘<samp><span class="samp">%fp</span></samp>’, the Frame Pointer.
|
||
|
|
||
|
<br><dt><dfn>Address Register Postincrement</dfn><dd>‘<samp><span class="samp">(%a0)+</span></samp>’ through ‘<samp><span class="samp">(%a7)+</span></samp>’
|
||
|
|
||
|
<br><dt><dfn>Address Register Predecrement</dfn><dd>‘<samp><span class="samp">-(%a0)</span></samp>’ through ‘<samp><span class="samp">-(%a7)</span></samp>’
|
||
|
|
||
|
<br><dt><dfn>Indirect Plus Offset</dfn><dd>‘<samp><var>number</var><span class="samp">(</span><var>%a0</var><span class="samp">)</span></samp>’ through ‘<samp><var>number</var><span class="samp">(</span><var>%a7</var><span class="samp">)</span></samp>’,
|
||
|
or ‘<samp><var>number</var><span class="samp">(</span><var>%pc</var><span class="samp">)</span></samp>’.
|
||
|
|
||
|
<p>The <var>number</var> may also appear within the parentheses, as in
|
||
|
‘<samp><span class="samp">(</span><var>number</var><span class="samp">,</span><var>%a0</var><span class="samp">)</span></samp>’. 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>‘<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>’
|
||
|
|
||
|
<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>‘<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>’
|
||
|
|
||
|
<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>‘<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>’
|
||
|
|
||
|
<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>
|
||
|
|