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.
90 lines
4.4 KiB
HTML
90 lines
4.4 KiB
HTML
15 years ago
|
<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.7">
|
||
|
<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, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
|
||
|
2006, 2007 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.1
|
||
|
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''.
|
||
|
|
||
|
man end-->
|
||
|
<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; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="node">
|
||
|
<p>
|
||
|
<a name="Z80-Opcodes"></a>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><br>
|
||
|
</div>
|
||
|
|
||
|
<h4 class="subsection">9.32.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 (<span class="samp">ixl</span>,<span class="samp">ixh</span>,<span class="samp">iyl</span>,<span class="samp">iyh</span>) 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 <span class="samp">sla</span>. One can use <span class="samp">sll</span> as a
|
||
|
synonym for <span class="samp">sli</span>.
|
||
|
|
||
|
<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 <var>opc</var> may be any of <span class="samp">res </span><var>b</var><span class="samp">,</span>,
|
||
|
<span class="samp">set </span><var>b</var><span class="samp">,</span>, <span class="samp">rl</span>, <span class="samp">rlc</span>, <span class="samp">rr</span>, <span class="samp">rrc</span>,
|
||
|
<span class="samp">sla</span>, <span class="samp">sli</span>, <span class="samp">sra</span> and <span class="samp">srl</span>, and the register
|
||
|
<var>r</var> may be any of <span class="samp">a</span>, <span class="samp">b</span>, <span class="samp">c</span>, <span class="samp">d</span>,
|
||
|
<span class="samp">e</span>, <span class="samp">h</span> and <span class="samp">l</span>.
|
||
|
|
||
|
<br><dt><var>opc</var><code> (iy+</code><var>d</var><code>), </code><var>r</var><dd>As above, but with <span class="samp">iy</span> instead of <span class="samp">ix</span>.
|
||
|
</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>
|
||
|
|