Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

HPPA-Directives.html 16KB

pirms 3 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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>HPPA Directives (Using as)</title>
  16. <meta name="description" content="HPPA Directives (Using as)">
  17. <meta name="keywords" content="HPPA 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="HPPA_002dDependent.html#HPPA_002dDependent" rel="up" title="HPPA-Dependent">
  25. <link href="HPPA-Opcodes.html#HPPA-Opcodes" rel="next" title="HPPA Opcodes">
  26. <link href="HPPA-Floating-Point.html#HPPA-Floating-Point" rel="prev" title="HPPA Floating Point">
  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="HPPA-Directives"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="HPPA-Opcodes.html#HPPA-Opcodes" accesskey="n" rel="next">HPPA Opcodes</a>, Previous: <a href="HPPA-Floating-Point.html#HPPA-Floating-Point" accesskey="p" rel="prev">HPPA Floating Point</a>, Up: <a href="HPPA_002dDependent.html#HPPA_002dDependent" accesskey="u" rel="up">HPPA-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="HPPA-Assembler-Directives"></a>
  63. <h4 class="subsection">9.15.5 HPPA Assembler Directives</h4>
  64. <p><code>as</code> for the HPPA supports many additional directives for
  65. compatibility with the native assembler. This section describes them only
  66. briefly. For detailed information on HPPA-specific assembler directives, see
  67. <cite>HP9000 Series 800 Assembly Language Reference Manual</cite> (HP 92432-90001).
  68. </p>
  69. <a name="index-HPPA-directives-not-supported"></a>
  70. <p><code>as</code> does <em>not</em> support the following assembler directives
  71. described in the HP manual:
  72. </p>
  73. <div class="example">
  74. <pre class="example">.endm .liston
  75. .enter .locct
  76. .leave .macro
  77. .listoff
  78. </pre></div>
  79. <a name="index-_002eparam-on-HPPA"></a>
  80. <p>Beyond those implemented for compatibility, <code>as</code> supports one
  81. additional assembler directive for the HPPA: <code>.param</code>. It conveys
  82. register argument locations for static functions. Its syntax closely follows
  83. the <code>.export</code> directive.
  84. </p>
  85. <a name="index-HPPA_002donly-directives"></a>
  86. <p>These are the additional directives in <code>as</code> for the HPPA:
  87. </p>
  88. <dl compact="compact">
  89. <dt><code>.block <var>n</var></code></dt>
  90. <dt><code>.blockz <var>n</var></code></dt>
  91. <dd><p>Reserve <var>n</var> bytes of storage, and initialize them to zero.
  92. </p>
  93. </dd>
  94. <dt><code>.call</code></dt>
  95. <dd><p>Mark the beginning of a procedure call. Only the special case with <em>no
  96. arguments</em> is allowed.
  97. </p>
  98. </dd>
  99. <dt><code>.callinfo [ <var>param</var>=<var>value</var>, &hellip; ] [ <var>flag</var>, &hellip; ]</code></dt>
  100. <dd><p>Specify a number of parameters and flags that define the environment for a
  101. procedure.
  102. </p>
  103. <p><var>param</var> may be any of &lsquo;<samp>frame</samp>&rsquo; (frame size), &lsquo;<samp>entry_gr</samp>&rsquo; (end of
  104. general register range), &lsquo;<samp>entry_fr</samp>&rsquo; (end of float register range),
  105. &lsquo;<samp>entry_sr</samp>&rsquo; (end of space register range).
  106. </p>
  107. <p>The values for <var>flag</var> are &lsquo;<samp>calls</samp>&rsquo; or &lsquo;<samp>caller</samp>&rsquo; (proc has
  108. subroutines), &lsquo;<samp>no_calls</samp>&rsquo; (proc does not call subroutines), &lsquo;<samp>save_rp</samp>&rsquo;
  109. (preserve return pointer), &lsquo;<samp>save_sp</samp>&rsquo; (proc preserves stack pointer),
  110. &lsquo;<samp>no_unwind</samp>&rsquo; (do not unwind this proc), &lsquo;<samp>hpux_int</samp>&rsquo; (proc is interrupt
  111. routine).
  112. </p>
  113. </dd>
  114. <dt><code>.code</code></dt>
  115. <dd><p>Assemble into the standard section called &lsquo;<samp>$TEXT$</samp>&rsquo;, subsection
  116. &lsquo;<samp>$CODE$</samp>&rsquo;.
  117. </p>
  118. </dd>
  119. <dt><code>.copyright &quot;<var>string</var>&quot;</code></dt>
  120. <dd><p>In the SOM object format, insert <var>string</var> into the object code, marked as a
  121. copyright string.
  122. </p>
  123. </dd>
  124. <dt><code>.copyright &quot;<var>string</var>&quot;</code></dt>
  125. <dd><p>In the ELF object format, insert <var>string</var> into the object code, marked as a
  126. version string.
  127. </p>
  128. </dd>
  129. <dt><code>.enter</code></dt>
  130. <dd><p>Not yet supported; the assembler rejects programs containing this directive.
  131. </p>
  132. </dd>
  133. <dt><code>.entry</code></dt>
  134. <dd><p>Mark the beginning of a procedure.
  135. </p>
  136. </dd>
  137. <dt><code>.exit</code></dt>
  138. <dd><p>Mark the end of a procedure.
  139. </p>
  140. </dd>
  141. <dt><code>.export <var>name</var> [ ,<var>typ</var> ] [ ,<var>param</var>=<var>r</var> ]</code></dt>
  142. <dd><p>Make a procedure <var>name</var> available to callers. <var>typ</var>, if present, must
  143. be one of &lsquo;<samp>absolute</samp>&rsquo;, &lsquo;<samp>code</samp>&rsquo; (ELF only, not SOM), &lsquo;<samp>data</samp>&rsquo;,
  144. &lsquo;<samp>entry</samp>&rsquo;, &lsquo;<samp>data</samp>&rsquo;, &lsquo;<samp>entry</samp>&rsquo;, &lsquo;<samp>millicode</samp>&rsquo;, &lsquo;<samp>plabel</samp>&rsquo;,
  145. &lsquo;<samp>pri_prog</samp>&rsquo;, or &lsquo;<samp>sec_prog</samp>&rsquo;.
  146. </p>
  147. <p><var>param</var>, if present, provides either relocation information for the
  148. procedure arguments and result, or a privilege level. <var>param</var> may be
  149. &lsquo;<samp>argw<var>n</var></samp>&rsquo; (where <var>n</var> ranges from <code>0</code> to <code>3</code>, and
  150. indicates one of four one-word arguments); &lsquo;<samp>rtnval</samp>&rsquo; (the procedure&rsquo;s
  151. result); or &lsquo;<samp>priv_lev</samp>&rsquo; (privilege level). For arguments or the result,
  152. <var>r</var> specifies how to relocate, and must be one of &lsquo;<samp>no</samp>&rsquo; (not
  153. relocatable), &lsquo;<samp>gr</samp>&rsquo; (argument is in general register), &lsquo;<samp>fr</samp>&rsquo; (in
  154. floating point register), or &lsquo;<samp>fu</samp>&rsquo; (upper half of float register).
  155. For &lsquo;<samp>priv_lev</samp>&rsquo;, <var>r</var> is an integer.
  156. </p>
  157. </dd>
  158. <dt><code>.half <var>n</var></code></dt>
  159. <dd><p>Define a two-byte integer constant <var>n</var>; synonym for the portable
  160. <code>as</code> directive <code>.short</code>.
  161. </p>
  162. </dd>
  163. <dt><code>.import <var>name</var> [ ,<var>typ</var> ]</code></dt>
  164. <dd><p>Converse of <code>.export</code>; make a procedure available to call. The arguments
  165. use the same conventions as the first two arguments for <code>.export</code>.
  166. </p>
  167. </dd>
  168. <dt><code>.label <var>name</var></code></dt>
  169. <dd><p>Define <var>name</var> as a label for the current assembly location.
  170. </p>
  171. </dd>
  172. <dt><code>.leave</code></dt>
  173. <dd><p>Not yet supported; the assembler rejects programs containing this directive.
  174. </p>
  175. </dd>
  176. <dt><code>.origin <var>lc</var></code></dt>
  177. <dd><p>Advance location counter to <var>lc</var>. Synonym for the <code>as</code>
  178. portable directive <code>.org</code>.
  179. </p>
  180. </dd>
  181. <dt><code>.param <var>name</var> [ ,<var>typ</var> ] [ ,<var>param</var>=<var>r</var> ]</code></dt>
  182. <dd><p>Similar to <code>.export</code>, but used for static procedures.
  183. </p>
  184. </dd>
  185. <dt><code>.proc</code></dt>
  186. <dd><p>Use preceding the first statement of a procedure.
  187. </p>
  188. </dd>
  189. <dt><code>.procend</code></dt>
  190. <dd><p>Use following the last statement of a procedure.
  191. </p>
  192. </dd>
  193. <dt><code><var>label</var> .reg <var>expr</var></code></dt>
  194. <dd><p>Synonym for <code>.equ</code>; define <var>label</var> with the absolute expression
  195. <var>expr</var> as its value.
  196. </p>
  197. </dd>
  198. <dt><code>.space <var>secname</var> [ ,<var>params</var> ]</code></dt>
  199. <dd><p>Switch to section <var>secname</var>, creating a new section by that name if
  200. necessary. You may only use <var>params</var> when creating a new section, not
  201. when switching to an existing one. <var>secname</var> may identify a section by
  202. number rather than by name.
  203. </p>
  204. <p>If specified, the list <var>params</var> declares attributes of the section,
  205. identified by keywords. The keywords recognized are &lsquo;<samp>spnum=<var>exp</var></samp>&rsquo;
  206. (identify this section by the number <var>exp</var>, an absolute expression),
  207. &lsquo;<samp>sort=<var>exp</var></samp>&rsquo; (order sections according to this sort key when linking;
  208. <var>exp</var> is an absolute expression), &lsquo;<samp>unloadable</samp>&rsquo; (section contains no
  209. loadable data), &lsquo;<samp>notdefined</samp>&rsquo; (this section defined elsewhere), and
  210. &lsquo;<samp>private</samp>&rsquo; (data in this section not available to other programs).
  211. </p>
  212. </dd>
  213. <dt><code>.spnum <var>secnam</var></code></dt>
  214. <dd><p>Allocate four bytes of storage, and initialize them with the section number of
  215. the section named <var>secnam</var>. (You can define the section number with the
  216. HPPA <code>.space</code> directive.)
  217. </p>
  218. <a name="index-string-directive-on-HPPA"></a>
  219. </dd>
  220. <dt><code>.string &quot;<var>str</var>&quot;</code></dt>
  221. <dd><p>Copy the characters in the string <var>str</var> to the object file.
  222. See <a href="Strings.html#Strings">Strings</a>, for information on escape sequences you can use in
  223. <code>as</code> strings.
  224. </p>
  225. <p><em>Warning!</em> The HPPA version of <code>.string</code> differs from the
  226. usual <code>as</code> definition: it does <em>not</em> write a zero byte
  227. after copying <var>str</var>.
  228. </p>
  229. </dd>
  230. <dt><code>.stringz &quot;<var>str</var>&quot;</code></dt>
  231. <dd><p>Like <code>.string</code>, but appends a zero byte after copying <var>str</var> to object
  232. file.
  233. </p>
  234. </dd>
  235. <dt><code>.subspa <var>name</var> [ ,<var>params</var> ]</code></dt>
  236. <dt><code>.nsubspa <var>name</var> [ ,<var>params</var> ]</code></dt>
  237. <dd><p>Similar to <code>.space</code>, but selects a subsection <var>name</var> within the
  238. current section. You may only specify <var>params</var> when you create a
  239. subsection (in the first instance of <code>.subspa</code> for this <var>name</var>).
  240. </p>
  241. <p>If specified, the list <var>params</var> declares attributes of the subsection,
  242. identified by keywords. The keywords recognized are &lsquo;<samp>quad=<var>expr</var></samp>&rsquo;
  243. (&ldquo;quadrant&rdquo; for this subsection), &lsquo;<samp>align=<var>expr</var></samp>&rsquo; (alignment for
  244. beginning of this subsection; a power of two), &lsquo;<samp>access=<var>expr</var></samp>&rsquo; (value
  245. for &ldquo;access rights&rdquo; field), &lsquo;<samp>sort=<var>expr</var></samp>&rsquo; (sorting order for this
  246. subspace in link), &lsquo;<samp>code_only</samp>&rsquo; (subsection contains only code),
  247. &lsquo;<samp>unloadable</samp>&rsquo; (subsection cannot be loaded into memory), &lsquo;<samp>comdat</samp>&rsquo;
  248. (subsection is comdat), &lsquo;<samp>common</samp>&rsquo; (subsection is common block),
  249. &lsquo;<samp>dup_comm</samp>&rsquo; (subsection may have duplicate names), or &lsquo;<samp>zero</samp>&rsquo;
  250. (subsection is all zeros, do not write in object file).
  251. </p>
  252. <p><code>.nsubspa</code> always creates a new subspace with the given name, even
  253. if one with the same name already exists.
  254. </p>
  255. <p>&lsquo;<samp>comdat</samp>&rsquo;, &lsquo;<samp>common</samp>&rsquo; and &lsquo;<samp>dup_comm</samp>&rsquo; can be used to implement
  256. various flavors of one-only support when using the SOM linker. The SOM
  257. linker only supports specific combinations of these flags. The details
  258. are not documented. A brief description is provided here.
  259. </p>
  260. <p>&lsquo;<samp>comdat</samp>&rsquo; provides a form of linkonce support. It is useful for
  261. both code and data subspaces. A &lsquo;<samp>comdat</samp>&rsquo; subspace has a key symbol
  262. marked by the &lsquo;<samp>is_comdat</samp>&rsquo; flag or &lsquo;<samp>ST_COMDAT</samp>&rsquo;. Only the first
  263. subspace for any given key is selected. The key symbol becomes universal
  264. in shared links. This is similar to the behavior of &lsquo;<samp>secondary_def</samp>&rsquo;
  265. symbols.
  266. </p>
  267. <p>&lsquo;<samp>common</samp>&rsquo; provides Fortran named common support. It is only useful
  268. for data subspaces. Symbols with the flag &lsquo;<samp>is_common</samp>&rsquo; retain this
  269. flag in shared links. Referencing a &lsquo;<samp>is_common</samp>&rsquo; symbol in a shared
  270. library from outside the library doesn&rsquo;t work. Thus, &lsquo;<samp>is_common</samp>&rsquo;
  271. symbols must be output whenever they are needed.
  272. </p>
  273. <p>&lsquo;<samp>common</samp>&rsquo; and &lsquo;<samp>dup_comm</samp>&rsquo; together provide Cobol common support.
  274. The subspaces in this case must all be the same length. Otherwise, this
  275. support is similar to the Fortran common support.
  276. </p>
  277. <p>&lsquo;<samp>dup_comm</samp>&rsquo; by itself provides a type of one-only support for code.
  278. Only the first &lsquo;<samp>dup_comm</samp>&rsquo; subspace is selected. There is a rather
  279. complex algorithm to compare subspaces. Code symbols marked with the
  280. &lsquo;<samp>dup_common</samp>&rsquo; flag are hidden. This support was intended for &quot;C++
  281. duplicate inlines&quot;.
  282. </p>
  283. <p>A simplified technique is used to mark the flags of symbols based on
  284. the flags of their subspace. A symbol with the scope SS_UNIVERSAL and
  285. type ST_ENTRY, ST_CODE or ST_DATA is marked with the corresponding
  286. settings of &lsquo;<samp>comdat</samp>&rsquo;, &lsquo;<samp>common</samp>&rsquo; and &lsquo;<samp>dup_comm</samp>&rsquo; from the
  287. subspace, respectively. This avoids having to introduce additional
  288. directives to mark these symbols. The HP assembler sets &lsquo;<samp>is_common</samp>&rsquo;
  289. from &lsquo;<samp>common</samp>&rsquo;. However, it doesn&rsquo;t set the &lsquo;<samp>dup_common</samp>&rsquo; from
  290. &lsquo;<samp>dup_comm</samp>&rsquo;. It doesn&rsquo;t have &lsquo;<samp>comdat</samp>&rsquo; support.
  291. </p>
  292. </dd>
  293. <dt><code>.version &quot;<var>str</var>&quot;</code></dt>
  294. <dd><p>Write <var>str</var> as version identifier in object code.
  295. </p></dd>
  296. </dl>
  297. <hr>
  298. <div class="header">
  299. <p>
  300. Next: <a href="HPPA-Opcodes.html#HPPA-Opcodes" accesskey="n" rel="next">HPPA Opcodes</a>, Previous: <a href="HPPA-Floating-Point.html#HPPA-Floating-Point" accesskey="p" rel="prev">HPPA Floating Point</a>, Up: <a href="HPPA_002dDependent.html#HPPA_002dDependent" accesskey="u" rel="up">HPPA-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>
  301. </div>
  302. </body>
  303. </html>