Files
oldlinux-files/Ref-docs/manual as/as_7.html
2024-02-19 00:21:47 -05:00

1780 lines
55 KiB
HTML

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from ../texi/as.texinfo on 24 April 1999 -->
<TITLE>Using as - Assembler Directives</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_6.html">previous</A>, <A HREF="as_8.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC67" HREF="as_toc.html#TOC67">Assembler Directives</A></H1>
<P>
<A NAME="IDX247"></A>
<A NAME="IDX248"></A>
<A NAME="IDX249"></A>
All assembler directives have names that begin with a period (<SAMP>`.'</SAMP>).
The rest of the name is letters, usually in lower case.
</P>
<P>
This chapter discusses directives that are available regardless of the
target machine configuration for the GNU assembler.
Some machine configurations provide additional directives.
See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC68" HREF="as_toc.html#TOC68"><CODE>.abort</CODE></A></H2>
<P>
<A NAME="IDX250"></A>
<A NAME="IDX251"></A>
This directive stops the assembly immediately. It is for
compatibility with other assemblers. The original idea was that the
assembly language source would be piped into the assembler. If the sender
of the source quit, it could use this directive tells <CODE>as</CODE> to
quit also. One day <CODE>.abort</CODE> will not be supported.
</P>
<H2><A NAME="SEC69" HREF="as_toc.html#TOC69"><CODE>.ABORT</CODE></A></H2>
<P>
<A NAME="IDX252"></A>
When producing COFF output, <CODE>as</CODE> accepts this directive as a
synonym for <SAMP>`.abort'</SAMP>.
</P>
<P>
When producing <CODE>b.out</CODE> output, <CODE>as</CODE> accepts this directive,
but ignores it.
</P>
<H2><A NAME="SEC70" HREF="as_toc.html#TOC70"><CODE>.align <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR></CODE></A></H2>
<P>
<A NAME="IDX253"></A>
<A NAME="IDX254"></A>
Pad the location counter (in the current subsection) to a particular storage
boundary. The first expression (which must be absolute) is the alignment
required, as described below.
</P>
<P>
The second expression (also absolute) gives the fill value to be stored in the
padding bytes. It (and the comma) may be omitted. If it is omitted, the
padding bytes are normally zero. However, on some systems, if the section is
marked as containing code and the fill value is omitted, the space is filled
with no-op instructions.
</P>
<P>
The third expression is also absolute, and is also optional. If it is present,
it is the maximum number of bytes that should be skipped by this alignment
directive. If doing the alignment would require skipping more bytes than the
specified maximum, then the alignment is not done at all. You can omit the
fill value (the second argument) entirely by simply using two commas after the
required alignment; this can be useful if you want the alignment to be filled
with no-op instructions when appropriate.
</P>
<P>
The way the required alignment is specified varies from system to system.
For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF
format,
the first expression is the
alignment request in bytes. For example <SAMP>`.align 8'</SAMP> advances
the location counter until it is a multiple of 8. If the location counter
is already a multiple of 8, no change is needed.
</P>
<P>
For other systems, including the i386 using a.out format, it is the
number of low-order zero bits the location counter must have after
advancement. For example <SAMP>`.align 3'</SAMP> advances the location
counter until it a multiple of 8. If the location counter is already a
multiple of 8, no change is needed.
</P>
<P>
This inconsistency is due to the different behaviors of the various
native assemblers for these systems which GAS must emulate.
GAS also provides <CODE>.balign</CODE> and <CODE>.p2align</CODE> directives,
described later, which have a consistent behavior across all
architectures (but are specific to GAS).
</P>
<H2><A NAME="SEC71" HREF="as_toc.html#TOC71"><CODE>.app-file <VAR>string</VAR></CODE></A></H2>
<P>
<A NAME="IDX255"></A>
<A NAME="IDX256"></A>
<A NAME="IDX257"></A>
<CODE>.app-file</CODE>
(which may also be spelled <SAMP>`.file'</SAMP>)
tells <CODE>as</CODE> that we are about to start a new
logical file. <VAR>string</VAR> is the new file name. In general, the
filename is recognized whether or not it is surrounded by quotes <SAMP>`"'</SAMP>;
but if you wish to specify an empty file name is permitted,
you must give the quotes--<CODE>""</CODE>. This statement may go away in
future: it is only recognized to be compatible with old <CODE>as</CODE>
programs.
</P>
<H2><A NAME="SEC72" HREF="as_toc.html#TOC72"><CODE>.ascii "<VAR>string</VAR>"</CODE>...</A></H2>
<P>
<A NAME="IDX258"></A>
<A NAME="IDX259"></A>
<CODE>.ascii</CODE> expects zero or more string literals (see section <A HREF="as_3.html#SEC33">Strings</A>)
separated by commas. It assembles each string (with no automatic
trailing zero byte) into consecutive addresses.
</P>
<H2><A NAME="SEC73" HREF="as_toc.html#TOC73"><CODE>.asciz "<VAR>string</VAR>"</CODE>...</A></H2>
<P>
<A NAME="IDX260"></A>
<A NAME="IDX261"></A>
<A NAME="IDX262"></A>
<CODE>.asciz</CODE> is just like <CODE>.ascii</CODE>, but each string is followed by
a zero byte. The "z" in <SAMP>`.asciz'</SAMP> stands for "zero".
</P>
<H2><A NAME="SEC74" HREF="as_toc.html#TOC74"><CODE>.balign[wl] <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR></CODE></A></H2>
<P>
<A NAME="IDX263"></A>
<A NAME="IDX264"></A>
Pad the location counter (in the current subsection) to a particular
storage boundary. The first expression (which must be absolute) is the
alignment request in bytes. For example <SAMP>`.balign 8'</SAMP> advances
the location counter until it is a multiple of 8. If the location counter
is already a multiple of 8, no change is needed.
</P>
<P>
The second expression (also absolute) gives the fill value to be stored in the
padding bytes. It (and the comma) may be omitted. If it is omitted, the
padding bytes are normally zero. However, on some systems, if the section is
marked as containing code and the fill value is omitted, the space is filled
with no-op instructions.
</P>
<P>
The third expression is also absolute, and is also optional. If it is present,
it is the maximum number of bytes that should be skipped by this alignment
directive. If doing the alignment would require skipping more bytes than the
specified maximum, then the alignment is not done at all. You can omit the
fill value (the second argument) entirely by simply using two commas after the
required alignment; this can be useful if you want the alignment to be filled
with no-op instructions when appropriate.
</P>
<P>
<A NAME="IDX265"></A>
<A NAME="IDX266"></A>
The <CODE>.balignw</CODE> and <CODE>.balignl</CODE> directives are variants of the
<CODE>.balign</CODE> directive. The <CODE>.balignw</CODE> directive treats the fill
pattern as a two byte word value. The <CODE>.balignl</CODE> directives treats the
fill pattern as a four byte longword value. For example, <CODE>.balignw
4,0x368d</CODE> will align to a multiple of 4. If it skips two bytes, they will be
filled in with the value 0x368d (the exact placement of the bytes depends upon
the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
undefined.
</P>
<H2><A NAME="SEC75" HREF="as_toc.html#TOC75"><CODE>.byte <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX267"></A>
<A NAME="IDX268"></A>
<CODE>.byte</CODE> expects zero or more expressions, separated by commas.
Each expression is assembled into the next byte.
</P>
<H2><A NAME="SEC76" HREF="as_toc.html#TOC76"><CODE>.comm <VAR>symbol</VAR> , <VAR>length</VAR> </CODE></A></H2>
<P>
<A NAME="IDX269"></A>
<A NAME="IDX270"></A>
<CODE>.comm</CODE> declares a common symbol named <VAR>symbol</VAR>. When linking, a
common symbol in one object file may be merged with a defined or common symbol
of the same name in another object file. If <CODE>ld</CODE> does not see a
definition for the symbol--just one or more common symbols--then it will
allocate <VAR>length</VAR> bytes of uninitialized memory. <VAR>length</VAR> must be an
absolute expression. If <CODE>ld</CODE> sees multiple common symbols with
the same name, and they do not all have the same size, it will allocate space
using the largest size.
</P>
<P>
When using ELF, the <CODE>.comm</CODE> directive takes an optional third argument.
This is the desired alignment of the symbol, specified as a byte boundary (for
example, an alignment of 16 means that the least significant 4 bits of the
address should be zero). The alignment must be an absolute expression, and it
must be a power of two. If <CODE>ld</CODE> allocates uninitialized memory
for the common symbol, it will use the alignment when placing the symbol. If
no alignment is specified, <CODE>as</CODE> will set the alignment to the
largest power of two less than or equal to the size of the symbol, up to a
maximum of 16.
</P>
<P>
The syntax for <CODE>.comm</CODE> differs slightly on the HPPA. The syntax is
<SAMP>`<VAR>symbol</VAR> .comm, <VAR>length</VAR>'</SAMP>; <VAR>symbol</VAR> is optional.
</P>
<H2><A NAME="SEC77" HREF="as_toc.html#TOC77"><CODE>.data <VAR>subsection</VAR></CODE></A></H2>
<P>
<A NAME="IDX271"></A>
<CODE>.data</CODE> tells <CODE>as</CODE> to assemble the following statements onto the
end of the data subsection numbered <VAR>subsection</VAR> (which is an
absolute expression). If <VAR>subsection</VAR> is omitted, it defaults
to zero.
</P>
<H2><A NAME="SEC78" HREF="as_toc.html#TOC78"><CODE>.def <VAR>name</VAR></CODE></A></H2>
<P>
<A NAME="IDX272"></A>
<A NAME="IDX273"></A>
<A NAME="IDX274"></A>
Begin defining debugging information for a symbol <VAR>name</VAR>; the
definition extends until the <CODE>.endef</CODE> directive is encountered.
</P>
<P>
This directive is only observed when <CODE>as</CODE> is configured for COFF
format output; when producing <CODE>b.out</CODE>, <SAMP>`.def'</SAMP> is recognized,
but ignored.
</P>
<H2><A NAME="SEC79" HREF="as_toc.html#TOC79"><CODE>.desc <VAR>symbol</VAR>, <VAR>abs-expression</VAR></CODE></A></H2>
<P>
<A NAME="IDX275"></A>
<A NAME="IDX276"></A>
<A NAME="IDX277"></A>
This directive sets the descriptor of the symbol (see section <A HREF="as_5.html#SEC50">Symbol Attributes</A>)
to the low 16 bits of an absolute expression.
</P>
<P>
The <SAMP>`.desc'</SAMP> directive is not available when <CODE>as</CODE> is
configured for COFF output; it is only for <CODE>a.out</CODE> or <CODE>b.out</CODE>
object format. For the sake of compatibility, <CODE>as</CODE> accepts
it, but produces no output, when configured for COFF.
</P>
<H2><A NAME="SEC80" HREF="as_toc.html#TOC80"><CODE>.dim</CODE></A></H2>
<P>
<A NAME="IDX278"></A>
<A NAME="IDX279"></A>
<A NAME="IDX280"></A>
This directive is generated by compilers to include auxiliary debugging
information in the symbol table. It is only permitted inside
<CODE>.def</CODE>/<CODE>.endef</CODE> pairs.
</P>
<P>
<SAMP>`.dim'</SAMP> is only meaningful when generating COFF format output; when
<CODE>as</CODE> is generating <CODE>b.out</CODE>, it accepts this directive but
ignores it.
</P>
<H2><A NAME="SEC81" HREF="as_toc.html#TOC81"><CODE>.double <VAR>flonums</VAR></CODE></A></H2>
<P>
<A NAME="IDX281"></A>
<A NAME="IDX282"></A>
<CODE>.double</CODE> expects zero or more flonums, separated by commas. It
assembles floating point numbers.
The exact kind of floating point numbers emitted depends on how
<CODE>as</CODE> is configured. See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC82" HREF="as_toc.html#TOC82"><CODE>.eject</CODE></A></H2>
<P>
<A NAME="IDX283"></A>
<A NAME="IDX284"></A>
<A NAME="IDX285"></A>
<A NAME="IDX286"></A>
Force a page break at this point, when generating assembly listings.
</P>
<H2><A NAME="SEC83" HREF="as_toc.html#TOC83"><CODE>.else</CODE></A></H2>
<P>
<A NAME="IDX287"></A>
<CODE>.else</CODE> is part of the <CODE>as</CODE> support for conditional
assembly; see section <A HREF="as_7.html#SEC96"><CODE>.if <VAR>absolute expression</CODE></VAR></A>. It marks the beginning of a section
of code to be assembled if the condition for the preceding <CODE>.if</CODE>
was false.
</P>
<H2><A NAME="SEC84" HREF="as_toc.html#TOC84"><CODE>.endef</CODE></A></H2>
<P>
<A NAME="IDX288"></A>
This directive flags the end of a symbol definition begun with
<CODE>.def</CODE>.
</P>
<P>
<SAMP>`.endef'</SAMP> is only meaningful when generating COFF format output; if
<CODE>as</CODE> is configured to generate <CODE>b.out</CODE>, it accepts this
directive but ignores it.
</P>
<H2><A NAME="SEC85" HREF="as_toc.html#TOC85"><CODE>.endif</CODE></A></H2>
<P>
<A NAME="IDX289"></A>
<CODE>.endif</CODE> is part of the <CODE>as</CODE> support for conditional assembly;
it marks the end of a block of code that is only assembled
conditionally. See section <A HREF="as_7.html#SEC96"><CODE>.if <VAR>absolute expression</CODE></VAR></A>.
</P>
<H2><A NAME="SEC86" HREF="as_toc.html#TOC86"><CODE>.equ <VAR>symbol</VAR>, <VAR>expression</VAR></CODE></A></H2>
<P>
<A NAME="IDX290"></A>
<A NAME="IDX291"></A>
<A NAME="IDX292"></A>
This directive sets the value of <VAR>symbol</VAR> to <VAR>expression</VAR>.
It is synonymous with <SAMP>`.set'</SAMP>; see section <A HREF="as_7.html#SEC120"><CODE>.set <VAR>symbol</CODE>, <VAR>expression</VAR></VAR></A>.
</P>
<P>
The syntax for <CODE>equ</CODE> on the HPPA is
<SAMP>`<VAR>symbol</VAR> .equ <VAR>expression</VAR>'</SAMP>.
</P>
<H2><A NAME="SEC87" HREF="as_toc.html#TOC87"><CODE>.equiv <VAR>symbol</VAR>, <VAR>expression</VAR></CODE></A></H2>
<P>
<A NAME="IDX293"></A>
The <CODE>.equiv</CODE> directive is like <CODE>.equ</CODE> and <CODE>.set</CODE>, except that
the assembler will signal an error if <VAR>symbol</VAR> is already defined.
</P>
<P>
Except for the contents of the error message, this is roughly equivalent to
<PRE>
.ifdef SYM
.err
.endif
.equ SYM,VAL
</PRE>
<H2><A NAME="SEC88" HREF="as_toc.html#TOC88"><CODE>.err</CODE></A></H2>
<P>
<A NAME="IDX294"></A>
If <CODE>as</CODE> assembles a <CODE>.err</CODE> directive, it will print an error
message and, unless the <CODE>-Z</CODE> option was used, it will not generate an
object file. This can be used to signal error an conditionally compiled code.
</P>
<H2><A NAME="SEC89" HREF="as_toc.html#TOC89"><CODE>.extern</CODE></A></H2>
<P>
<A NAME="IDX295"></A>
<CODE>.extern</CODE> is accepted in the source program--for compatibility
with other assemblers--but it is ignored. <CODE>as</CODE> treats
all undefined symbols as external.
</P>
<H2><A NAME="SEC90" HREF="as_toc.html#TOC90"><CODE>.file <VAR>string</VAR></CODE></A></H2>
<P>
<A NAME="IDX296"></A>
<A NAME="IDX297"></A>
<A NAME="IDX298"></A>
<CODE>.file</CODE> (which may also be spelled <SAMP>`.app-file'</SAMP>) tells
<CODE>as</CODE> that we are about to start a new logical file.
<VAR>string</VAR> is the new file name. In general, the filename is
recognized whether or not it is surrounded by quotes <SAMP>`"'</SAMP>; but if
you wish to specify an empty file name, you must give the
quotes--<CODE>""</CODE>. This statement may go away in future: it is only
recognized to be compatible with old <CODE>as</CODE> programs.
In some configurations of <CODE>as</CODE>, <CODE>.file</CODE> has already been
removed to avoid conflicts with other assemblers. See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC91" HREF="as_toc.html#TOC91"><CODE>.fill <VAR>repeat</VAR> , <VAR>size</VAR> , <VAR>value</VAR></CODE></A></H2>
<P>
<A NAME="IDX299"></A>
<A NAME="IDX300"></A>
<A NAME="IDX301"></A>
<VAR>result</VAR>, <VAR>size</VAR> and <VAR>value</VAR> are absolute expressions.
This emits <VAR>repeat</VAR> copies of <VAR>size</VAR> bytes. <VAR>Repeat</VAR>
may be zero or more. <VAR>Size</VAR> may be zero or more, but if it is
more than 8, then it is deemed to have the value 8, compatible with
other people's assemblers. The contents of each <VAR>repeat</VAR> bytes
is taken from an 8-byte number. The highest order 4 bytes are
zero. The lowest order 4 bytes are <VAR>value</VAR> rendered in the
byte-order of an integer on the computer <CODE>as</CODE> is assembling for.
Each <VAR>size</VAR> bytes in a repetition is taken from the lowest order
<VAR>size</VAR> bytes of this number. Again, this bizarre behavior is
compatible with other people's assemblers.
</P>
<P>
<VAR>size</VAR> and <VAR>value</VAR> are optional.
If the second comma and <VAR>value</VAR> are absent, <VAR>value</VAR> is
assumed zero. If the first comma and following tokens are absent,
<VAR>size</VAR> is assumed to be 1.
</P>
<H2><A NAME="SEC92" HREF="as_toc.html#TOC92"><CODE>.float <VAR>flonums</VAR></CODE></A></H2>
<P>
<A NAME="IDX302"></A>
<A NAME="IDX303"></A>
This directive assembles zero or more flonums, separated by commas. It
has the same effect as <CODE>.single</CODE>.
The exact kind of floating point numbers emitted depends on how
<CODE>as</CODE> is configured.
See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC93" HREF="as_toc.html#TOC93"><CODE>.global <VAR>symbol</VAR></CODE>, <CODE>.globl <VAR>symbol</VAR></CODE></A></H2>
<P>
<A NAME="IDX304"></A>
<A NAME="IDX305"></A>
<CODE>.global</CODE> makes the symbol visible to <CODE>ld</CODE>. If you define
<VAR>symbol</VAR> in your partial program, its value is made available to
other partial programs that are linked with it. Otherwise,
<VAR>symbol</VAR> takes its attributes from a symbol of the same name
from another file linked into the same program.
</P>
<P>
Both spellings (<SAMP>`.globl'</SAMP> and <SAMP>`.global'</SAMP>) are accepted, for
compatibility with other assemblers.
</P>
<P>
On the HPPA, <CODE>.global</CODE> is not always enough to make it accessible to other
partial programs. You may need the HPPA-only <CODE>.EXPORT</CODE> directive as well.
See section <A HREF="as_15.html#SEC194">HPPA Assembler Directives</A>.
</P>
<H2><A NAME="SEC94" HREF="as_toc.html#TOC94"><CODE>.hword <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX306"></A>
<A NAME="IDX307"></A>
<A NAME="IDX308"></A>
<A NAME="IDX309"></A>
This expects zero or more <VAR>expressions</VAR>, and emits
a 16 bit number for each.
</P>
<P>
This directive is a synonym for <SAMP>`.short'</SAMP>; depending on the target
architecture, it may also be a synonym for <SAMP>`.word'</SAMP>.
</P>
<H2><A NAME="SEC95" HREF="as_toc.html#TOC95"><CODE>.ident</CODE></A></H2>
<P>
<A NAME="IDX310"></A>
This directive is used by some assemblers to place tags in object files.
<CODE>as</CODE> simply accepts the directive for source-file
compatibility with such assemblers, but does not actually emit anything
for it.
</P>
<H2><A NAME="SEC96" HREF="as_toc.html#TOC96"><CODE>.if <VAR>absolute expression</VAR></CODE></A></H2>
<P>
<A NAME="IDX311"></A>
<A NAME="IDX312"></A>
<CODE>.if</CODE> marks the beginning of a section of code which is only
considered part of the source program being assembled if the argument
(which must be an <VAR>absolute expression</VAR>) is non-zero. The end of
the conditional section of code must be marked by <CODE>.endif</CODE>
(see section <A HREF="as_7.html#SEC85"><CODE>.endif</CODE></A>); optionally, you may include code for the
alternative condition, flagged by <CODE>.else</CODE> (see section <A HREF="as_7.html#SEC83"><CODE>.else</CODE></A>).
</P>
<P>
The following variants of <CODE>.if</CODE> are also supported:
<DL COMPACT>
<DT><CODE>.ifdef <VAR>symbol</VAR></CODE>
<DD>
<A NAME="IDX313"></A>
Assembles the following section of code if the specified <VAR>symbol</VAR>
has been defined.
<A NAME="IDX314"></A>
<A NAME="IDX315"></A>
<DT><CODE>.ifndef <VAR>symbol</VAR></CODE>
<DD>
<DT><CODE>.ifnotdef <VAR>symbol</VAR></CODE>
<DD>
Assembles the following section of code if the specified <VAR>symbol</VAR>
has not been defined. Both spelling variants are equivalent.
</DL>
<H2><A NAME="SEC97" HREF="as_toc.html#TOC97"><CODE>.include "<VAR>file</VAR>"</CODE></A></H2>
<P>
<A NAME="IDX316"></A>
<A NAME="IDX317"></A>
<A NAME="IDX318"></A>
This directive provides a way to include supporting files at specified
points in your source program. The code from <VAR>file</VAR> is assembled as
if it followed the point of the <CODE>.include</CODE>; when the end of the
included file is reached, assembly of the original file continues. You
can control the search paths used with the <SAMP>`-I'</SAMP> command-line option
(see section <A HREF="as_2.html#SEC9">Command-Line Options</A>). Quotation marks are required
around <VAR>file</VAR>.
</P>
<H2><A NAME="SEC98" HREF="as_toc.html#TOC98"><CODE>.int <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX319"></A>
<A NAME="IDX320"></A>
Expect zero or more <VAR>expressions</VAR>, of any section, separated by commas.
For each expression, emit a number that, at run time, is the value of that
expression. The byte order and bit size of the number depends on what kind
of target the assembly is for.
</P>
<H2><A NAME="SEC99" HREF="as_toc.html#TOC99"><CODE>.irp <VAR>symbol</VAR>,<VAR>values</VAR></CODE>...</A></H2>
<P>
<A NAME="IDX321"></A>
Evaluate a sequence of statements assigning different values to <VAR>symbol</VAR>.
The sequence of statements starts at the <CODE>.irp</CODE> directive, and is
terminated by an <CODE>.endr</CODE> directive. For each <VAR>value</VAR>, <VAR>symbol</VAR> is
set to <VAR>value</VAR>, and the sequence of statements is assembled. If no
<VAR>value</VAR> is listed, the sequence of statements is assembled once, with
<VAR>symbol</VAR> set to the null string. To refer to <VAR>symbol</VAR> within the
sequence of statements, use <VAR>\symbol</VAR>.
</P>
<P>
For example, assembling
</P>
<PRE>
.irp param,1,2,3
move d\param,sp@-
.endr
</PRE>
<P>
is equivalent to assembling
</P>
<PRE>
move d1,sp@-
move d2,sp@-
move d3,sp@-
</PRE>
<H2><A NAME="SEC100" HREF="as_toc.html#TOC100"><CODE>.irpc <VAR>symbol</VAR>,<VAR>values</VAR></CODE>...</A></H2>
<P>
<A NAME="IDX322"></A>
Evaluate a sequence of statements assigning different values to <VAR>symbol</VAR>.
The sequence of statements starts at the <CODE>.irpc</CODE> directive, and is
terminated by an <CODE>.endr</CODE> directive. For each character in <VAR>value</VAR>,
<VAR>symbol</VAR> is set to the character, and the sequence of statements is
assembled. If no <VAR>value</VAR> is listed, the sequence of statements is
assembled once, with <VAR>symbol</VAR> set to the null string. To refer to
<VAR>symbol</VAR> within the sequence of statements, use <VAR>\symbol</VAR>.
</P>
<P>
For example, assembling
</P>
<PRE>
.irpc param,123
move d\param,sp@-
.endr
</PRE>
<P>
is equivalent to assembling
</P>
<PRE>
move d1,sp@-
move d2,sp@-
move d3,sp@-
</PRE>
<H2><A NAME="SEC101" HREF="as_toc.html#TOC101"><CODE>.lcomm <VAR>symbol</VAR> , <VAR>length</VAR></CODE></A></H2>
<P>
<A NAME="IDX323"></A>
<A NAME="IDX324"></A>
<A NAME="IDX325"></A>
Reserve <VAR>length</VAR> (an absolute expression) bytes for a local common
denoted by <VAR>symbol</VAR>. The section and value of <VAR>symbol</VAR> are
those of the new local common. The addresses are allocated in the bss
section, so that at run-time the bytes start off zeroed. <VAR>Symbol</VAR>
is not declared global (see section <A HREF="as_7.html#SEC93"><CODE>.global <VAR>symbol</CODE></VAR>, <CODE>.globl <VAR>symbol</CODE></VAR></A>), so is normally
not visible to <CODE>ld</CODE>.
</P>
<P>
Some targets permit a third argument to be used with <CODE>.lcomm</CODE>. This
argument specifies the desired alignment of the symbol in the bss section.
</P>
<P>
The syntax for <CODE>.lcomm</CODE> differs slightly on the HPPA. The syntax is
<SAMP>`<VAR>symbol</VAR> .lcomm, <VAR>length</VAR>'</SAMP>; <VAR>symbol</VAR> is optional.
</P>
<H2><A NAME="SEC102" HREF="as_toc.html#TOC102"><CODE>.lflags</CODE></A></H2>
<P>
<A NAME="IDX326"></A>
<CODE>as</CODE> accepts this directive, for compatibility with other
assemblers, but ignores it.
</P>
<H2><A NAME="SEC103" HREF="as_toc.html#TOC103"><CODE>.line <VAR>line-number</VAR></CODE></A></H2>
<P>
<A NAME="IDX327"></A>
<A NAME="IDX328"></A>
Change the logical line number. <VAR>line-number</VAR> must be an absolute
expression. The next line has that logical line number. Therefore any other
statements on the current line (after a statement separator character) are
reported as on logical line number <VAR>line-number</VAR> - 1. One day
<CODE>as</CODE> will no longer support this directive: it is recognized only
for compatibility with existing assembler programs.
</P>
<P>
<EM>Warning:</EM> In the AMD29K configuration of as, this command is
not available; use the synonym <CODE>.ln</CODE> in that context.
</P>
<P>
Even though this is a directive associated with the <CODE>a.out</CODE> or
<CODE>b.out</CODE> object-code formats, <CODE>as</CODE> still recognizes it
when producing COFF output, and treats <SAMP>`.line'</SAMP> as though it
were the COFF <SAMP>`.ln'</SAMP> <EM>if</EM> it is found outside a
<CODE>.def</CODE>/<CODE>.endef</CODE> pair.
</P>
<P>
Inside a <CODE>.def</CODE>, <SAMP>`.line'</SAMP> is, instead, one of the directives
used by compilers to generate auxiliary symbol information for
debugging.
</P>
<H2><A NAME="SEC104" HREF="as_toc.html#TOC104"><CODE>.linkonce [<VAR>type</VAR>]</CODE></A></H2>
<P>
<A NAME="IDX329"></A>
<A NAME="IDX330"></A>
<A NAME="IDX331"></A>
Mark the current section so that the linker only includes a single copy of it.
This may be used to include the same section in several different object files,
but ensure that the linker will only include it once in the final output file.
The <CODE>.linkonce</CODE> pseudo-op must be used for each instance of the section.
Duplicate sections are detected based on the section name, so it should be
unique.
</P>
<P>
This directive is only supported by a few object file formats; as of this
writing, the only object file format which supports it is the Portable
Executable format used on Windows NT.
</P>
<P>
The <VAR>type</VAR> argument is optional. If specified, it must be one of the
following strings. For example:
<PRE>
.linkonce same_size
</PRE>
<P>
Not all types may be supported on all object file formats.
</P>
<DL COMPACT>
<DT><CODE>discard</CODE>
<DD>
Silently discard duplicate sections. This is the default.
<DT><CODE>one_only</CODE>
<DD>
Warn if there are duplicate sections, but still keep only one copy.
<DT><CODE>same_size</CODE>
<DD>
Warn if any of the duplicates have different sizes.
<DT><CODE>same_contents</CODE>
<DD>
Warn if any of the duplicates do not have exactly the same contents.
</DL>
<H2><A NAME="SEC105" HREF="as_toc.html#TOC105"><CODE>.ln <VAR>line-number</VAR></CODE></A></H2>
<P>
<A NAME="IDX332"></A>
<SAMP>`.ln'</SAMP> is a synonym for <SAMP>`.line'</SAMP>.
</P>
<H2><A NAME="SEC106" HREF="as_toc.html#TOC106"><CODE>.mri <VAR>val</VAR></CODE></A></H2>
<P>
<A NAME="IDX333"></A>
<A NAME="IDX334"></A>
If <VAR>val</VAR> is non-zero, this tells <CODE>as</CODE> to enter MRI mode. If
<VAR>val</VAR> is zero, this tells <CODE>as</CODE> to exit MRI mode. This change
affects code assembled until the next <CODE>.mri</CODE> directive, or until the end
of the file. See section <A HREF="as_2.html#SEC16">Assemble in MRI Compatibility Mode: <CODE>-M</CODE></A>.
</P>
<H2><A NAME="SEC107" HREF="as_toc.html#TOC107"><CODE>.list</CODE></A></H2>
<P>
<A NAME="IDX335"></A>
<A NAME="IDX336"></A>
Control (in conjunction with the <CODE>.nolist</CODE> directive) whether or
not assembly listings are generated. These two directives maintain an
internal counter (which is zero initially). <CODE>.list</CODE> increments the
counter, and <CODE>.nolist</CODE> decrements it. Assembly listings are
generated whenever the counter is greater than zero.
</P>
<P>
By default, listings are disabled. When you enable them (with the
<SAMP>`-a'</SAMP> command line option; see section <A HREF="as_2.html#SEC9">Command-Line Options</A>),
the initial value of the listing counter is one.
</P>
<H2><A NAME="SEC108" HREF="as_toc.html#TOC108"><CODE>.long <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX337"></A>
<CODE>.long</CODE> is the same as <SAMP>`.int'</SAMP>, see section <A HREF="as_7.html#SEC98"><CODE>.int <VAR>expressions</CODE></VAR></A>.
</P>
<H2><A NAME="SEC109" HREF="as_toc.html#TOC109"><CODE>.macro</CODE></A></H2>
<P>
<A NAME="IDX338"></A>
The commands <CODE>.macro</CODE> and <CODE>.endm</CODE> allow you to define macros that
generate assembly output. For example, this definition specifies a macro
<CODE>sum</CODE> that puts a sequence of numbers into memory:
</P>
<PRE>
.macro sum from=0, to=5
.long \from
.if \to-\from
sum "(\from+1)",\to
.endif
.endm
</PRE>
<P>
With that definition, <SAMP>`SUM 0,5'</SAMP> is equivalent to this assembly input:
</P>
<PRE>
.long 0
.long 1
.long 2
.long 3
.long 4
.long 5
</PRE>
<DL COMPACT>
<DT><CODE>.macro <VAR>macname</VAR></CODE>
<DD>
<A NAME="IDX339"></A>
<DT><CODE>.macro <VAR>macname</VAR> <VAR>macargs</VAR> ...</CODE>
<DD>
<A NAME="IDX340"></A>
<A NAME="IDX341"></A>
Begin the definition of a macro called <VAR>macname</VAR>. If your macro
definition requires arguments, specify their names after the macro name,
separated by commas or spaces. You can supply a default value for any
macro argument by following the name with <SAMP>`=<VAR>deflt</VAR>'</SAMP>. For
example, these are all valid <CODE>.macro</CODE> statements:
<DL COMPACT>
<DT><CODE>.macro comm</CODE>
<DD>
Begin the definition of a macro called <CODE>comm</CODE>, which takes no
arguments.
<DT><CODE>.macro plus1 p, p1</CODE>
<DD>
<DT><CODE>.macro plus1 p p1</CODE>
<DD>
Either statement begins the definition of a macro called <CODE>plus1</CODE>,
which takes two arguments; within the macro definition, write
<SAMP>`\p'</SAMP> or <SAMP>`\p1'</SAMP> to evaluate the arguments.
<DT><CODE>.macro reserve_str p1=0 p2</CODE>
<DD>
Begin the definition of a macro called <CODE>reserve_str</CODE>, with two
arguments. The first argument has a default value, but not the second.
After the definition is complete, you can call the macro either as
<SAMP>`reserve_str <VAR>a</VAR>,<VAR>b</VAR>'</SAMP> (with <SAMP>`\p1'</SAMP> evaluating to
<VAR>a</VAR> and <SAMP>`\p2'</SAMP> evaluating to <VAR>b</VAR>), or as <SAMP>`reserve_str
,<VAR>b</VAR>'</SAMP> (with <SAMP>`\p1'</SAMP> evaluating as the default, in this case
<SAMP>`0'</SAMP>, and <SAMP>`\p2'</SAMP> evaluating to <VAR>b</VAR>).
</DL>
When you call a macro, you can specify the argument values either by
position, or by keyword. For example, <SAMP>`sum 9,17'</SAMP> is equivalent to
<SAMP>`sum to=17, from=9'</SAMP>.
<DT><CODE>.endm</CODE>
<DD>
<A NAME="IDX342"></A>
<A NAME="IDX343"></A>
Mark the end of a macro definition.
<DT><CODE>.exitm</CODE>
<DD>
<A NAME="IDX344"></A>
<A NAME="IDX345"></A>
Exit early from the current macro definition.
<A NAME="IDX346"></A>
<A NAME="IDX347"></A>
<DT><CODE>\@</CODE>
<DD>
<A NAME="IDX348"></A>
<CODE>as</CODE> maintains a counter of how many macros it has
executed in this pseudo-variable; you can copy that number to your
output with <SAMP>`\@'</SAMP>, but <EM>only within a macro definition</EM>.
</DL>
<H2><A NAME="SEC110" HREF="as_toc.html#TOC110"><CODE>.nolist</CODE></A></H2>
<P>
<A NAME="IDX349"></A>
<A NAME="IDX350"></A>
Control (in conjunction with the <CODE>.list</CODE> directive) whether or
not assembly listings are generated. These two directives maintain an
internal counter (which is zero initially). <CODE>.list</CODE> increments the
counter, and <CODE>.nolist</CODE> decrements it. Assembly listings are
generated whenever the counter is greater than zero.
</P>
<H2><A NAME="SEC111" HREF="as_toc.html#TOC111"><CODE>.octa <VAR>bignums</VAR></CODE></A></H2>
<P>
<A NAME="IDX351"></A>
<A NAME="IDX352"></A>
<A NAME="IDX353"></A>
This directive expects zero or more bignums, separated by commas. For each
bignum, it emits a 16-byte integer.
</P>
<P>
The term "octa" comes from contexts in which a "word" is two bytes;
hence <EM>octa</EM>-word for 16 bytes.
</P>
<H2><A NAME="SEC112" HREF="as_toc.html#TOC112"><CODE>.org <VAR>new-lc</VAR> , <VAR>fill</VAR></CODE></A></H2>
<P>
<A NAME="IDX354"></A>
<A NAME="IDX355"></A>
<A NAME="IDX356"></A>
<A NAME="IDX357"></A>
Advance the location counter of the current section to
<VAR>new-lc</VAR>. <VAR>new-lc</VAR> is either an absolute expression or an
expression with the same section as the current subsection. That is,
you can't use <CODE>.org</CODE> to cross sections: if <VAR>new-lc</VAR> has the
wrong section, the <CODE>.org</CODE> directive is ignored. To be compatible
with former assemblers, if the section of <VAR>new-lc</VAR> is absolute,
<CODE>as</CODE> issues a warning, then pretends the section of <VAR>new-lc</VAR>
is the same as the current subsection.
</P>
<P>
<CODE>.org</CODE> may only increase the location counter, or leave it
unchanged; you cannot use <CODE>.org</CODE> to move the location counter
backwards.
</P>
<P>
Because <CODE>as</CODE> tries to assemble programs in one pass, <VAR>new-lc</VAR>
may not be undefined. If you really detest this restriction we eagerly await
a chance to share your improved assembler.
</P>
<P>
Beware that the origin is relative to the start of the section, not
to the start of the subsection. This is compatible with other
people's assemblers.
</P>
<P>
When the location counter (of the current subsection) is advanced, the
intervening bytes are filled with <VAR>fill</VAR> which should be an
absolute expression. If the comma and <VAR>fill</VAR> are omitted,
<VAR>fill</VAR> defaults to zero.
</P>
<H2><A NAME="SEC113" HREF="as_toc.html#TOC113"><CODE>.p2align[wl] <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR>, <VAR>abs-expr</VAR></CODE></A></H2>
<P>
<A NAME="IDX358"></A>
<A NAME="IDX359"></A>
Pad the location counter (in the current subsection) to a particular
storage boundary. The first expression (which must be absolute) is the
number of low-order zero bits the location counter must have after
advancement. For example <SAMP>`.p2align 3'</SAMP> advances the location
counter until it a multiple of 8. If the location counter is already a
multiple of 8, no change is needed.
</P>
<P>
The second expression (also absolute) gives the fill value to be stored in the
padding bytes. It (and the comma) may be omitted. If it is omitted, the
padding bytes are normally zero. However, on some systems, if the section is
marked as containing code and the fill value is omitted, the space is filled
with no-op instructions.
</P>
<P>
The third expression is also absolute, and is also optional. If it is present,
it is the maximum number of bytes that should be skipped by this alignment
directive. If doing the alignment would require skipping more bytes than the
specified maximum, then the alignment is not done at all. You can omit the
fill value (the second argument) entirely by simply using two commas after the
required alignment; this can be useful if you want the alignment to be filled
with no-op instructions when appropriate.
</P>
<P>
<A NAME="IDX360"></A>
<A NAME="IDX361"></A>
The <CODE>.p2alignw</CODE> and <CODE>.p2alignl</CODE> directives are variants of the
<CODE>.p2align</CODE> directive. The <CODE>.p2alignw</CODE> directive treats the fill
pattern as a two byte word value. The <CODE>.p2alignl</CODE> directives treats the
fill pattern as a four byte longword value. For example, <CODE>.p2alignw
2,0x368d</CODE> will align to a multiple of 4. If it skips two bytes, they will be
filled in with the value 0x368d (the exact placement of the bytes depends upon
the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
undefined.
</P>
<H2><A NAME="SEC114" HREF="as_toc.html#TOC114"><CODE>.psize <VAR>lines</VAR> , <VAR>columns</VAR></CODE></A></H2>
<P>
<A NAME="IDX362"></A>
<A NAME="IDX363"></A>
<A NAME="IDX364"></A>
Use this directive to declare the number of lines--and, optionally, the
number of columns--to use for each page, when generating listings.
</P>
<P>
If you do not use <CODE>.psize</CODE>, listings use a default line-count
of 60. You may omit the comma and <VAR>columns</VAR> specification; the
default width is 200 columns.
</P>
<P>
<CODE>as</CODE> generates formfeeds whenever the specified number of
lines is exceeded (or whenever you explicitly request one, using
<CODE>.eject</CODE>).
</P>
<P>
If you specify <VAR>lines</VAR> as <CODE>0</CODE>, no formfeeds are generated save
those explicitly specified with <CODE>.eject</CODE>.
</P>
<H2><A NAME="SEC115" HREF="as_toc.html#TOC115"><CODE>.quad <VAR>bignums</VAR></CODE></A></H2>
<P>
<A NAME="IDX365"></A>
<CODE>.quad</CODE> expects zero or more bignums, separated by commas. For
each bignum, it emits
an 8-byte integer. If the bignum won't fit in 8 bytes, it prints a
warning message; and just takes the lowest order 8 bytes of the bignum.
<A NAME="IDX366"></A>
<A NAME="IDX367"></A>
</P>
<P>
The term "quad" comes from contexts in which a "word" is two bytes;
hence <EM>quad</EM>-word for 8 bytes.
</P>
<H2><A NAME="SEC116" HREF="as_toc.html#TOC116"><CODE>.rept <VAR>count</VAR></CODE></A></H2>
<P>
<A NAME="IDX368"></A>
Repeat the sequence of lines between the <CODE>.rept</CODE> directive and the next
<CODE>.endr</CODE> directive <VAR>count</VAR> times.
</P>
<P>
For example, assembling
</P>
<PRE>
.rept 3
.long 0
.endr
</PRE>
<P>
is equivalent to assembling
</P>
<PRE>
.long 0
.long 0
.long 0
</PRE>
<H2><A NAME="SEC117" HREF="as_toc.html#TOC117"><CODE>.sbttl "<VAR>subheading</VAR>"</CODE></A></H2>
<P>
<A NAME="IDX369"></A>
<A NAME="IDX370"></A>
<A NAME="IDX371"></A>
Use <VAR>subheading</VAR> as the title (third line, immediately after the
title line) when generating assembly listings.
</P>
<P>
This directive affects subsequent pages, as well as the current page if
it appears within ten lines of the top of a page.
</P>
<H2><A NAME="SEC118" HREF="as_toc.html#TOC118"><CODE>.scl <VAR>class</VAR></CODE></A></H2>
<P>
<A NAME="IDX372"></A>
<A NAME="IDX373"></A>
<A NAME="IDX374"></A>
Set the storage-class value for a symbol. This directive may only be
used inside a <CODE>.def</CODE>/<CODE>.endef</CODE> pair. Storage class may flag
whether a symbol is static or external, or it may record further
symbolic debugging information.
</P>
<P>
The <SAMP>`.scl'</SAMP> directive is primarily associated with COFF output; when
configured to generate <CODE>b.out</CODE> output format, <CODE>as</CODE>
accepts this directive but ignores it.
</P>
<H2><A NAME="SEC119" HREF="as_toc.html#TOC119"><CODE>.section <VAR>name</VAR></CODE></A></H2>
<P>
<A NAME="IDX375"></A>
<A NAME="IDX376"></A>
Use the <CODE>.section</CODE> directive to assemble the following code into a section
named <VAR>name</VAR>.
</P>
<P>
This directive is only supported for targets that actually support arbitrarily
named sections; on <CODE>a.out</CODE> targets, for example, it is not accepted, even
with a standard <CODE>a.out</CODE> section name.
</P>
<P>
For COFF targets, the <CODE>.section</CODE> directive is used in one of the following
ways:
<PRE>
.section <VAR>name</VAR>[, "<VAR>flags</VAR>"]
.section <VAR>name</VAR>[, <VAR>subsegment</VAR>]
</PRE>
<P>
If the optional argument is quoted, it is taken as flags to use for the
section. Each flag is a single character. The following flags are recognized:
<DL COMPACT>
<DT><CODE>b</CODE>
<DD>
bss section (uninitialized data)
<DT><CODE>n</CODE>
<DD>
section is not loaded
<DT><CODE>w</CODE>
<DD>
writable section
<DT><CODE>d</CODE>
<DD>
data section
<DT><CODE>r</CODE>
<DD>
read-only section
<DT><CODE>x</CODE>
<DD>
executable section
</DL>
<P>
If no flags are specified, the default flags depend upon the section name. If
the section name is not recognized, the default will be for the section to be
loaded and writable.
</P>
<P>
If the optional argument to the <CODE>.section</CODE> directive is not quoted, it is
taken as a subsegment number (see section <A HREF="as_4.html#SEC43">Sub-Sections</A>).
</P>
<P>
For ELF targets, the <CODE>.section</CODE> directive is used like this:
<PRE>
.section <VAR>name</VAR>[, "<VAR>flags</VAR>"[, @<VAR>type</VAR>]]
</PRE>
<P>
The optional <VAR>flags</VAR> argument is a quoted string which may contain any
combintion of the following characters:
<DL COMPACT>
<DT><CODE>a</CODE>
<DD>
section is allocatable
<DT><CODE>w</CODE>
<DD>
section is writable
<DT><CODE>x</CODE>
<DD>
section is executable
</DL>
<P>
The optional <VAR>type</VAR> argument may contain one of the following constants:
<DL COMPACT>
<DT><CODE>@progbits</CODE>
<DD>
section contains data
<DT><CODE>@nobits</CODE>
<DD>
section does not contain data (i.e., section only occupies space)
</DL>
<P>
If no flags are specified, the default flags depend upon the section name. If
the section name is not recognized, the default will be for the section to have
none of the above flags: it will not be allocated in memory, nor writable, nor
executable. The section will contain data.
</P>
<P>
For ELF targets, the assembler supports another type of <CODE>.section</CODE>
directive for compatibility with the Solaris assembler:
<PRE>
.section "<VAR>name</VAR>"[, <VAR>flags</VAR>...]
</PRE>
<P>
Note that the section name is quoted. There may be a sequence of comma
separated flags:
<DL COMPACT>
<DT><CODE>#alloc</CODE>
<DD>
section is allocatable
<DT><CODE>#write</CODE>
<DD>
section is writable
<DT><CODE>#execinstr</CODE>
<DD>
section is executable
</DL>
<H2><A NAME="SEC120" HREF="as_toc.html#TOC120"><CODE>.set <VAR>symbol</VAR>, <VAR>expression</VAR></CODE></A></H2>
<P>
<A NAME="IDX377"></A>
<A NAME="IDX378"></A>
Set the value of <VAR>symbol</VAR> to <VAR>expression</VAR>. This
changes <VAR>symbol</VAR>'s value and type to conform to
<VAR>expression</VAR>. If <VAR>symbol</VAR> was flagged as external, it remains
flagged (see section <A HREF="as_5.html#SEC50">Symbol Attributes</A>).
</P>
<P>
You may <CODE>.set</CODE> a symbol many times in the same assembly.
</P>
<P>
If you <CODE>.set</CODE> a global symbol, the value stored in the object
file is the last value stored into it.
</P>
<P>
The syntax for <CODE>set</CODE> on the HPPA is
<SAMP>`<VAR>symbol</VAR> .set <VAR>expression</VAR>'</SAMP>.
</P>
<H2><A NAME="SEC121" HREF="as_toc.html#TOC121"><CODE>.short <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX379"></A>
<CODE>.short</CODE> is normally the same as <SAMP>`.word'</SAMP>.
See section <A HREF="as_7.html#SEC136"><CODE>.word <VAR>expressions</CODE></VAR></A>.
</P>
<P>
In some configurations, however, <CODE>.short</CODE> and <CODE>.word</CODE> generate
numbers of different lengths; see section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC122" HREF="as_toc.html#TOC122"><CODE>.single <VAR>flonums</VAR></CODE></A></H2>
<P>
<A NAME="IDX380"></A>
<A NAME="IDX381"></A>
This directive assembles zero or more flonums, separated by commas. It
has the same effect as <CODE>.float</CODE>.
The exact kind of floating point numbers emitted depends on how
<CODE>as</CODE> is configured. See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</P>
<H2><A NAME="SEC123" HREF="as_toc.html#TOC123"><CODE>.size</CODE></A></H2>
<P>
<A NAME="IDX382"></A>
This directive is generated by compilers to include auxiliary debugging
information in the symbol table. It is only permitted inside
<CODE>.def</CODE>/<CODE>.endef</CODE> pairs.
</P>
<P>
<SAMP>`.size'</SAMP> is only meaningful when generating COFF format output; when
<CODE>as</CODE> is generating <CODE>b.out</CODE>, it accepts this directive but
ignores it.
</P>
<H2><A NAME="SEC124" HREF="as_toc.html#TOC124"><CODE>.sleb128 <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX383"></A>
<VAR>sleb128</VAR> stands for "signed little endian base 128." This is a
compact, variable length representation of numbers used by the DWARF
symbolic debugging format. See section <A HREF="as_7.html#SEC135"><CODE>.uleb128 <VAR>expressions</CODE></VAR></A>.
</P>
<H2><A NAME="SEC125" HREF="as_toc.html#TOC125"><CODE>.skip <VAR>size</VAR> , <VAR>fill</VAR></CODE></A></H2>
<P>
<A NAME="IDX384"></A>
<A NAME="IDX385"></A>
This directive emits <VAR>size</VAR> bytes, each of value <VAR>fill</VAR>. Both
<VAR>size</VAR> and <VAR>fill</VAR> are absolute expressions. If the comma and
<VAR>fill</VAR> are omitted, <VAR>fill</VAR> is assumed to be zero. This is the same as
<SAMP>`.space'</SAMP>.
</P>
<H2><A NAME="SEC126" HREF="as_toc.html#TOC126"><CODE>.space <VAR>size</VAR> , <VAR>fill</VAR></CODE></A></H2>
<P>
<A NAME="IDX386"></A>
<A NAME="IDX387"></A>
This directive emits <VAR>size</VAR> bytes, each of value <VAR>fill</VAR>. Both
<VAR>size</VAR> and <VAR>fill</VAR> are absolute expressions. If the comma
and <VAR>fill</VAR> are omitted, <VAR>fill</VAR> is assumed to be zero. This is the same
as <SAMP>`.skip'</SAMP>.
</P>
<BLOCKQUOTE>
<P>
<EM>Warning:</EM> <CODE>.space</CODE> has a completely different meaning for HPPA
targets; use <CODE>.block</CODE> as a substitute. See <CITE>HP9000 Series 800
Assembly Language Reference Manual</CITE> (HP 92432-90001) for the meaning of the
<CODE>.space</CODE> directive. See section <A HREF="as_15.html#SEC194">HPPA Assembler Directives</A>,
for a summary.
</BLOCKQUOTE>
<P>
On the AMD 29K, this directive is ignored; it is accepted for
compatibility with other AMD 29K assemblers.
</P>
<BLOCKQUOTE>
<P>
<EM>Warning:</EM> In most versions of the GNU assembler, the directive
<CODE>.space</CODE> has the effect of <CODE>.block</CODE> See section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>.
</BLOCKQUOTE>
<H2><A NAME="SEC127" HREF="as_toc.html#TOC127"><CODE>.stabd, .stabn, .stabs</CODE></A></H2>
<P>
<A NAME="IDX388"></A>
<A NAME="IDX389"></A>
There are three directives that begin <SAMP>`.stab'</SAMP>.
All emit symbols (see section <A HREF="as_5.html#SEC45">Symbols</A>), for use by symbolic debuggers.
The symbols are not entered in the <CODE>as</CODE> hash table: they
cannot be referenced elsewhere in the source file.
Up to five fields are required:
</P>
<DL COMPACT>
<DT><VAR>string</VAR>
<DD>
This is the symbol's name. It may contain any character except
<SAMP>`\000'</SAMP>, so is more general than ordinary symbol names. Some
debuggers used to code arbitrarily complex structures into symbol names
using this field.
<DT><VAR>type</VAR>
<DD>
An absolute expression. The symbol's type is set to the low 8 bits of
this expression. Any bit pattern is permitted, but <CODE>ld</CODE>
and debuggers choke on silly bit patterns.
<DT><VAR>other</VAR>
<DD>
An absolute expression. The symbol's "other" attribute is set to the
low 8 bits of this expression.
<DT><VAR>desc</VAR>
<DD>
An absolute expression. The symbol's descriptor is set to the low 16
bits of this expression.
<DT><VAR>value</VAR>
<DD>
An absolute expression which becomes the symbol's value.
</DL>
<P>
If a warning is detected while reading a <CODE>.stabd</CODE>, <CODE>.stabn</CODE>,
or <CODE>.stabs</CODE> statement, the symbol has probably already been created;
you get a half-formed symbol in your object file. This is
compatible with earlier assemblers!
</P>
<DL COMPACT>
<DT><CODE>.stabd <VAR>type</VAR> , <VAR>other</VAR> , <VAR>desc</VAR></CODE>
<DD>
<A NAME="IDX390"></A>
The "name" of the symbol generated is not even an empty string.
It is a null pointer, for compatibility. Older assemblers used a
null pointer so they didn't waste space in object files with empty
strings.
The symbol's value is set to the location counter,
relocatably. When your program is linked, the value of this symbol
is the address of the location counter when the <CODE>.stabd</CODE> was
assembled.
<A NAME="IDX391"></A>
<DT><CODE>.stabn <VAR>type</VAR> , <VAR>other</VAR> , <VAR>desc</VAR> , <VAR>value</VAR></CODE>
<DD>
The name of the symbol is set to the empty string <CODE>""</CODE>.
<A NAME="IDX392"></A>
<DT><CODE>.stabs <VAR>string</VAR> , <VAR>type</VAR> , <VAR>other</VAR> , <VAR>desc</VAR> , <VAR>value</VAR></CODE>
<DD>
All five fields are specified.
</DL>
<H2><A NAME="SEC128" HREF="as_toc.html#TOC128"><CODE>.string</CODE> "<VAR>str</VAR>"</A></H2>
<P>
<A NAME="IDX393"></A>
<A NAME="IDX394"></A>
</P>
<P>
Copy the characters in <VAR>str</VAR> to the object file. You may specify more than
one string to copy, separated by commas. Unless otherwise specified for a
particular machine, the assembler marks the end of each string with a 0 byte.
You can use any of the escape sequences described in section <A HREF="as_3.html#SEC33">Strings</A>.
</P>
<H2><A NAME="SEC129" HREF="as_toc.html#TOC129"><CODE>.symver</CODE></A></H2>
<P>
<A NAME="IDX395"></A>
<A NAME="IDX396"></A>
<A NAME="IDX397"></A>
Use the <CODE>.symver</CODE> directive to bind symbols to specific version nodes
within a source file. This is only supported on ELF platforms, and is
typically used when assembling files to be linked into a shared library.
There are cases where it may make sense to use this in objects to be bound
into an application itself so as to override a versioned symbol from a
shared library.
</P>
<P>
For ELF targets, the <CODE>.symver</CODE> directive is used like this:
<PRE>
.symver <VAR>name</VAR>, <VAR>name2@nodename</VAR>
</PRE>
<P>
In this case, the symbol <VAR>name</VAR> must exist and be defined within the file
being assembled. The <CODE>.versym</CODE> directive effectively creates a symbol
alias with the name <VAR>name2@nodename</VAR>, and in fact the main reason that we
just don't try and create a regular alias is that the <VAR>@</VAR> character isn't
permitted in symbol names. The <VAR>name2</VAR> part of the name is the actual name
of the symbol by which it will be externally referenced. The name <VAR>name</VAR>
itself is merely a name of convenience that is used so that it is possible to
have definitions for multiple versions of a function within a single source
file, and so that the compiler can unambiguously know which version of a
function is being mentioned. The <VAR>nodename</VAR> portion of the alias should be
the name of a node specified in the version script supplied to the linker when
building a shared library. If you are attempting to override a versioned
symbol from a shared library, then <VAR>nodename</VAR> should correspond to the
nodename of the symbol you are trying to override.
</P>
<H2><A NAME="SEC130" HREF="as_toc.html#TOC130"><CODE>.tag <VAR>structname</VAR></CODE></A></H2>
<P>
<A NAME="IDX398"></A>
<A NAME="IDX399"></A>
<A NAME="IDX400"></A>
This directive is generated by compilers to include auxiliary debugging
information in the symbol table. It is only permitted inside
<CODE>.def</CODE>/<CODE>.endef</CODE> pairs. Tags are used to link structure
definitions in the symbol table with instances of those structures.
</P>
<P>
<SAMP>`.tag'</SAMP> is only used when generating COFF format output; when
<CODE>as</CODE> is generating <CODE>b.out</CODE>, it accepts this directive but
ignores it.
</P>
<H2><A NAME="SEC131" HREF="as_toc.html#TOC131"><CODE>.text <VAR>subsection</VAR></CODE></A></H2>
<P>
<A NAME="IDX401"></A>
Tells <CODE>as</CODE> to assemble the following statements onto the end of
the text subsection numbered <VAR>subsection</VAR>, which is an absolute
expression. If <VAR>subsection</VAR> is omitted, subsection number zero
is used.
</P>
<H2><A NAME="SEC132" HREF="as_toc.html#TOC132"><CODE>.title "<VAR>heading</VAR>"</CODE></A></H2>
<P>
<A NAME="IDX402"></A>
<A NAME="IDX403"></A>
Use <VAR>heading</VAR> as the title (second line, immediately after the
source file name and pagenumber) when generating assembly listings.
</P>
<P>
This directive affects subsequent pages, as well as the current page if
it appears within ten lines of the top of a page.
</P>
<H2><A NAME="SEC133" HREF="as_toc.html#TOC133"><CODE>.type <VAR>int</VAR></CODE></A></H2>
<P>
<A NAME="IDX404"></A>
<A NAME="IDX405"></A>
<A NAME="IDX406"></A>
This directive, permitted only within <CODE>.def</CODE>/<CODE>.endef</CODE> pairs,
records the integer <VAR>int</VAR> as the type attribute of a symbol table entry.
</P>
<P>
<SAMP>`.type'</SAMP> is associated only with COFF format output; when
<CODE>as</CODE> is configured for <CODE>b.out</CODE> output, it accepts this
directive but ignores it.
</P>
<H2><A NAME="SEC134" HREF="as_toc.html#TOC134"><CODE>.val <VAR>addr</VAR></CODE></A></H2>
<P>
<A NAME="IDX407"></A>
<A NAME="IDX408"></A>
<A NAME="IDX409"></A>
This directive, permitted only within <CODE>.def</CODE>/<CODE>.endef</CODE> pairs,
records the address <VAR>addr</VAR> as the value attribute of a symbol table
entry.
</P>
<P>
<SAMP>`.val'</SAMP> is used only for COFF output; when <CODE>as</CODE> is
configured for <CODE>b.out</CODE>, it accepts this directive but ignores it.
</P>
<H2><A NAME="SEC135" HREF="as_toc.html#TOC135"><CODE>.uleb128 <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX410"></A>
<VAR>uleb128</VAR> stands for "unsigned little endian base 128." This is a
compact, variable length representation of numbers used by the DWARF
symbolic debugging format. See section <A HREF="as_7.html#SEC124"><CODE>.sleb128 <VAR>expressions</CODE></VAR></A>.
</P>
<H2><A NAME="SEC136" HREF="as_toc.html#TOC136"><CODE>.word <VAR>expressions</VAR></CODE></A></H2>
<P>
<A NAME="IDX411"></A>
This directive expects zero or more <VAR>expressions</VAR>, of any section,
separated by commas.
</P>
<P>
The size of the number emitted, and its byte order,
depend on what target computer the assembly is for.
</P>
<P>
<A NAME="IDX412"></A>
<A NAME="IDX413"></A>
<BLOCKQUOTE>
<P>
<EM>Warning: Special Treatment to support Compilers</EM>
</BLOCKQUOTE>
<P>
Machines with a 32-bit address space, but that do less than 32-bit
addressing, require the following special treatment. If the machine of
interest to you does 32-bit addressing (or doesn't require it;
see section <A HREF="as_8.html#SEC138">Machine Dependent Features</A>), you can ignore this issue.
</P>
<P>
In order to assemble compiler output into something that works,
<CODE>as</CODE> occasionlly does strange things to <SAMP>`.word'</SAMP> directives.
Directives of the form <SAMP>`.word sym1-sym2'</SAMP> are often emitted by
compilers as part of jump tables. Therefore, when <CODE>as</CODE> assembles a
directive of the form <SAMP>`.word sym1-sym2'</SAMP>, and the difference between
<CODE>sym1</CODE> and <CODE>sym2</CODE> does not fit in 16 bits, <CODE>as</CODE>
creates a <EM>secondary jump table</EM>, immediately before the next label.
This secondary jump table is preceded by a short-jump to the
first byte after the secondary table. This short-jump prevents the flow
of control from accidentally falling into the new table. Inside the
table is a long-jump to <CODE>sym2</CODE>. The original <SAMP>`.word'</SAMP>
contains <CODE>sym1</CODE> minus the address of the long-jump to
<CODE>sym2</CODE>.
</P>
<P>
If there were several occurrences of <SAMP>`.word sym1-sym2'</SAMP> before the
secondary jump table, all of them are adjusted. If there was a
<SAMP>`.word sym3-sym4'</SAMP>, that also did not fit in sixteen bits, a
long-jump to <CODE>sym4</CODE> is included in the secondary jump table,
and the <CODE>.word</CODE> directives are adjusted to contain <CODE>sym3</CODE>
minus the address of the long-jump to <CODE>sym4</CODE>; and so on, for as many
entries in the original jump table as necessary.
</P>
<H2><A NAME="SEC137" HREF="as_toc.html#TOC137">Deprecated Directives</A></H2>
<P>
<A NAME="IDX414"></A>
<A NAME="IDX415"></A>
One day these directives won't work.
They are included for compatibility with older assemblers.
<DL COMPACT>
<DT><TT>.abort</TT>
<DD>
<DT><TT>.app-file</TT>
<DD>
<DT><TT>.line</TT>
<DD>
</DL>
<P><HR><P>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_6.html">previous</A>, <A HREF="as_8.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
</BODY>
</HTML>