blob: 500ff532d9355fb70f169ab7fe4fd76b704a5a9b [file] [log] [blame]
<html lang="en">
<head>
<title>Z80 Directives - 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-Floating-Point.html#Z80-Floating-Point" title="Z80 Floating Point">
<link rel="next" href="Z80-Opcodes.html#Z80-Opcodes" title="Z80 Opcodes">
<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-Directives"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Z80-Opcodes.html#Z80-Opcodes">Z80 Opcodes</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Z80-Floating-Point.html#Z80-Floating-Point">Z80 Floating Point</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Z80_002dDependent.html#Z80_002dDependent">Z80-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.38.4 Z80 Assembler Directives</h4>
<p><samp><span class="command">as</span></samp> for the Z80 supports some additional directives for
compatibility with other assemblers.
<p><a name="index-Z80_002donly-directives-1857"></a>These are the additional directives in <code>as</code> for the Z80:
<dl>
<dt><code>db </code><var>expression</var><code>|</code><var>string</var><code>[,</code><var>expression</var><code>|</code><var>string</var><code>...]</code><dt><code>defb </code><var>expression</var><code>|</code><var>string</var><code>[,</code><var>expression</var><code>|</code><var>string</var><code>...]</code><dd>For each <var>string</var> the characters are copied to the object file, for
each other <var>expression</var> the value is stored in one byte.
A warning is issued in case of an overflow.
<br><dt><code>dw </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dt><code>defw </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dd>For each <var>expression</var> the value is stored in two bytes, ignoring
overflow.
<br><dt><code>d24 </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dt><code>def24 </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dd>For each <var>expression</var> the value is stored in three bytes, ignoring
overflow.
<br><dt><code>d32 </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dt><code>def32 </code><var>expression</var><code>[,</code><var>expression</var><code>...]</code><dd>For each <var>expression</var> the value is stored in four bytes, ignoring
overflow.
<br><dt><code>ds </code><var>count</var><code>[, </code><var>value</var><code>]</code><dt><code>defs </code><var>count</var><code>[, </code><var>value</var><code>]</code><dd><!-- Synonyms for @code{ds.b}, -->
<!-- which should have been described elsewhere -->
Fill <var>count</var> bytes in the object file with <var>value</var>, if
<var>value</var> is omitted it defaults to zero.
<br><dt><var>symbol</var><code> equ </code><var>expression</var><dt><var>symbol</var><code> defl </code><var>expression</var><dd>These directives set the value of <var>symbol</var> to <var>expression</var>. If
<code>equ</code> is used, it is an error if <var>symbol</var> is already defined.
Symbols defined with <code>equ</code> are not protected from redefinition.
<br><dt><code>set</code><dd>This is a normal instruction on Z80, and not an assembler directive.
<br><dt><code>psect </code><var>name</var><dd>A synonym for See <a href="Section.html#Section">Section</a>, no second argument should be given.
</dl>
</body></html>