Z80-Directives.html 8.2 KB

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