| <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, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 
 | 2000, 2001, 2002, 2006, 2007, 2008, 2009, 2010 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> | 
 | <link rel="stylesheet" type="text/css" href="../cs.css"> | 
 | </head> | 
 | <body> | 
 | <div class="node"> | 
 | <a name="Z80-Opcodes"></a> | 
 | <p> | 
 | Previous: <a rel="previous" accesskey="p" href="Z80-Directives.html#Z80-Directives">Z80 Directives</a>, | 
 | Up: <a rel="up" accesskey="u" href="Z80_002dDependent.html#Z80_002dDependent">Z80-Dependent</a> | 
 | <hr> | 
 | </div> | 
 |  | 
 | <h4 class="subsection">9.38.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 (‘<samp><span class="samp">ixl</span></samp>’,‘<samp><span class="samp">ixh</span></samp>’,‘<samp><span class="samp">iyl</span></samp>’,‘<samp><span class="samp">iyh</span></samp>’) 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><<1)+1</code>, the operand <var>m</var> can | 
 | be any operand that is valid for ‘<samp><span class="samp">sla</span></samp>’. One can use ‘<samp><span class="samp">sll</span></samp>’ as a | 
 | synonym for ‘<samp><span class="samp">sli</span></samp>’. | 
 |  | 
 |      <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 ‘<samp><var>opc</var></samp>’ may be any of ‘<samp><span class="samp">res </span><var>b</var><span class="samp">,</span></samp>’, | 
 | ‘<samp><span class="samp">set </span><var>b</var><span class="samp">,</span></samp>’, ‘<samp><span class="samp">rl</span></samp>’, ‘<samp><span class="samp">rlc</span></samp>’, ‘<samp><span class="samp">rr</span></samp>’, ‘<samp><span class="samp">rrc</span></samp>’, | 
 | ‘<samp><span class="samp">sla</span></samp>’, ‘<samp><span class="samp">sli</span></samp>’, ‘<samp><span class="samp">sra</span></samp>’ and ‘<samp><span class="samp">srl</span></samp>’, and the register | 
 | ‘<samp><var>r</var></samp>’ may be any of ‘<samp><span class="samp">a</span></samp>’, ‘<samp><span class="samp">b</span></samp>’, ‘<samp><span class="samp">c</span></samp>’, ‘<samp><span class="samp">d</span></samp>’, | 
 | ‘<samp><span class="samp">e</span></samp>’, ‘<samp><span class="samp">h</span></samp>’ and ‘<samp><span class="samp">l</span></samp>’. | 
 |  | 
 |      <br><dt><var>opc</var><code> (iy+</code><var>d</var><code>), </code><var>r</var><dd>As above, but with ‘<samp><span class="samp">iy</span></samp>’ instead of ‘<samp><span class="samp">ix</span></samp>’.  | 
 | </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 1991, 1992, 1993, 1994, 1995, 2003 --> | 
 | <!-- Free Software Foundation, Inc. --> | 
 | <!-- This is part of the GAS manual. --> | 
 | <!-- For copying conditions, see the file as.texinfo. --> | 
 |    </body></html> | 
 |  |