Alpha-Directives.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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: Alpha Directives</title>
  15. <meta name="description" content="Using as: Alpha Directives">
  16. <meta name="keywords" content="Using as: Alpha 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="Alpha_002dDependent.html#Alpha_002dDependent" rel="up" title="Alpha-Dependent">
  25. <link href="Alpha-Opcodes.html#Alpha-Opcodes" rel="next" title="Alpha Opcodes">
  26. <link href="Alpha-Floating-Point.html#Alpha-Floating-Point" rel="prev" title="Alpha 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="Alpha-Directives"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Alpha-Opcodes.html#Alpha-Opcodes" accesskey="n" rel="next">Alpha Opcodes</a>, Previous: <a href="Alpha-Floating-Point.html#Alpha-Floating-Point" accesskey="p" rel="prev">Alpha Floating Point</a>, Up: <a href="Alpha_002dDependent.html#Alpha_002dDependent" accesskey="u" rel="up">Alpha-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="Alpha-Assembler-Directives"></a>
  64. <h4 class="subsection">9.2.5 Alpha Assembler Directives</h4>
  65. <p><code>as</code> for the Alpha supports many additional directives for
  66. compatibility with the native assembler. This section describes them only
  67. briefly.
  68. </p>
  69. <a name="index-Alpha_002donly-directives"></a>
  70. <p>These are the additional directives in <code>as</code> for the Alpha:
  71. </p>
  72. <dl compact="compact">
  73. <dt><code>.arch <var>cpu</var></code></dt>
  74. <dd><p>Specifies the target processor. This is equivalent to the
  75. <samp>-m<var>cpu</var></samp> command-line option. See <a href="Alpha-Options.html#Alpha-Options">Options</a>,
  76. for a list of values for <var>cpu</var>.
  77. </p>
  78. </dd>
  79. <dt><code>.ent <var>function</var>[, <var>n</var>]</code></dt>
  80. <dd><p>Mark the beginning of <var>function</var>. An optional number may follow for
  81. compatibility with the OSF/1 assembler, but is ignored. When generating
  82. <code>.mdebug</code> information, this will create a procedure descriptor for
  83. the function. In ELF, it will mark the symbol as a function a-la the
  84. generic <code>.type</code> directive.
  85. </p>
  86. </dd>
  87. <dt><code>.end <var>function</var></code></dt>
  88. <dd><p>Mark the end of <var>function</var>. In ELF, it will set the size of the symbol
  89. a-la the generic <code>.size</code> directive.
  90. </p>
  91. </dd>
  92. <dt><code>.mask <var>mask</var>, <var>offset</var></code></dt>
  93. <dd><p>Indicate which of the integer registers are saved in the current
  94. function&rsquo;s stack frame. <var>mask</var> is interpreted a bit mask in which
  95. bit <var>n</var> set indicates that register <var>n</var> is saved. The registers
  96. are saved in a block located <var>offset</var> bytes from the <em>canonical
  97. frame address</em> (CFA) which is the value of the stack pointer on entry to
  98. the function. The registers are saved sequentially, except that the
  99. return address register (normally <code>$26</code>) is saved first.
  100. </p>
  101. <p>This and the other directives that describe the stack frame are
  102. currently only used when generating <code>.mdebug</code> information. They
  103. may in the future be used to generate DWARF2 <code>.debug_frame</code> unwind
  104. information for hand written assembly.
  105. </p>
  106. </dd>
  107. <dt><code>.fmask <var>mask</var>, <var>offset</var></code></dt>
  108. <dd><p>Indicate which of the floating-point registers are saved in the current
  109. stack frame. The <var>mask</var> and <var>offset</var> parameters are interpreted
  110. as with <code>.mask</code>.
  111. </p>
  112. </dd>
  113. <dt><code>.frame <var>framereg</var>, <var>frameoffset</var>, <var>retreg</var>[, <var>argoffset</var>]</code></dt>
  114. <dd><p>Describes the shape of the stack frame. The frame pointer in use is
  115. <var>framereg</var>; normally this is either <code>$fp</code> or <code>$sp</code>. The
  116. frame pointer is <var>frameoffset</var> bytes below the CFA. The return
  117. address is initially located in <var>retreg</var> until it is saved as
  118. indicated in <code>.mask</code>. For compatibility with OSF/1 an optional
  119. <var>argoffset</var> parameter is accepted and ignored. It is believed to
  120. indicate the offset from the CFA to the saved argument registers.
  121. </p>
  122. </dd>
  123. <dt><code>.prologue <var>n</var></code></dt>
  124. <dd><p>Indicate that the stack frame is set up and all registers have been
  125. spilled. The argument <var>n</var> indicates whether and how the function
  126. uses the incoming <em>procedure vector</em> (the address of the called
  127. function) in <code>$27</code>. 0 indicates that <code>$27</code> is not used; 1
  128. indicates that the first two instructions of the function use <code>$27</code>
  129. to perform a load of the GP register; 2 indicates that <code>$27</code> is
  130. used in some non-standard way and so the linker cannot elide the load of
  131. the procedure vector during relaxation.
  132. </p>
  133. </dd>
  134. <dt><code>.usepv <var>function</var>, <var>which</var></code></dt>
  135. <dd><p>Used to indicate the use of the <code>$27</code> register, similar to
  136. <code>.prologue</code>, but without the other semantics of needing to
  137. be inside an open <code>.ent</code>/<code>.end</code> block.
  138. </p>
  139. <p>The <var>which</var> argument should be either <code>no</code>, indicating that
  140. <code>$27</code> is not used, or <code>std</code>, indicating that the first two
  141. instructions of the function perform a GP load.
  142. </p>
  143. <p>One might use this directive instead of <code>.prologue</code> if you are
  144. also using dwarf2 CFI directives.
  145. </p>
  146. </dd>
  147. <dt><code>.gprel32 <var>expression</var></code></dt>
  148. <dd><p>Computes the difference between the address in <var>expression</var> and the
  149. GP for the current object file, and stores it in 4 bytes. In addition
  150. to being smaller than a full 8 byte address, this also does not require
  151. a dynamic relocation when used in a shared library.
  152. </p>
  153. </dd>
  154. <dt><code>.t_floating <var>expression</var></code></dt>
  155. <dd><p>Stores <var>expression</var> as an <small>IEEE</small> double precision value.
  156. </p>
  157. </dd>
  158. <dt><code>.s_floating <var>expression</var></code></dt>
  159. <dd><p>Stores <var>expression</var> as an <small>IEEE</small> single precision value.
  160. </p>
  161. </dd>
  162. <dt><code>.f_floating <var>expression</var></code></dt>
  163. <dd><p>Stores <var>expression</var> as a VAX F format value.
  164. </p>
  165. </dd>
  166. <dt><code>.g_floating <var>expression</var></code></dt>
  167. <dd><p>Stores <var>expression</var> as a VAX G format value.
  168. </p>
  169. </dd>
  170. <dt><code>.d_floating <var>expression</var></code></dt>
  171. <dd><p>Stores <var>expression</var> as a VAX D format value.
  172. </p>
  173. </dd>
  174. <dt><code>.set <var>feature</var></code></dt>
  175. <dd><p>Enables or disables various assembler features. Using the positive
  176. name of the feature enables while using &lsquo;<samp>no<var>feature</var></samp>&rsquo; disables.
  177. </p>
  178. <dl compact="compact">
  179. <dt><code>at</code></dt>
  180. <dd><p>Indicates that macro expansions may clobber the <em>assembler
  181. temporary</em> (<code>$at</code> or <code>$28</code>) register. Some macros may not be
  182. expanded without this and will generate an error message if <code>noat</code>
  183. is in effect. When <code>at</code> is in effect, a warning will be generated
  184. if <code>$at</code> is used by the programmer.
  185. </p>
  186. </dd>
  187. <dt><code>macro</code></dt>
  188. <dd><p>Enables the expansion of macro instructions. Note that variants of real
  189. instructions, such as <code>br label</code> vs <code>br $31,label</code> are
  190. considered alternate forms and not macros.
  191. </p>
  192. </dd>
  193. <dt><code>move</code></dt>
  194. <dt><code>reorder</code></dt>
  195. <dt><code>volatile</code></dt>
  196. <dd><p>These control whether and how the assembler may re-order instructions.
  197. Accepted for compatibility with the OSF/1 assembler, but <code>as</code>
  198. does not do instruction scheduling, so these features are ignored.
  199. </p></dd>
  200. </dl>
  201. </dd>
  202. </dl>
  203. <p>The following directives are recognized for compatibility with the OSF/1
  204. assembler but are ignored.
  205. </p>
  206. <div class="example">
  207. <pre class="example">.proc .aproc
  208. .reguse .livereg
  209. .option .aent
  210. .ugen .eflag
  211. .alias .noalias
  212. </pre></div>
  213. <hr>
  214. <div class="header">
  215. <p>
  216. Next: <a href="Alpha-Opcodes.html#Alpha-Opcodes" accesskey="n" rel="next">Alpha Opcodes</a>, Previous: <a href="Alpha-Floating-Point.html#Alpha-Floating-Point" accesskey="p" rel="prev">Alpha Floating Point</a>, Up: <a href="Alpha_002dDependent.html#Alpha_002dDependent" accesskey="u" rel="up">Alpha-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>
  217. </div>
  218. </body>
  219. </html>