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 5Copyright (C) 1991-2021 Free Software Foundation, Inc. 6 7Permission is granted to copy, distribute and/or modify this document 8under the terms of the GNU Free Documentation License, Version 1.3 9or any later version published by the Free Software Foundation; 10with no Invariant Sections, with no Front-Cover Texts, and with no 11Back-Cover Texts. A copy of the license is included in the 12section entitled "GNU Free Documentation License". 13 --> 14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 15<head> 16<title>Using as: HPPA Directives</title> 17 18<meta name="description" content="Using as: HPPA Directives"> 19<meta name="keywords" content="Using as: HPPA Directives"> 20<meta name="resource-type" content="document"> 21<meta name="distribution" content="global"> 22<meta name="Generator" content="makeinfo"> 23<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 24<link href="index.html#Top" rel="start" title="Top"> 25<link href="AS-Index.html#AS-Index" rel="index" title="AS Index"> 26<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 27<link href="HPPA_002dDependent.html#HPPA_002dDependent" rel="up" title="HPPA-Dependent"> 28<link href="HPPA-Opcodes.html#HPPA-Opcodes" rel="next" title="HPPA Opcodes"> 29<link href="HPPA-Floating-Point.html#HPPA-Floating-Point" rel="previous" title="HPPA Floating Point"> 30<style type="text/css"> 31<!-- 32a.summary-letter {text-decoration: none} 33blockquote.smallquotation {font-size: smaller} 34div.display {margin-left: 3.2em} 35div.example {margin-left: 3.2em} 36div.indentedblock {margin-left: 3.2em} 37div.lisp {margin-left: 3.2em} 38div.smalldisplay {margin-left: 3.2em} 39div.smallexample {margin-left: 3.2em} 40div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 41div.smalllisp {margin-left: 3.2em} 42kbd {font-style:oblique} 43pre.display {font-family: inherit} 44pre.format {font-family: inherit} 45pre.menu-comment {font-family: serif} 46pre.menu-preformatted {font-family: serif} 47pre.smalldisplay {font-family: inherit; font-size: smaller} 48pre.smallexample {font-size: smaller} 49pre.smallformat {font-family: inherit; font-size: smaller} 50pre.smalllisp {font-size: smaller} 51span.nocodebreak {white-space:nowrap} 52span.nolinebreak {white-space:nowrap} 53span.roman {font-family:serif; font-weight:normal} 54span.sansserif {font-family:sans-serif; font-weight:normal} 55ul.no-bullet {list-style: none} 56--> 57</style> 58 59 60</head> 61 62<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 63<a name="HPPA-Directives"></a> 64<div class="header"> 65<p> 66Next: <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="previous">HPPA Floating Point</a>, Up: <a href="HPPA_002dDependent.html#HPPA_002dDependent" accesskey="u" rel="up">HPPA-Dependent</a> [<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> 67</div> 68<hr> 69<a name="HPPA-Assembler-Directives"></a> 70<h4 class="subsection">9.15.5 HPPA Assembler Directives</h4> 71 72<p><code>as</code> for the HPPA supports many additional directives for 73compatibility with the native assembler. This section describes them only 74briefly. For detailed information on HPPA-specific assembler directives, see 75<cite>HP9000 Series 800 Assembly Language Reference Manual</cite> (HP 92432-90001). 76</p> 77<a name="index-HPPA-directives-not-supported"></a> 78<p><code>as</code> does <em>not</em> support the following assembler directives 79described in the HP manual: 80</p> 81<div class="example"> 82<pre class="example">.endm .liston 83.enter .locct 84.leave .macro 85.listoff 86</pre></div> 87 88<a name="index-_002eparam-on-HPPA"></a> 89<p>Beyond those implemented for compatibility, <code>as</code> supports one 90additional assembler directive for the HPPA: <code>.param</code>. It conveys 91register argument locations for static functions. Its syntax closely follows 92the <code>.export</code> directive. 93</p> 94<a name="index-HPPA_002donly-directives"></a> 95<p>These are the additional directives in <code>as</code> for the HPPA: 96</p> 97<dl compact="compact"> 98<dt><code>.block <var>n</var></code></dt> 99<dt><code>.blockz <var>n</var></code></dt> 100<dd><p>Reserve <var>n</var> bytes of storage, and initialize them to zero. 101</p> 102</dd> 103<dt><code>.call</code></dt> 104<dd><p>Mark the beginning of a procedure call. Only the special case with <em>no 105arguments</em> is allowed. 106</p> 107</dd> 108<dt><code>.callinfo [ <var>param</var>=<var>value</var>, … ] [ <var>flag</var>, … ]</code></dt> 109<dd><p>Specify a number of parameters and flags that define the environment for a 110procedure. 111</p> 112<p><var>param</var> may be any of ‘<samp>frame</samp>’ (frame size), ‘<samp>entry_gr</samp>’ (end of 113general register range), ‘<samp>entry_fr</samp>’ (end of float register range), 114‘<samp>entry_sr</samp>’ (end of space register range). 115</p> 116<p>The values for <var>flag</var> are ‘<samp>calls</samp>’ or ‘<samp>caller</samp>’ (proc has 117subroutines), ‘<samp>no_calls</samp>’ (proc does not call subroutines), ‘<samp>save_rp</samp>’ 118(preserve return pointer), ‘<samp>save_sp</samp>’ (proc preserves stack pointer), 119‘<samp>no_unwind</samp>’ (do not unwind this proc), ‘<samp>hpux_int</samp>’ (proc is interrupt 120routine). 121</p> 122</dd> 123<dt><code>.code</code></dt> 124<dd><p>Assemble into the standard section called ‘<samp>$TEXT$</samp>’, subsection 125‘<samp>$CODE$</samp>’. 126</p> 127</dd> 128<dt><code>.copyright "<var>string</var>"</code></dt> 129<dd><p>In the SOM object format, insert <var>string</var> into the object code, marked as a 130copyright string. 131</p> 132</dd> 133<dt><code>.copyright "<var>string</var>"</code></dt> 134<dd><p>In the ELF object format, insert <var>string</var> into the object code, marked as a 135version string. 136</p> 137</dd> 138<dt><code>.enter</code></dt> 139<dd><p>Not yet supported; the assembler rejects programs containing this directive. 140</p> 141</dd> 142<dt><code>.entry</code></dt> 143<dd><p>Mark the beginning of a procedure. 144</p> 145</dd> 146<dt><code>.exit</code></dt> 147<dd><p>Mark the end of a procedure. 148</p> 149</dd> 150<dt><code>.export <var>name</var> [ ,<var>typ</var> ] [ ,<var>param</var>=<var>r</var> ]</code></dt> 151<dd><p>Make a procedure <var>name</var> available to callers. <var>typ</var>, if present, must 152be one of ‘<samp>absolute</samp>’, ‘<samp>code</samp>’ (ELF only, not SOM), ‘<samp>data</samp>’, 153‘<samp>entry</samp>’, ‘<samp>data</samp>’, ‘<samp>entry</samp>’, ‘<samp>millicode</samp>’, ‘<samp>plabel</samp>’, 154‘<samp>pri_prog</samp>’, or ‘<samp>sec_prog</samp>’. 155</p> 156<p><var>param</var>, if present, provides either relocation information for the 157procedure arguments and result, or a privilege level. <var>param</var> may be 158‘<samp>argw<var>n</var></samp>’ (where <var>n</var> ranges from <code>0</code> to <code>3</code>, and 159indicates one of four one-word arguments); ‘<samp>rtnval</samp>’ (the procedure’s 160result); or ‘<samp>priv_lev</samp>’ (privilege level). For arguments or the result, 161<var>r</var> specifies how to relocate, and must be one of ‘<samp>no</samp>’ (not 162relocatable), ‘<samp>gr</samp>’ (argument is in general register), ‘<samp>fr</samp>’ (in 163floating point register), or ‘<samp>fu</samp>’ (upper half of float register). 164For ‘<samp>priv_lev</samp>’, <var>r</var> is an integer. 165</p> 166</dd> 167<dt><code>.half <var>n</var></code></dt> 168<dd><p>Define a two-byte integer constant <var>n</var>; synonym for the portable 169<code>as</code> directive <code>.short</code>. 170</p> 171</dd> 172<dt><code>.import <var>name</var> [ ,<var>typ</var> ]</code></dt> 173<dd><p>Converse of <code>.export</code>; make a procedure available to call. The arguments 174use the same conventions as the first two arguments for <code>.export</code>. 175</p> 176</dd> 177<dt><code>.label <var>name</var></code></dt> 178<dd><p>Define <var>name</var> as a label for the current assembly location. 179</p> 180</dd> 181<dt><code>.leave</code></dt> 182<dd><p>Not yet supported; the assembler rejects programs containing this directive. 183</p> 184</dd> 185<dt><code>.origin <var>lc</var></code></dt> 186<dd><p>Advance location counter to <var>lc</var>. Synonym for the <code>as</code> 187portable directive <code>.org</code>. 188</p> 189</dd> 190<dt><code>.param <var>name</var> [ ,<var>typ</var> ] [ ,<var>param</var>=<var>r</var> ]</code></dt> 191<dd><p>Similar to <code>.export</code>, but used for static procedures. 192</p> 193</dd> 194<dt><code>.proc</code></dt> 195<dd><p>Use preceding the first statement of a procedure. 196</p> 197</dd> 198<dt><code>.procend</code></dt> 199<dd><p>Use following the last statement of a procedure. 200</p> 201</dd> 202<dt><code><var>label</var> .reg <var>expr</var></code></dt> 203<dd><p>Synonym for <code>.equ</code>; define <var>label</var> with the absolute expression 204<var>expr</var> as its value. 205</p> 206</dd> 207<dt><code>.space <var>secname</var> [ ,<var>params</var> ]</code></dt> 208<dd><p>Switch to section <var>secname</var>, creating a new section by that name if 209necessary. You may only use <var>params</var> when creating a new section, not 210when switching to an existing one. <var>secname</var> may identify a section by 211number rather than by name. 212</p> 213<p>If specified, the list <var>params</var> declares attributes of the section, 214identified by keywords. The keywords recognized are ‘<samp>spnum=<var>exp</var></samp>’ 215(identify this section by the number <var>exp</var>, an absolute expression), 216‘<samp>sort=<var>exp</var></samp>’ (order sections according to this sort key when linking; 217<var>exp</var> is an absolute expression), ‘<samp>unloadable</samp>’ (section contains no 218loadable data), ‘<samp>notdefined</samp>’ (this section defined elsewhere), and 219‘<samp>private</samp>’ (data in this section not available to other programs). 220</p> 221</dd> 222<dt><code>.spnum <var>secnam</var></code></dt> 223<dd><p>Allocate four bytes of storage, and initialize them with the section number of 224the section named <var>secnam</var>. (You can define the section number with the 225HPPA <code>.space</code> directive.) 226</p> 227<a name="index-string-directive-on-HPPA"></a> 228</dd> 229<dt><code>.string "<var>str</var>"</code></dt> 230<dd><p>Copy the characters in the string <var>str</var> to the object file. 231See <a href="Strings.html#Strings">Strings</a>, for information on escape sequences you can use in 232<code>as</code> strings. 233</p> 234<p><em>Warning!</em> The HPPA version of <code>.string</code> differs from the 235usual <code>as</code> definition: it does <em>not</em> write a zero byte 236after copying <var>str</var>. 237</p> 238</dd> 239<dt><code>.stringz "<var>str</var>"</code></dt> 240<dd><p>Like <code>.string</code>, but appends a zero byte after copying <var>str</var> to object 241file. 242</p> 243</dd> 244<dt><code>.subspa <var>name</var> [ ,<var>params</var> ]</code></dt> 245<dt><code>.nsubspa <var>name</var> [ ,<var>params</var> ]</code></dt> 246<dd><p>Similar to <code>.space</code>, but selects a subsection <var>name</var> within the 247current section. You may only specify <var>params</var> when you create a 248subsection (in the first instance of <code>.subspa</code> for this <var>name</var>). 249</p> 250<p>If specified, the list <var>params</var> declares attributes of the subsection, 251identified by keywords. The keywords recognized are ‘<samp>quad=<var>expr</var></samp>’ 252(“quadrant” for this subsection), ‘<samp>align=<var>expr</var></samp>’ (alignment for 253beginning of this subsection; a power of two), ‘<samp>access=<var>expr</var></samp>’ (value 254for “access rights” field), ‘<samp>sort=<var>expr</var></samp>’ (sorting order for this 255subspace in link), ‘<samp>code_only</samp>’ (subsection contains only code), 256‘<samp>unloadable</samp>’ (subsection cannot be loaded into memory), ‘<samp>comdat</samp>’ 257(subsection is comdat), ‘<samp>common</samp>’ (subsection is common block), 258‘<samp>dup_comm</samp>’ (subsection may have duplicate names), or ‘<samp>zero</samp>’ 259(subsection is all zeros, do not write in object file). 260</p> 261<p><code>.nsubspa</code> always creates a new subspace with the given name, even 262if one with the same name already exists. 263</p> 264<p>‘<samp>comdat</samp>’, ‘<samp>common</samp>’ and ‘<samp>dup_comm</samp>’ can be used to implement 265various flavors of one-only support when using the SOM linker. The SOM 266linker only supports specific combinations of these flags. The details 267are not documented. A brief description is provided here. 268</p> 269<p>‘<samp>comdat</samp>’ provides a form of linkonce support. It is useful for 270both code and data subspaces. A ‘<samp>comdat</samp>’ subspace has a key symbol 271marked by the ‘<samp>is_comdat</samp>’ flag or ‘<samp>ST_COMDAT</samp>’. Only the first 272subspace for any given key is selected. The key symbol becomes universal 273in shared links. This is similar to the behavior of ‘<samp>secondary_def</samp>’ 274symbols. 275</p> 276<p>‘<samp>common</samp>’ provides Fortran named common support. It is only useful 277for data subspaces. Symbols with the flag ‘<samp>is_common</samp>’ retain this 278flag in shared links. Referencing a ‘<samp>is_common</samp>’ symbol in a shared 279library from outside the library doesn’t work. Thus, ‘<samp>is_common</samp>’ 280symbols must be output whenever they are needed. 281</p> 282<p>‘<samp>common</samp>’ and ‘<samp>dup_comm</samp>’ together provide Cobol common support. 283The subspaces in this case must all be the same length. Otherwise, this 284support is similar to the Fortran common support. 285</p> 286<p>‘<samp>dup_comm</samp>’ by itself provides a type of one-only support for code. 287Only the first ‘<samp>dup_comm</samp>’ subspace is selected. There is a rather 288complex algorithm to compare subspaces. Code symbols marked with the 289‘<samp>dup_common</samp>’ flag are hidden. This support was intended for "C++ 290duplicate inlines". 291</p> 292<p>A simplified technique is used to mark the flags of symbols based on 293the flags of their subspace. A symbol with the scope SS_UNIVERSAL and 294type ST_ENTRY, ST_CODE or ST_DATA is marked with the corresponding 295settings of ‘<samp>comdat</samp>’, ‘<samp>common</samp>’ and ‘<samp>dup_comm</samp>’ from the 296subspace, respectively. This avoids having to introduce additional 297directives to mark these symbols. The HP assembler sets ‘<samp>is_common</samp>’ 298from ‘<samp>common</samp>’. However, it doesn’t set the ‘<samp>dup_common</samp>’ from 299‘<samp>dup_comm</samp>’. It doesn’t have ‘<samp>comdat</samp>’ support. 300</p> 301</dd> 302<dt><code>.version "<var>str</var>"</code></dt> 303<dd><p>Write <var>str</var> as version identifier in object code. 304</p></dd> 305</dl> 306 307<hr> 308<div class="header"> 309<p> 310Next: <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="previous">HPPA Floating Point</a>, Up: <a href="HPPA_002dDependent.html#HPPA_002dDependent" accesskey="u" rel="up">HPPA-Dependent</a> [<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> 311</div> 312 313 314 315</body> 316</html> 317