1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- This file documents the GNU Assembler "as". 4 5Copyright (C) 1991-2021 Free Software Foundation, Inc. 6 7Permission is granted to copy, distribute and/or modify this document 8under the terms of the GNU Free Documentation License, Version 1.3 9or any later version published by the Free Software Foundation; 10with no Invariant Sections, with no Front-Cover Texts, and with no 11Back-Cover Texts. A copy of the license is included in the 12section entitled "GNU Free Documentation License". 13 --> 14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 15<head> 16<title>Using as: Z80 Directives</title> 17 18<meta name="description" content="Using as: Z80 Directives"> 19<meta name="keywords" content="Using as: Z80 Directives"> 20<meta name="resource-type" content="document"> 21<meta name="distribution" content="global"> 22<meta name="Generator" content="makeinfo"> 23<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 24<link href="index.html#Top" rel="start" title="Top"> 25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index"> 26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 27<link href="Z80_002dDependent.html#Z80_002dDependent" rel="up" title="Z80-Dependent"> 28<link href="Z80-Opcodes.html#Z80-Opcodes" rel="next" title="Z80 Opcodes"> 29<link href="Z80-Floating-Point.html#Z80-Floating-Point" rel="previous" title="Z80 Floating Point"> 30<style type="text/css"> 31<!-- 32a.summary-letter {text-decoration: none} 33blockquote.smallquotation {font-size: smaller} 34div.display {margin-left: 3.2em} 35div.example {margin-left: 3.2em} 36div.indentedblock {margin-left: 3.2em} 37div.lisp {margin-left: 3.2em} 38div.smalldisplay {margin-left: 3.2em} 39div.smallexample {margin-left: 3.2em} 40div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 41div.smalllisp {margin-left: 3.2em} 42kbd {font-style:oblique} 43pre.display {font-family: inherit} 44pre.format {font-family: inherit} 45pre.menu-comment {font-family: serif} 46pre.menu-preformatted {font-family: serif} 47pre.smalldisplay {font-family: inherit; font-size: smaller} 48pre.smallexample {font-size: smaller} 49pre.smallformat {font-family: inherit; font-size: smaller} 50pre.smalllisp {font-size: smaller} 51span.nocodebreak {white-space:nowrap} 52span.nolinebreak {white-space:nowrap} 53span.roman {font-family:serif; font-weight:normal} 54span.sansserif {font-family:sans-serif; font-weight:normal} 55ul.no-bullet {list-style: none} 56--> 57</style> 58 59 60</head> 61 62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 63<a name="Z80-Directives"></a> 64<div class="header"> 65<p> 66Next: <a href="Z80-Opcodes.html#Z80-Opcodes" accesskey="n" rel="next">Z80 Opcodes</a>, Previous: <a href="Z80-Floating-Point.html#Z80-Floating-Point" accesskey="p" rel="previous">Z80 Floating Point</a>, Up: <a href="Z80_002dDependent.html#Z80_002dDependent" accesskey="u" rel="up">Z80-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 67</div> 68<hr> 69<a name="Z80-Assembler-Directives"></a> 70<h4 class="subsection">9.56.4 Z80 Assembler Directives</h4> 71<a name="index-Z80_002donly-directives"></a> 72 73<p><code>as</code> for the Z80 supports some additional directives for 74compatibility with other assemblers. 75</p> 76<p>These are the additional directives in <code>as</code> for the Z80: 77</p> 78<dl compact="compact"> 79<dt><code><code>.assume ADL = <var>expression</var></code></code></dt> 80<dd><a name="index-_002eassume-directive_002c-Z80"></a> 81<p>Set ADL status for eZ80. Non-zero value enable compilation in ADL mode else 82used Z80 mode. ADL and Z80 mode produces incompatible object code. Mixing 83both of them within one binary may lead problems with disassembler. 84</p> 85</dd> 86<dt><code><code>db <var>expression</var>|<var>string</var>[,<var>expression</var>|<var>string</var>...]</code></code></dt> 87<dd><a name="index-db-directive_002c-Z80"></a> 88</dd> 89<dt><code><code>defb <var>expression</var>|<var>string</var>[,<var>expression</var>|<var>string</var>...]</code></code></dt> 90<dd><a name="index-defb-directive_002c-Z80"></a> 91</dd> 92<dt><code><code>defm <var>string</var>[,<var>string</var>...]</code></code></dt> 93<dd><a name="index-defm-directive_002c-Z80"></a> 94<p>For each <var>string</var> the characters are copied to the object file, for 95each other <var>expression</var> the value is stored in one byte. 96A warning is issued in case of an overflow. 97Backslash symbol in the strings is generic symbol, it cannot be used as 98escape character. See <a href="Ascii.html#Ascii"><code>.ascii</code></a>. 99</p> 100</dd> 101<dt><code><code>dw <var>expression</var>[,<var>expression</var>...]</code></code></dt> 102<dd><a name="index-dw-directive_002c-Z80"></a> 103</dd> 104<dt><code><code>defw <var>expression</var>[,<var>expression</var>...]</code></code></dt> 105<dd><a name="index-defw-directive_002c-Z80"></a> 106<p>For each <var>expression</var> the value is stored in two bytes, ignoring 107overflow. 108</p> 109</dd> 110<dt><code><code>d24 <var>expression</var>[,<var>expression</var>...]</code></code></dt> 111<dd><a name="index-d24-directive_002c-Z80"></a> 112</dd> 113<dt><code><code>def24 <var>expression</var>[,<var>expression</var>...]</code></code></dt> 114<dd><a name="index-def24-directive_002c-Z80"></a> 115<p>For each <var>expression</var> the value is stored in three bytes, ignoring 116overflow. 117</p> 118</dd> 119<dt><code><code>d32 <var>expression</var>[,<var>expression</var>...]</code></code></dt> 120<dd><a name="index-d32-directive_002c-Z80"></a> 121</dd> 122<dt><code><code>def32 <var>expression</var>[,<var>expression</var>...]</code></code></dt> 123<dd><a name="index-def32-directive_002c-Z80"></a> 124<p>For each <var>expression</var> the value is stored in four bytes, ignoring 125overflow. 126</p> 127</dd> 128<dt><code><code>ds <var>count</var>[, <var>value</var>]</code></code></dt> 129<dd><a name="index-ds-directive_002c-Z80"></a> 130</dd> 131<dt><code><code>defs <var>count</var>[, <var>value</var>]</code></code></dt> 132<dd><a name="index-defs-directive_002c-Z80"></a> 133<p>Fill <var>count</var> bytes in the object file with <var>value</var>, if 134<var>value</var> is omitted it defaults to zero. 135</p> 136</dd> 137<dt><code><code><var>symbol</var> defl <var>expression</var></code></code></dt> 138<dd><a name="index-defl-directive_002c-Z80"></a> 139<p>The <code>defl</code> directive is like <code>.set</code> but with different 140syntax. See <a href="Set.html#Set"><code>.set</code></a>. 141It set the value of <var>symbol</var> to <var>expression</var>. Symbols defined 142with <code>defl</code> are not protected from redefinition. 143</p> 144</dd> 145<dt><code><code><var>symbol</var> equ <var>expression</var></code></code></dt> 146<dd><a name="index-equ-directive_002c-Z80"></a> 147<p>The <code>equ</code> directive is like <code>.equiv</code> but with different 148syntax. See <a href="Equiv.html#Equiv"><code>.equiv</code></a>. 149It set the value of <var>symbol</var> to <var>expression</var>. It is an error 150if <var>symbol</var> is already defined. Symbols defined with <code>equ</code> 151are not protected from redefinition. 152</p> 153</dd> 154<dt><code><code>psect <var>name</var></code></code></dt> 155<dd><a name="index-psect-directive_002c-Z80"></a> 156<p>A synonym for <code>.section</code>, no second argument should be given. 157See <a href="Section.html#Section"><code>.section</code></a>. 158</p> 159</dd> 160<dt><code><code>xdef <var>symbol</var></code></code></dt> 161<dd><a name="index-xdef-directive_002c-Z80"></a> 162<p>A synonym for <code>.global</code>, make <var>symbol</var> is visible to linker. 163See <a href="Global.html#Global"><code>.global</code></a>. 164</p> 165</dd> 166<dt><code><code>xref <var>name</var></code></code></dt> 167<dd><a name="index-xref-directive_002c-Z80"></a> 168<p>A synonym for <code>.extern</code> (<a href="Extern.html#Extern"><code>.extern</code></a>). 169</p> 170</dd> 171</dl> 172 173<hr> 174<div class="header"> 175<p> 176Next: <a href="Z80-Opcodes.html#Z80-Opcodes" accesskey="n" rel="next">Z80 Opcodes</a>, Previous: <a href="Z80-Floating-Point.html#Z80-Floating-Point" accesskey="p" rel="previous">Z80 Floating Point</a>, Up: <a href="Z80_002dDependent.html#Z80_002dDependent" accesskey="u" rel="up">Z80-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p> 177</div> 178 179 180 181</body> 182</html> 183