You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

s390-Directives.html 9.9KB

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>s390 Directives (Using as)</title>
  16. <meta name="description" content="s390 Directives (Using as)">
  17. <meta name="keywords" content="s390 Directives (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  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="S_002f390_002dDependent.html#S_002f390_002dDependent" rel="up" title="S/390-Dependent">
  25. <link href="s390-Floating-Point.html#s390-Floating-Point" rel="next" title="s390 Floating Point">
  26. <link href="s390-Literal-Pool-Entries.html#s390-Literal-Pool-Entries" rel="prev" title="s390 Literal Pool Entries">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="s390-Directives"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="s390-Floating-Point.html#s390-Floating-Point" accesskey="n" rel="next">s390 Floating Point</a>, Previous: <a href="s390-Syntax.html#s390-Syntax" accesskey="p" rel="prev">s390 Syntax</a>, Up: <a href="S_002f390_002dDependent.html#S_002f390_002dDependent" accesskey="u" rel="up">S/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>
  60. </div>
  61. <hr>
  62. <a name="Assembler-Directives-7"></a>
  63. <h4 class="subsection">9.41.4 Assembler Directives</h4>
  64. <p><code>as</code> for s390 supports all of the standard ELF
  65. assembler directives as outlined in the main part of this document.
  66. Some directives have been extended and there are some additional
  67. directives, which are only available for the s390 <code>as</code>.
  68. </p>
  69. <dl compact="compact">
  70. <dd><a name="index-_002einsn-directive_002c-s390"></a>
  71. </dd>
  72. <dt><code>.insn</code></dt>
  73. <dd><p>This directive permits the numeric representation of an instructions
  74. and makes the assembler insert the operands according to one of the
  75. instructions formats for &lsquo;<samp>.insn</samp>&rsquo; (<a href="s390-Formats.html#s390-Formats">s390 Formats</a>).
  76. For example, the instruction &lsquo;<samp>l %r1,24(%r15)</samp>&rsquo; could be written as
  77. &lsquo;<samp>.insn rx,0x58000000,%r1,24(%r15)</samp>&rsquo;.
  78. <a name="index-_002eshort-directive_002c-s390"></a>
  79. <a name="index-_002elong-directive_002c-s390"></a>
  80. <a name="index-_002equad-directive_002c-s390"></a>
  81. </p></dd>
  82. <dt><code>.short</code></dt>
  83. <dt><code>.long</code></dt>
  84. <dt><code>.quad</code></dt>
  85. <dd><p>This directive places one or more 16-bit (.short), 32-bit (.long), or
  86. 64-bit (.quad) values into the current section. If an ELF or TLS modifier
  87. is used only the following expressions are allowed:
  88. &lsquo;<samp>symbol@modifier + constant</samp>&rsquo;,
  89. &lsquo;<samp>symbol@modifier + label + constant</samp>&rsquo;, and
  90. &lsquo;<samp>symbol@modifier - label + constant</samp>&rsquo;.
  91. The following modifiers are available:
  92. </p><dl compact="compact">
  93. <dt><code>@got</code></dt>
  94. <dt><code>@got12</code></dt>
  95. <dd><p>The @got modifier can be used for .short, .long and .quad. The @got12
  96. modifier is synonym to @got. The symbol is added to the GOT. The symbol
  97. term is replaced with offset from the start of the GOT to the GOT slot for
  98. the symbol.
  99. </p></dd>
  100. <dt><code>@gotoff</code></dt>
  101. <dd><p>The @gotoff modifier can be used for .short, .long and .quad. The symbol
  102. term is replaced with the offset from the start of the GOT to the address
  103. of the symbol.
  104. </p></dd>
  105. <dt><code>@gotplt</code></dt>
  106. <dd><p>The @gotplt modifier can be used for .long and .quad. A procedure linkage
  107. table entry is generated for the symbol and a jump slot for the symbol
  108. is added to the GOT. The symbol term is replaced with the offset from the
  109. start of the GOT to the jump slot for the symbol.
  110. </p></dd>
  111. <dt><code>@plt</code></dt>
  112. <dd><p>The @plt modifier can be used for .long and .quad. A procedure linkage
  113. table entry us generated for the symbol. The symbol term is replaced with
  114. the address of the PLT entry for the symbol.
  115. </p></dd>
  116. <dt><code>@pltoff</code></dt>
  117. <dd><p>The @pltoff modifier can be used for .short, .long and .quad. The symbol
  118. term is replaced with the offset from the start of the PLT to the address
  119. of the symbol.
  120. </p></dd>
  121. <dt><code>@tlsgd</code></dt>
  122. <dt><code>@tlsldm</code></dt>
  123. <dd><p>The @tlsgd and @tlsldm modifier can be used for .long and .quad. A
  124. tls_index structure for the symbol is added to the GOT. The symbol term is
  125. replaced with the offset from the start of the GOT to the tls_index structure.
  126. </p></dd>
  127. <dt><code>@gotntpoff</code></dt>
  128. <dt><code>@indntpoff</code></dt>
  129. <dd><p>The @gotntpoff and @indntpoff modifier can be used for .long and .quad.
  130. The symbol is added to the static TLS block and the negated offset to the
  131. symbol in the static TLS block is added to the GOT. For @gotntpoff the
  132. symbol term is replaced with the offset from the start of the GOT to the
  133. GOT slot, for @indntpoff the symbol term is replaced with the address
  134. of the GOT slot.
  135. </p></dd>
  136. <dt><code>@dtpoff</code></dt>
  137. <dd><p>The @dtpoff modifier can be used for .long and .quad. The symbol term
  138. is replaced with the offset of the symbol relative to the start of the
  139. TLS block it is contained in.
  140. </p></dd>
  141. <dt><code>@ntpoff</code></dt>
  142. <dd><p>The @ntpoff modifier can be used for .long and .quad. The symbol term
  143. is replaced with the offset of the symbol relative to the TCB pointer.
  144. </p></dd>
  145. </dl>
  146. <p>For more information about the thread local storage modifiers see the
  147. ELF extension documentation &lsquo;<samp>ELF Handling For Thread-Local Storage</samp>&rsquo;.
  148. </p>
  149. <a name="index-_002eltorg-directive_002c-s390"></a>
  150. </dd>
  151. <dt><code>.ltorg</code></dt>
  152. <dd><p>This directive causes the current contents of the literal pool to be
  153. dumped to the current location (<a href="s390-Literal-Pool-Entries.html#s390-Literal-Pool-Entries">s390 Literal Pool Entries</a>).
  154. </p>
  155. <a name="index-_002emachine-directive_002c-s390"></a>
  156. </dd>
  157. <dt><code>.machine <var>STRING</var>[+<var>EXTENSION</var>]&hellip;</code></dt>
  158. <dd>
  159. <p>This directive allows changing the machine for which code is
  160. generated. <code>string</code> may be any of the <code>-march=</code>
  161. selection options, or <code>push</code>, or <code>pop</code>. <code>.machine
  162. push</code> saves the currently selected cpu, which may be restored with
  163. <code>.machine pop</code>. Be aware that the cpu string has to be put
  164. into double quotes in case it contains characters not appropriate
  165. for identifiers. So you have to write <code>&quot;z9-109&quot;</code> instead of
  166. just <code>z9-109</code>. Extensions can be specified after the cpu
  167. name, separated by plus characters. Valid extensions are:
  168. <code>htm</code>,
  169. <code>nohtm</code>,
  170. <code>vx</code>,
  171. <code>novx</code>.
  172. They extend the basic instruction set with features from a higher
  173. cpu level, or remove support for a feature from the given cpu
  174. level.
  175. </p>
  176. <p>Example: <code>z13+nohtm</code> allows all instructions of the z13 cpu
  177. except instructions from the HTM facility.
  178. </p>
  179. <a name="index-_002emachinemode-directive_002c-s390"></a>
  180. </dd>
  181. <dt><code>.machinemode string</code></dt>
  182. <dd><p>This directive allows to change the architecture mode for which code
  183. is being generated. <code>string</code> may be <code>esa</code>, <code>zarch</code>,
  184. <code>zarch_nohighgprs</code>, <code>push</code>, or <code>pop</code>.
  185. <code>.machinemode zarch_nohighgprs</code> can be used to prevent the
  186. <code>highgprs</code> flag from being set in the ELF header of the output
  187. file. This is useful in situations where the code is gated with a
  188. runtime check which makes sure that the code is only executed on
  189. kernels providing the <code>highgprs</code> feature.
  190. <code>.machinemode push</code> saves the currently selected mode, which may
  191. be restored with <code>.machinemode pop</code>.
  192. </p></dd>
  193. </dl>
  194. <hr>
  195. <div class="header">
  196. <p>
  197. Next: <a href="s390-Floating-Point.html#s390-Floating-Point" accesskey="n" rel="next">s390 Floating Point</a>, Previous: <a href="s390-Syntax.html#s390-Syntax" accesskey="p" rel="prev">s390 Syntax</a>, Up: <a href="S_002f390_002dDependent.html#S_002f390_002dDependent" accesskey="u" rel="up">S/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>
  198. </div>
  199. </body>
  200. </html>