blob: 4d9365d008307ce404242ffcc54cc915872f9826 [file] [log] [blame]
<html lang="en">
<head>
<title>Z80 Opcodes - 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="Z80_002dDependent.html#Z80_002dDependent" title="Z80-Dependent">
<link rel="prev" href="Z80-Directives.html#Z80-Directives" title="Z80 Directives">
<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="Z80-Opcodes"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Z80-Directives.html#Z80-Directives">Z80 Directives</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Z80_002dDependent.html#Z80_002dDependent">Z80-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.56.5 Opcodes</h4>
<p>In line with common practice, Z80 mnemonics are used for both the Z80 and
the R800.
<p>In many instructions it is possible to use one of the half index
registers (&lsquo;<samp><span class="samp">ixl</span></samp>&rsquo;,&lsquo;<samp><span class="samp">ixh</span></samp>&rsquo;,&lsquo;<samp><span class="samp">iyl</span></samp>&rsquo;,&lsquo;<samp><span class="samp">iyh</span></samp>&rsquo;) in stead of an
8-bit general purpose register. This yields instructions that are
documented on the R800 and undocumented on the Z80.
Similarly <code>in f,(c)</code> is documented on the R800 and undocumented on
the Z80.
<p>The assembler also supports the following undocumented Z80-instructions,
that have not been adopted in the R800 instruction set:
<dl>
<dt><code>out (c),0</code><dd>Sends zero to the port pointed to by register c.
<br><dt><code>sli </code><var>m</var><dd>Equivalent to <var>m</var><code> = (</code><var>m</var><code>&lt;&lt;1)+1</code>, the operand <var>m</var> can
be any operand that is valid for &lsquo;<samp><span class="samp">sla</span></samp>&rsquo;. One can use &lsquo;<samp><span class="samp">sll</span></samp>&rsquo; as a
synonym for &lsquo;<samp><span class="samp">sli</span></samp>&rsquo;.
<br><dt><var>op</var><code> (ix+</code><var>d</var><code>), </code><var>r</var><dd>This is equivalent to
<pre class="example"> ld <var>r</var>, (ix+<var>d</var>)
<var>opc</var> <var>r</var>
ld (ix+<var>d</var>), <var>r</var>
</pre>
<p>The operation &lsquo;<samp><var>opc</var></samp>&rsquo; may be any of &lsquo;<samp><span class="samp">res </span><var>b</var><span class="samp">,</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">set </span><var>b</var><span class="samp">,</span></samp>&rsquo;, &lsquo;<samp><span class="samp">rl</span></samp>&rsquo;, &lsquo;<samp><span class="samp">rlc</span></samp>&rsquo;, &lsquo;<samp><span class="samp">rr</span></samp>&rsquo;, &lsquo;<samp><span class="samp">rrc</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">sla</span></samp>&rsquo;, &lsquo;<samp><span class="samp">sli</span></samp>&rsquo;, &lsquo;<samp><span class="samp">sra</span></samp>&rsquo; and &lsquo;<samp><span class="samp">srl</span></samp>&rsquo;, and the register
&lsquo;<samp><var>r</var></samp>&rsquo; may be any of &lsquo;<samp><span class="samp">a</span></samp>&rsquo;, &lsquo;<samp><span class="samp">b</span></samp>&rsquo;, &lsquo;<samp><span class="samp">c</span></samp>&rsquo;, &lsquo;<samp><span class="samp">d</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">e</span></samp>&rsquo;, &lsquo;<samp><span class="samp">h</span></samp>&rsquo; and &lsquo;<samp><span class="samp">l</span></samp>&rsquo;.
<br><dt><var>opc</var><code> (iy+</code><var>d</var><code>), </code><var>r</var><dd>As above, but with &lsquo;<samp><span class="samp">iy</span></samp>&rsquo; instead of &lsquo;<samp><span class="samp">ix</span></samp>&rsquo;.
</dl>
<p>The web site at <a href="http://www.z80.info">http://www.z80.info</a> is a good starting place to
find more information on programming the Z80.
<!-- Copyright (C) 1991-2019 Free Software Foundation, Inc. -->
<!-- This is part of the GAS manual. -->
<!-- For copying conditions, see the file as.texinfo. -->
</body></html>