ESA_002f390-Directives.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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: ESA/390 Directives</title>
  15. <meta name="description" content="Using as: ESA/390 Directives">
  16. <meta name="keywords" content="Using as: ESA/390 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="ESA_002f390_002dDependent.html#ESA_002f390_002dDependent" rel="up" title="ESA/390-Dependent">
  25. <link href="ESA_002f390-Opcodes.html#ESA_002f390-Opcodes" rel="next" title="ESA/390 Opcodes">
  26. <link href="ESA_002f390-Floating-Point.html#ESA_002f390-Floating-Point" rel="prev" title="ESA/390 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="ESA_002f390-Directives"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="ESA_002f390-Opcodes.html#ESA_002f390-Opcodes" accesskey="n" rel="next">ESA/390 Opcodes</a>, Previous: <a href="ESA_002f390-Floating-Point.html#ESA_002f390-Floating-Point" accesskey="p" rel="prev">ESA/390 Floating Point</a>, Up: <a href="ESA_002f390_002dDependent.html#ESA_002f390_002dDependent" accesskey="u" rel="up">ESA/390-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="ESA_002f390-Assembler-Directives"></a>
  64. <h4 class="subsection">9.14.5 ESA/390 Assembler Directives</h4>
  65. <p><code>as</code> for the ESA/390 supports all of the standard ELF/SVR4
  66. assembler directives that are documented in the main part of this
  67. documentation. Several additional directives are supported in order
  68. to implement the ESA/390 addressing model. The most important of these
  69. are <code>.using</code> and <code>.ltorg</code>
  70. </p>
  71. <a name="index-ESA_002f390_002donly-directives"></a>
  72. <p>These are the additional directives in <code>as</code> for the ESA/390:
  73. </p>
  74. <dl compact="compact">
  75. <dt><code>.dc</code></dt>
  76. <dd><p>A small subset of the usual DC directive is supported.
  77. </p>
  78. </dd>
  79. <dt><code>.drop <var>regno</var></code></dt>
  80. <dd><p>Stop using <var>regno</var> as the base register. The <var>regno</var> must
  81. have been previously declared with a <code>.using</code> directive in the
  82. same section as the current section.
  83. </p>
  84. </dd>
  85. <dt><code>.ebcdic <var>string</var></code></dt>
  86. <dd><p>Emit the EBCDIC equivalent of the indicated string. The emitted string
  87. will be null terminated. Note that the directives <code>.string</code> etc. emit
  88. ascii strings by default.
  89. </p>
  90. </dd>
  91. <dt><code>EQU</code></dt>
  92. <dd><p>The standard HLASM-style EQU directive is not supported; however, the
  93. standard <code>as</code> directive .equ can be used to the same effect.
  94. </p>
  95. </dd>
  96. <dt><code>.ltorg</code></dt>
  97. <dd><p>Dump the literal pool accumulated so far; begin a new literal pool.
  98. The literal pool will be written in the current section; in order to
  99. generate correct assembly, a <code>.using</code> must have been previously
  100. specified in the same section.
  101. </p>
  102. </dd>
  103. <dt><code>.using <var>expr</var>,<var>regno</var></code></dt>
  104. <dd><p>Use <var>regno</var> as the base register for all subsequent RX, RS, and SS form
  105. instructions. The <var>expr</var> will be evaluated to obtain the base address;
  106. usually, <var>expr</var> will merely be &lsquo;<samp>*</samp>&rsquo;.
  107. </p>
  108. <p>This assembler allows two <code>.using</code> directives to be simultaneously
  109. outstanding, one in the <code>.text</code> section, and one in another section
  110. (typically, the <code>.data</code> section). This feature allows
  111. dynamically loaded objects to be implemented in a relatively
  112. straightforward way. A <code>.using</code> directive must always be specified
  113. in the <code>.text</code> section; this will specify the base register that
  114. will be used for branches in the <code>.text</code> section. A second
  115. <code>.using</code> may be specified in another section; this will specify
  116. the base register that is used for non-label address literals.
  117. When a second <code>.using</code> is specified, then the subsequent
  118. <code>.ltorg</code> must be put in the same section; otherwise an error will
  119. result.
  120. </p>
  121. <p>Thus, for example, the following code uses <code>r3</code> to address branch
  122. targets and <code>r4</code> to address the literal pool, which has been written
  123. to the <code>.data</code> section. The is, the constants <code>=A(some_routine)</code>,
  124. <code>=H'42'</code> and <code>=E'3.1416'</code> will all appear in the <code>.data</code>
  125. section.
  126. </p>
  127. <div class="example">
  128. <pre class="example">.data
  129. .using LITPOOL,r4
  130. .text
  131. BASR r3,0
  132. .using *,r3
  133. B START
  134. .long LITPOOL
  135. START:
  136. L r4,4(,r3)
  137. L r15,=A(some_routine)
  138. LTR r15,r15
  139. BNE LABEL
  140. AH r0,=H'42'
  141. LABEL:
  142. ME r6,=E'3.1416'
  143. .data
  144. LITPOOL:
  145. .ltorg
  146. </pre></div>
  147. <p>Note that this dual-<code>.using</code> directive semantics extends
  148. and is not compatible with HLASM semantics. Note that this assembler
  149. directive does not support the full range of HLASM semantics.
  150. </p>
  151. </dd>
  152. </dl>
  153. <hr>
  154. <div class="header">
  155. <p>
  156. Next: <a href="ESA_002f390-Opcodes.html#ESA_002f390-Opcodes" accesskey="n" rel="next">ESA/390 Opcodes</a>, Previous: <a href="ESA_002f390-Floating-Point.html#ESA_002f390-Floating-Point" accesskey="p" rel="prev">ESA/390 Floating Point</a>, Up: <a href="ESA_002f390_002dDependent.html#ESA_002f390_002dDependent" accesskey="u" rel="up">ESA/390-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>
  157. </div>
  158. </body>
  159. </html>