Z80-Directives.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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-2017 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.2, 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="prev" 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="prev">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.54.4 Z80 Assembler Directives</h4>
  65. <p><code>as</code> for the Z80 supports some additional directives for
  66. compatibility with other assemblers.
  67. </p>
  68. <a name="index-Z80_002donly-directives"></a>
  69. <p>These are the additional directives in <code>as</code> for the Z80:
  70. </p>
  71. <dl compact="compact">
  72. <dt><code>db <var>expression</var>|<var>string</var>[,<var>expression</var>|<var>string</var>...]</code></dt>
  73. <dt><code>defb <var>expression</var>|<var>string</var>[,<var>expression</var>|<var>string</var>...]</code></dt>
  74. <dd><p>For each <var>string</var> the characters are copied to the object file, for
  75. each other <var>expression</var> the value is stored in one byte.
  76. A warning is issued in case of an overflow.
  77. </p>
  78. </dd>
  79. <dt><code>dw <var>expression</var>[,<var>expression</var>...]</code></dt>
  80. <dt><code>defw <var>expression</var>[,<var>expression</var>...]</code></dt>
  81. <dd><p>For each <var>expression</var> the value is stored in two bytes, ignoring
  82. overflow.
  83. </p>
  84. </dd>
  85. <dt><code>d24 <var>expression</var>[,<var>expression</var>...]</code></dt>
  86. <dt><code>def24 <var>expression</var>[,<var>expression</var>...]</code></dt>
  87. <dd><p>For each <var>expression</var> the value is stored in three bytes, ignoring
  88. overflow.
  89. </p>
  90. </dd>
  91. <dt><code>d32 <var>expression</var>[,<var>expression</var>...]</code></dt>
  92. <dt><code>def32 <var>expression</var>[,<var>expression</var>...]</code></dt>
  93. <dd><p>For each <var>expression</var> the value is stored in four bytes, ignoring
  94. overflow.
  95. </p>
  96. </dd>
  97. <dt><code>ds <var>count</var>[, <var>value</var>]</code></dt>
  98. <dt><code>defs <var>count</var>[, <var>value</var>]</code></dt>
  99. <dd><p>Fill <var>count</var> bytes in the object file with <var>value</var>, if
  100. <var>value</var> is omitted it defaults to zero.
  101. </p>
  102. </dd>
  103. <dt><code><var>symbol</var> equ <var>expression</var></code></dt>
  104. <dt><code><var>symbol</var> defl <var>expression</var></code></dt>
  105. <dd><p>These directives set the value of <var>symbol</var> to <var>expression</var>. If
  106. <code>equ</code> is used, it is an error if <var>symbol</var> is already defined.
  107. Symbols defined with <code>equ</code> are not protected from redefinition.
  108. </p>
  109. </dd>
  110. <dt><code>set</code></dt>
  111. <dd><p>This is a normal instruction on Z80, and not an assembler directive.
  112. </p>
  113. </dd>
  114. <dt><code>psect <var>name</var></code></dt>
  115. <dd><p>A synonym for See <a href="Section.html#Section">Section</a>, no second argument should be given.
  116. </p>
  117. </dd>
  118. </dl>
  119. </body>
  120. </html>