⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hppa-directives.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>Using as</title>

<meta http-equiv="Content-Type" content="text/html">

<meta name="description" content="Using as">

<meta name="generator" content="makeinfo 4.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

</head>

<body>

<div class="node">

<p>

Node:<a name="HPPA%20Directives">HPPA Directives</a>,

Next:<a rel="next" accesskey="n" href="HPPA-Opcodes.html#HPPA%20Opcodes">HPPA Opcodes</a>,

Previous:<a rel="previous" accesskey="p" href="HPPA-Floating-Point.html#HPPA%20Floating%20Point">HPPA Floating Point</a>,

Up:<a rel="up" accesskey="u" href="HPPA-Dependent.html#HPPA-Dependent">HPPA-Dependent</a>

<hr><br>

</div>



<h4 class="section">HPPA Assembler Directives</h4>



   <p><code>as</code> for the HPPA supports many additional directives for

compatibility with the native assembler.  This section describes them only

briefly.  For detailed information on HPPA-specific assembler directives, see

<cite>HP9000 Series 800 Assembly Language Reference Manual</cite> (HP 92432-90001).



   <p><code>as</code> does <em>not</em> support the following assembler directives

described in the HP manual:



<pre class="example">     .endm           .liston

     .enter          .locct

     .leave          .macro

     .listoff

     </pre>



   <p>Beyond those implemented for compatibility, <code>as</code> supports one

additional assembler directive for the HPPA: <code>.param</code>.  It conveys

register argument locations for static functions.  Its syntax closely follows

the <code>.export</code> directive.



   <p>These are the additional directives in <code>as</code> for the HPPA:



     <dl>

<dt><code>.block </code><var>n</var><code></code>

     <dd><dt><code>.blockz </code><var>n</var><code></code>

     <dd>Reserve <var>n</var> bytes of storage, and initialize them to zero.



     <br><dt><code>.call</code>

     <dd>Mark the beginning of a procedure call.  Only the special case with <em>no

arguments</em> is allowed.



     <br><dt><code>.callinfo [ </code><var>param</var><code>=</code><var>value</var><code>, ... ]  [ </code><var>flag</var><code>, ... ]</code>

     <dd>Specify a number of parameters and flags that define the environment for a

procedure.



     <p><var>param</var> may be any of <code>frame</code> (frame size), <code>entry_gr</code> (end of

general register range), <code>entry_fr</code> (end of float register range),

<code>entry_sr</code> (end of space register range).



     <p>The values for <var>flag</var> are <code>calls</code> or <code>caller</code> (proc has

subroutines), <code>no_calls</code> (proc does not call subroutines), <code>save_rp</code>

(preserve return pointer), <code>save_sp</code> (proc preserves stack pointer),

<code>no_unwind</code> (do not unwind this proc), <code>hpux_int</code> (proc is interrupt

routine).



     <br><dt><code>.code</code>

     <dd>Assemble into the standard section called <code>$TEXT$</code>, subsection

<code>$CODE$</code>.



     <br><dt><code>.copyright "</code><var>string</var><code>"</code>

     <dd>In the SOM object format, insert <var>string</var> into the object code, marked as a

copyright string.



     <br><dt><code>.copyright "</code><var>string</var><code>"</code>

     <dd>In the ELF object format, insert <var>string</var> into the object code, marked as a

version string.



     <br><dt><code>.enter</code>

     <dd>Not yet supported; the assembler rejects programs containing this directive.



     <br><dt><code>.entry</code>

     <dd>Mark the beginning of a procedure.



     <br><dt><code>.exit</code>

     <dd>Mark the end of a procedure.



     <br><dt><code>.export </code><var>name</var><code> [ ,</code><var>typ</var><code> ]  [ ,</code><var>param</var><code>=</code><var>r</var><code> ]</code>

     <dd>Make a procedure <var>name</var> available to callers.  <var>typ</var>, if present, must

be one of <code>absolute</code>, <code>code</code> (ELF only, not SOM), <code>data</code>,

<code>entry</code>, <code>data</code>, <code>entry</code>, <code>millicode</code>, <code>plabel</code>,

<code>pri_prog</code>, or <code>sec_prog</code>.



     <p><var>param</var>, if present, provides either relocation information for the

procedure arguments and result, or a privilege level.  <var>param</var> may be

<code>argw</code><var>n</var><code></code> (where <var>n</var> ranges from <code>0</code> to <code>3</code>, and

indicates one of four one-word arguments); <code>rtnval</code> (the procedure's

result); or <code>priv_lev</code> (privilege level).  For arguments or the result,

<var>r</var> specifies how to relocate, and must be one of <code>no</code> (not

relocatable), <code>gr</code> (argument is in general register), <code>fr</code> (in

floating point register), or <code>fu</code> (upper half of float register). 

For <code>priv_lev</code>, <var>r</var> is an integer.



     <br><dt><code>.half </code><var>n</var><code></code>

     <dd>Define a two-byte integer constant <var>n</var>; synonym for the portable

<code>as</code> directive <code>.short</code>.



     <br><dt><code>.import </code><var>name</var><code> [ ,</code><var>typ</var><code> ]</code>

     <dd>Converse of <code>.export</code>; make a procedure available to call.  The arguments

use the same conventions as the first two arguments for <code>.export</code>.



     <br><dt><code>.label </code><var>name</var><code></code>

     <dd>Define <var>name</var> as a label for the current assembly location.



     <br><dt><code>.leave</code>

     <dd>Not yet supported; the assembler rejects programs containing this directive.



     <br><dt><code>.origin </code><var>lc</var><code></code>

     <dd>Advance location counter to <var>lc</var>. Synonym for the <code>{No value for `as'}</code>

portable directive <code>.org</code>.



     <br><dt><code>.param </code><var>name</var><code> [ ,</code><var>typ</var><code> ]  [ ,</code><var>param</var><code>=</code><var>r</var><code> ]</code>

     <dd>Similar to <code>.export</code>, but used for static procedures.



     <br><dt><code>.proc</code>

     <dd>Use preceding the first statement of a procedure.



     <br><dt><code>.procend</code>

     <dd>Use following the last statement of a procedure.



     <br><dt><code></code><var>label</var><code> .reg </code><var>expr</var><code></code>

     <dd>Synonym for <code>.equ</code>; define <var>label</var> with the absolute expression

<var>expr</var> as its value.



     <br><dt><code>.space </code><var>secname</var><code> [ ,</code><var>params</var><code> ]</code>

     <dd>Switch to section <var>secname</var>, creating a new section by that name if

necessary.  You may only use <var>params</var> when creating a new section, not

when switching to an existing one.  <var>secname</var> may identify a section by

number rather than by name.



     <p>If specified, the list <var>params</var> declares attributes of the section,

identified by keywords.  The keywords recognized are <code>spnum=</code><var>exp</var><code></code>

(identify this section by the number <var>exp</var>, an absolute expression),

<code>sort=</code><var>exp</var><code></code> (order sections according to this sort key when linking;

<var>exp</var> is an absolute expression), <code>unloadable</code> (section contains no

loadable data), <code>notdefined</code> (this section defined elsewhere), and

<code>private</code> (data in this section not available to other programs).



     <br><dt><code>.spnum </code><var>secnam</var><code></code>

     <dd>Allocate four bytes of storage, and initialize them with the section number of

the section named <var>secnam</var>.  (You can define the section number with the

HPPA <code>.space</code> directive.)



     <br><dt><code>.string "</code><var>str</var><code>"</code>

     <dd>Copy the characters in the string <var>str</var> to the object file. 

See <a href="Strings.html#Strings">Strings</a>, for information on escape sequences you can use in

<code>as</code> strings.



     <p><em>Warning!</em> The HPPA version of <code>.string</code> differs from the

usual <code>as</code> definition: it does <em>not</em> write a zero byte

after copying <var>str</var>.



     <br><dt><code>.stringz "</code><var>str</var><code>"</code>

     <dd>Like <code>.string</code>, but appends a zero byte after copying <var>str</var> to object

file.



     <br><dt><code>.subspa </code><var>name</var><code> [ ,</code><var>params</var><code> ]</code>

     <dd><dt><code>.nsubspa </code><var>name</var><code> [ ,</code><var>params</var><code> ]</code>

     <dd>Similar to <code>.space</code>, but selects a subsection <var>name</var> within the

current section.  You may only specify <var>params</var> when you create a

subsection (in the first instance of <code>.subspa</code> for this <var>name</var>).



     <p>If specified, the list <var>params</var> declares attributes of the subsection,

identified by keywords.  The keywords recognized are <code>quad=</code><var>expr</var><code></code>

("quadrant" for this subsection), <code>align=</code><var>expr</var><code></code> (alignment for

beginning of this subsection; a power of two), <code>access=</code><var>expr</var><code></code> (value

for "access rights" field), <code>sort=</code><var>expr</var><code></code> (sorting order for this

subspace in link), <code>code_only</code> (subsection contains only code),

<code>unloadable</code> (subsection cannot be loaded into memory), <code>common</code>

(subsection is common block), <code>dup_comm</code> (initialized data may have

duplicate names), or <code>zero</code> (subsection is all zeros, do not write in

object file).



     <p><code>.nsubspa</code> always creates a new subspace with the given name, even

if one with the same name already exists.



     <br><dt><code>.version "</code><var>str</var><code>"</code>

     <dd>Write <var>str</var> as version identifier in object code. 

</dl>



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -