| [Top] | [Contents] | [Index] | [ ? ] |
This file is a user guide to the GNU assembler as
(GNU Binutils)
version 2.24
This document is distributed under the terms of the GNU Free Documentation License. A copy of the license is included in the section entitled "GNU Free Documentation License".
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here is a brief summary of how to invoke as. For details,
see Command-Line Options.
as [-a[cdghlns][=file]] [--alternate] [-D] [--compress-debug-sections] [--nocompress-debug-sections] [--debug-prefix-map old=new] [--defsym sym=val] [-f] [-g] [--gstabs] [--gstabs+] [--gdwarf-2] [--help] [-I dir] [-J] [-K] [-L] [--listing-lhs-width=NUM] [--listing-lhs-width2=NUM] [--listing-rhs-width=NUM] [--listing-cont-lines=NUM] [--keep-locals] [-o objfile] [-R] [--reduce-memory-overheads] [--statistics] [-v] [-version] [--version] [-W] [--warn] [--fatal-warnings] [-w] [-x] [-Z] [@FILE] [--size-check=[error|warning]] [--target-help] [target-options] [--|files ...] Target H8/300 options: [-h-tick-hex] Target M32C options: [-m32c|-m16c] [-relax] [-h-tick-hex] Target RX options: [-mlittle-endian|-mbig-endian] [-m32bit-ints|-m16bit-ints] [-m32bit-doubles|-m64bit-doubles] |
@file
Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively.
-a[cdghlmns]
-ac
-ad
-ag
-ah
-al
-am
-an
-as
=file
You may combine these options; for example, use `-aln' for assembly listing without forms processing. The `=file' option, if used, must be the last one. By itself, `-a' defaults to `-ahls'.
--alternate
.altmacro.
--compress-debug-sections
--nocompress-debug-sections
-D
--debug-prefix-map old=new
--defsym sym=value
.set pseudo-op.
-f
-g
--gen-debug
--gstabs
--gstabs+
--gdwarf-2
--size-check=error
--size-check=warning
--help
--target-help
-I dir
.include directives.
-J
-K
-L
--keep-locals
--listing-lhs-width=number
--listing-lhs-width2=number
--listing-rhs-width=number
--listing-cont-lines=number
-o objfile
as objfile.
-R
Set the default size of GAS's hash tables to a prime number close to number. Increasing this value can reduce the length of time it takes the assembler to perform its tasks, at the expense of increasing the assembler's memory requirements. Similarly reducing this value can reduce the memory requirements at the expense of speed.
--reduce-memory-overheads
--statistics
--strip-local-absolute
-v
-version
as version.
--version
as version and exit.
-W
--no-warn
--fatal-warnings
--warn
-w
-x
-Z
-- | files ...
The following options are available when as is configured for an ARC processor.
-marc[5|6|7|8]
-EB | -EL
The following options are available when as is configured for the ARM processor family.
-mcpu=processor[+extension...]
-march=architecture[+extension...]
-mfpu=floating-point-format
-mfloat-abi=abi
-mthumb
-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant
-EB | -EL
-mthumb-interwork
-k
The following options are available when as is configured for the Renesas M32C and M16C processors.
-m32c
-m16c
-relax
-h-tick-hex
See the info pages for documentation of the RX-specific options.
1.1 Structure of this Manual 1.2 The GNU Assembler 1.3 Object File Formats 1.4 Command Line 1.5 Input Files 1.6 Output (Object) File 1.7 Error and Warning Messages
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This manual is intended to describe what you need to know to use
GNU as. We cover the syntax expected in source files, including
notation for symbols, constants, and expressions; the directives that
as understands; and of course how to invoke as.
This manual also describes some of the machine-dependent features of various flavors of the assembler.
On the other hand, this manual is not intended as an introduction to programming in assembly language--let alone programming in general! In a similar vein, we make no attempt to introduce the machine architecture; we do not describe the instruction set, standard mnemonics, registers or addressing modes that are standard to a particular architecture. You may want to consult the manufacturer's machine architecture manual for this information.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU as is really a family of assemblers.
If you use (or have used) the GNU assembler on one architecture, you
should find a fairly similar environment when you use it on another
architecture. Each version has much in common with the others,
including object file formats, most assembler directives (often called
pseudo-ops) and assembler syntax.
as is primarily intended to assemble the output of the
GNU C compiler gcc for use by the linker
ld. Nevertheless, we've tried to make as
assemble correctly everything that other assemblers for the same
machine would assemble.
Any exceptions are documented explicitly (see section 9. Machine Dependent Features).
This doesn't mean as always uses the same syntax as another
assembler for the same architecture; for example, we know of several
incompatible versions of 680x0 assembly language syntax.
Unlike older assemblers, as is designed to assemble a source
program in one pass of the source file. This has a subtle impact on the
.org directive (see section .org).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GNU assembler can be configured to produce several alternative
object file formats. For the most part, this does not affect how you
write assembly language programs; but directives for debugging symbols
are typically different in different file formats. See section Symbol Attributes.
On the machine specific, as can be configured to produce either
b.out or COFF format object files.
On the machine specific, as can be configured to produce either
SOM or ELF format object files.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
After the program name as, the command line may contain
options and file names. Options may appear in any order, and may be
before, after, or between file names. The order of file names is
significant.
`--' (two hyphens) by itself names the standard input file
explicitly, as one of the files for as to assemble.
Except for `--' any command line argument that begins with a
hyphen (`-') is an option. Each option changes the behavior of
as. No option changes the way another option works. An
option is a `-' followed by one or more letters; the case of
the letter is important. All options are optional.
Some options expect exactly one file name to follow them. The file name may either immediately follow the option's letter (compatible with older assemblers) or it may be the next command argument (GNU standard). These two command lines are equivalent:
as -o my-object-file.o mumble.s as -omy-object-file.o mumble.s |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
We use the phrase source program, abbreviated source, to
describe the program input to one run of as. The program may
be in one or more files; how the source is partitioned into files
doesn't change the meaning of the source.
The source program is a concatenation of the text in all the files, in the order specified.
Each time you run as it assembles exactly one source
program. The source program is made up of one or more files.
(The standard input is also a file.)
You give as a command line that has zero or more input file
names. The input files are read (from left file name to right). A
command line argument (in any position) that has no special meaning
is taken to be an input file name.
If you give as no file names it attempts to read one input file
from the as standard input, which is normally your terminal. You
may have to type ctl-D to tell as there is no more program
to assemble.
Use `--' if you need to explicitly name the standard input file in your command line.
If the source is empty, as produces a small, empty object
file.
There are two ways of locating a line in the input file (or files) and either may be used in reporting error messages. One way refers to a line number in a physical file; the other refers to a line number in a "logical" file. See section Error and Warning Messages.
Physical files are those files named in the command line given
to as.
Logical files are simply names declared explicitly by assembler
directives; they bear no relation to physical files. Logical file names help
error messages reflect the original source file, when as source
is itself synthesized from other files. as understands the
`#' directives emitted by the gcc preprocessor. See also
.file.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Every time you run as it produces an output file, which is
your assembly language program translated into numbers. This file
is the object file. Its default name is
a.out.
b.out when as is configured for the Intel 80960.
You can give it another name by using the `-o' option. Conventionally,
object file names end with `.o'. The default name is used for historical
reasons: older assemblers were capable of assembling self-contained programs
directly into a runnable program. (For some formats, this isn't currently
possible, but it can be done for the a.out format.)
The object file is meant for input to the linker ld. It contains
assembled program code, information to help ld integrate
the assembled program into a runnable file, and (optionally) symbolic
information for the debugger.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as may write warnings and error messages to the standard error
file (usually your terminal). This should not happen when a compiler
runs as automatically. Warnings report an assumption made so
that as could keep assembling a flawed program; errors report a
grave problem that stops the assembly.
Warning messages have the format
file_name:NNN:Warning Message Text |
(where NNN is a line number). If a logical file name has been given
(see section .file) it is used for the filename, otherwise the name of
the current input file is used. If a logical line number was given
(see section .line)
then it is used to calculate the number printed,
otherwise the actual line in the current source file is printed. The
message text is intended to be self explanatory (in the grand Unix
tradition).
Error messages have the format
file_name:NNN:FATAL:Error Message Text |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes command-line options available in all versions of the GNU assembler; see 9. Machine Dependent Features, for options specific to particular machine architectures.
If you are invoking as via the GNU C compiler,
you can use the `-Wa' option to pass arguments through to the assembler.
The assembler arguments must be separated from each other (and the `-Wa')
by commas. For example:
gcc -c -g -O -Wa,-alh,-L file.c |
This passes two options to the assembler: `-alh' (emit a listing to standard output with high-level and assembly source) and `-L' (retain local symbols in the symbol table).
Usually you do not need to use this `-Wa' mechanism, since many compiler command-line options are automatically passed to the assembler by the compiler. (You can call the GNU compiler driver with the `-v' option to see precisely what options it passes to each compilation pass, including the assembler.)
2.1 Enable Listings: `-a[cdghlns]' -a[cdghlns] enable listings 2.2 `--alternate' --alternate enable alternate macro syntax 2.3 `-D' -D for compatibility 2.4 Work Faster: `-f' -f to work faster 2.5 .includeSearch Path: `-I' path-I for .include search path 2.6 Difference Tables: `-K' -K for difference tables
2.7 Include Local Symbols: `-L' -L to retain local symbols 2.8 Configuring listing output: `--listing' --listing-XXX to configure listing output 2.9 Assemble in MRI Compatibility Mode: `-M' -M or --mri to assemble in MRI compatibility mode 2.10 Dependency Tracking: `--MD' --MD for dependency tracking 2.11 Name the Object File: `-o' -o to name the object file 2.12 Join Data and Text Sections: `-R' -R to join data and text sections 2.13 Display Assembly Statistics: `--statistics' --statistics to see statistics about assembly 2.14 Compatible Output: `--traditional-format' --traditional-format for compatible output 2.15 Announce Version: `-v' -v to announce version 2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings' -W, --no-warn, --warn, --fatal-warnings to control warnings 2.17 Generate Object File in Spite of Errors: `-Z' -Z to make object file even after errors
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These options enable listing output from the assembler. By itself, `-a' requests high-level, assembly, and symbols listing. You can use other letters to select specific options for the list: `-ah' requests a high-level language listing, `-al' requests an output-program assembly listing, and `-as' requests a symbol table listing. High-level listings require that a compiler debugging option like `-g' be used, and that assembly listings (`-al') be requested also.
Use the `-ag' option to print a first section with general assembly information, like as version, switches passed, or time stamp.
Use the `-ac' option to omit false conditionals from a listing. Any lines
which are not assembled because of a false .if (or .ifdef, or any
other conditional), or a true .if followed by an .else, will be
omitted from the listing.
Use the `-ad' option to omit debugging directives from the listing.
Once you have specified one of these options, you can further control
listing output and its appearance using the directives .list,
.nolist, .psize, .eject, .title, and
.sbttl.
The `-an' option turns off all forms processing.
If you do not request listing output with one of the `-a' options, the
listing-control directives have no effect.
The letters after `-a' may be combined into one option, e.g., `-aln'.
Note if the assembler source is coming from the standard input (e.g.,
because it
is being created by gcc and the `-pipe' command line switch
is being used) then the listing will not contain any comments or preprocessor
directives. This is because the listing code buffers input source lines from
stdin only after they have been preprocessed by the assembler. This reduces
memory usage and makes the code more efficient.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Begin in alternate macro mode, see .altmacro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This option has no effect whatsoever, but it is accepted to make it more
likely that scripts written for other assemblers also work with
as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`-f' should only be used when assembling programs written by a (trusted) compiler. `-f' stops the assembler from doing whitespace and comment preprocessing on the input file(s) before assembling them. See section Preprocessing.
Warning: if you use `-f' when the files actually need to be
preprocessed (if they contain comments, for example), as does
not work correctly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.include Search Path: `-I' path
Use this option to add a path to the list of directories
as searches for files specified in .include
directives (see section .include). You may use `-I' as
many times as necessary to include a variety of paths. The current
working directory is always searched first; after that, as
searches any `-I' directories in the same order as they were
specified (left to right) on the command line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as sometimes alters the code emitted for directives of the
form `.word sym1-sym2'. See section .word.
You can use the `-K' option if you want a warning issued when this
is done.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Symbols beginning with system-specific local label prefixes, typically
`.L' for ELF systems or `L' for traditional a.out systems, are
called local symbols. See section 5.3 Symbol Names. Normally you do not see
such symbols when debugging, because they are intended for the use of
programs (like compilers) that compose assembler programs, not for your
notice. Normally both as and ld discard
such symbols, so you do not normally debug with them.
This option tells as to retain those local symbols
in the object file. Usually if you do this you also tell the linker
ld to preserve those symbols.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The listing feature of the assembler can be enabled via the command line switch
`-a' (see section 2.1 Enable Listings: `-a[cdghlns]'). This feature combines the input source file(s) with a
hex dump of the corresponding locations in the output object file, and displays
them as a listing file. The format of this listing can be controlled by
directives inside the assembler source (i.e., .list (see section 7.71 .list),
.title (see section 7.112 .title "heading"), .sbttl (see section 7.95 .sbttl "subheading"),
.psize (see section 7.89 .psize lines , columns), and
.eject (see section 7.36 .eject) and also by the following switches:
--listing-lhs-width=`number'
--listing-lhs-width2=`number'
--listing-rhs-width=`number'
--listing-cont-lines=`number'
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The `-M' or `--mri' option selects MRI compatibility mode. This
changes the syntax and pseudo-op handling of as to make it
compatible with the ASM68K or the ASM960 (depending upon the
configured target) assembler from Microtec Research. The exact nature of the
MRI syntax will not be documented here; see the MRI manuals for more
information. Note in particular that the handling of macros and macro
arguments is somewhat different. The purpose of this option is to permit
assembling existing MRI assembler code using as.
The MRI compatibility is not complete. Certain operations of the MRI assembler depend upon its object file format, and can not be supported using other object file formats. Supporting these would require enhancing each object file format individually. These are:
The m68k MRI assembler supports common sections which are merged by the linker.
Other object file formats do not support this. as handles
common sections by treating them as a single common symbol. It permits local
symbols to be defined within a common section, but it can not support global
symbols, since it has no way to describe them.
The MRI assemblers support relocations against a negated section address, and relocations which combine the start addresses of two or more sections. These are not support by other object file formats.
END pseudo-op specifying start address
The MRI END pseudo-op permits the specification of a start address.
This is not supported by other object file formats. The start address may
instead be specified using the `-e' option to the linker, or in a linker
script.
IDNT, .ident and NAME pseudo-ops
The MRI IDNT, .ident and NAME pseudo-ops assign a module
name to the output file. This is not supported by other object file formats.
ORG pseudo-op
The m68k MRI ORG pseudo-op begins an absolute section at a given
address. This differs from the usual as .org pseudo-op,
which changes the location within the current section. Absolute sections are
not supported by other object file formats. The address of a section may be
assigned within a linker script.
There are some other features of the MRI assembler which are not supported by
as, typically either because they are difficult or because they
seem of little consequence. Some of these may be supported in future releases.
EBCDIC strings are not supported.
Packed binary coded decimal is not supported. This means that the DC.P
and DCB.P pseudo-ops are not supported.
FEQU pseudo-op
The m68k FEQU pseudo-op is not supported.
NOOBJ pseudo-op
The m68k NOOBJ pseudo-op is not supported.
OPT branch control options
The m68k OPT branch control options---B, BRS, BRB,
BRL, and BRW---are ignored. as automatically
relaxes all branches, whether forward or backward, to an appropriate size, so
these options serve no purpose.
OPT list control options
The following m68k OPT list control options are ignored: C,
CEX, CL, CRE, E, G, I, M,
MEX, MC, MD, X.
OPT options
The following m68k OPT options are ignored: NEST, O,
OLD, OP, P, PCO, PCR, PCS, R.
OPT D option is default
The m68k OPT D option is the default, unlike the MRI assembler.
OPT NOD may be used to turn it off.
XREF pseudo-op.
The m68k XREF pseudo-op is ignored.
.debug pseudo-op
The i960 .debug pseudo-op is not supported.
.extended pseudo-op
The i960 .extended pseudo-op is not supported.
.list pseudo-op.
The various options of the i960 .list pseudo-op are not supported.
.optimize pseudo-op
The i960 .optimize pseudo-op is not supported.
.output pseudo-op
The i960 .output pseudo-op is not supported.
.setreal pseudo-op
The i960 .setreal pseudo-op is not supported.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as can generate a dependency file for the file it creates. This
file consists of a single rule suitable for make describing the
dependencies of the main source file.
The rule is written to the file named in its argument.
This feature is used in the automatic updating of makefiles.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There is always one object file output when you run as. By
default it has the name
`a.out' (or `b.out', for Intel 960 targets only).
You use this option (which takes exactly one filename) to give the
object file a different name.
Whatever the object file is called, as overwrites any
existing file of the same name.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`-R' tells as to write the object file as if all
data-section data lives in the text section. This is only done at
the very last moment: your binary data are the same, but data
section parts are relocated differently. The data section part of
your object file is zero bytes long because all its bytes are
appended to the text section. (See section Sections and Relocation.)
When you specify `-R' it would be possible to generate shorter
address displacements (because we do not have to cross between text and
data section). We refrain from doing this simply for compatibility with
older versions of as. In future, `-R' may work this way.
When as is configured for COFF or ELF output,
this option is only useful if you use sections named `.text' and
`.data'.
`-R' is not supported for any of the HPPA targets. Using
`-R' generates a warning from as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use `--statistics' to display two statistics about the resources used by
as: the maximum amount of space allocated during the assembly
(in bytes), and the total execution time taken for the assembly (in CPU
seconds).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For some targets, the output of as is different in some ways
from the output of some existing assembler. This switch requests
as to use the traditional format instead.
For example, it disables the exception frame optimizations which
as normally does by default on gcc output.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can find out what version of as is running by including the option `-v' (which you can also spell as `-version') on the command line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as should never give a warning or error message when
assembling compiler output. But programs written by people often
cause as to give a warning that a particular assumption was
made. All such warnings are directed to the standard error file.
If you use the `-W' and `--no-warn' options, no warnings are issued.
This only affects the warning messages: it does not change any particular of
how as assembles your file. Errors, which stop the assembly,
are still reported.
If you use the `--fatal-warnings' option, as considers
files that generate warnings to be in error.
You can switch these options off again by specifying `--warn', which causes warnings to be output as usual.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as normally produces no output. If for
some reason you are interested in object file output even after
as gives an error message on your program, use the `-Z'
option. If there are any errors, as continues anyways, and
writes an object file after a final warning message of the form `n
errors, m warnings, generating bad object file.'
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes the machine-independent syntax allowed in a
source file. as syntax is similar to what many other
assemblers use; it is inspired by the BSD 4.2
assembler, except that as does not assemble Vax bit-fields.
3.1 Preprocessing 3.2 Whitespace 3.3 Comments 3.4 Symbols 3.5 Statements 3.6 Constants
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It does not do macro processing, include file handling, or
anything else you may get from your C compiler's preprocessor. You can
do include file processing with the .include directive
(see section .include). You can use the GNU C compiler driver
to get other "CPP" style preprocessing by giving the input file a
`.S' suffix. See section `Options Controlling the Kind of Output' in Using GNU CC.
Excess whitespace, comments, and character constants cannot be used in the portions of the input text that are not preprocessed.
If the first line of an input file is #NO_APP or if you use the
`-f' option, whitespace and comments are not removed from the input file.
Within an input file, you can ask for whitespace and comment removal in
specific portions of the by putting a line that says #APP before the
text that may contain whitespace or comments, and putting a line that says
#NO_APP after this text. This feature is mainly intend to support
asm statements in compilers whose output is otherwise free of comments
and whitespace.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Whitespace is one or more blanks or tabs, in any order. Whitespace is used to separate symbols, and to make programs neater for people to read. Unless within character constants (see section Character Constants), any whitespace means the same as exactly one space.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are two ways of rendering comments to as. In both
cases the comment is equivalent to one space.
Anything from `/*' through the next `*/' is a comment. This means you may not nest these comments.
/*
The only way to include a newline ('\n') in a comment
is to use this sort of comment.
*/
/* This sort of comment does not nest. */
|
Anything from a line comment character up to the next newline is considered a comment and is ignored. The line comment character is target specific, and some targets multiple comment characters. Some targets also have line comment characters that only work if they are the first character on a line. Some targets use a sequence of two characters to introduce a line comment. Some targets can also change their line comment characters depending upon command line options that have been used. For more details see the Syntax section in the documentation for individual targets.
If the line comment character is the hash sign (`#') then it still has the special ability to enable and disable preprocessing (see section 3.1 Preprocessing) and to specify logical line numbers:
To be compatible with past assemblers, lines that begin with `#' have a special interpretation. Following the `#' should be an absolute expression (see section 6. Expressions): the logical line number of the next line. Then a string (see section Strings) is allowed: if present it is a new logical file name. The rest of the line, if any, should be whitespace.
If the first non-whitespace characters on the line are not numeric, the line is ignored. (Just like a comment.)
# This is an ordinary comment.
# 42-6 "new_file_name" # New logical file name
# This is logical line # 36.
|
as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A symbol is one or more characters chosen from the set of all
letters (both upper and lower case), digits and the three characters
`_.$'.
On most machines, you can also use $ in symbol names; exceptions
are noted in 9. Machine Dependent Features.
No symbol may begin with a digit. Case is significant.
There is no length limit: all characters are significant. Symbols are
delimited by characters not in that set, or by the beginning of a file
(since the source program must end with a newline, the end of a file is
not a possible symbol delimiter). See section 5. Symbols.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A statement ends at a newline character (`\n') or a line separator character. The line separator character is target specific and described in the Syntax section of each target's documentation. Not all targets support a line separator character. The newline or line separator character is considered to be part of the preceding statement. Newlines and separators within character constants are an exception: they do not end statements.
It is an error to end any statement with end-of-file: the last character of any input file should be a newline.
An empty statement is allowed, and may include whitespace. It is ignored.
A statement begins with zero or more labels, optionally followed by a
key symbol which determines what kind of statement it is. The key
symbol determines the syntax of the rest of the statement. If the
symbol begins with a dot `.' then the statement is an assembler
directive: typically valid for any computer. If the symbol begins with
a letter the statement is an assembly language instruction: it
assembles into a machine language instruction.
Different versions of as for different computers
recognize different instructions. In fact, the same symbol may
represent a different instruction in a different computer's assembly
language.
A label is a symbol immediately followed by a colon (:).
Whitespace before a label or after a colon is permitted, but you may not
have whitespace between a label's symbol and its colon. See section 5.1 Labels.
For HPPA targets, labels need not be immediately followed by a colon, but the definition of a label must begin in column zero. This also implies that only one label may be defined on each line.
label: .directive followed by something
another_label: # This is an empty statement.
instruction operand_1, operand_2, ...
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A constant is a number, written so that its value is known by inspection, without knowing any context. Like this:
.byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value. .ascii "Ring the bell\7" # A string constant. .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum. .float 0f-314159265358979323846264338327\ 95028841971.693993751E-40 # - pi, a flonum. |
3.6.1 Character Constants 3.6.2 Number Constants
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are two kinds of character constants. A character stands for one character in one byte and its value may be used in numeric expressions. String constants (properly called string literals) are potentially many bytes and their values may not be used in arithmetic expressions.
3.6.1.1 Strings 3.6.1.2 Characters
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A string is written between double-quotes. It may contain
double-quotes or null characters. The way to get special characters
into a string is to escape these characters: precede them with
a backslash `\' character. For example `\\' represents
one backslash: the first \ is an escape which tells
as to interpret the second character literally as a backslash
(which prevents as from recognizing the second \ as an
escape character). The complete list of escapes follows.
\008 has the value 010, and \009 the value 011.
x hex-digits...
x works.
as has no
other interpretation, so as knows it is giving you the wrong
code and warns you of the fact.
Which characters are escapable, and what those escapes represent, varies widely among assemblers. The current set is what we think the BSD 4.2 assembler recognizes, and is a subset of what most C compilers recognize. If you are in doubt, do not use an escape sequence.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A single character may be written as a single quote immediately
followed by that character. The same escapes apply to characters as
to strings. So if you want to write the character backslash, you
must write '\\ where the first \ escapes the second
\. As you can see, the quote is an acute accent, not a
grave accent. A newline
(or dollar sign `$', for the H8/300; or semicolon `;' for the
Renesas SH)
immediately following an acute accent is taken as a literal character
and does not count as the end of a statement. The value of a character
constant in a numeric expression is the machine's byte-wide code for
that character. as assumes your character code is ASCII:
'A means 65, 'B means 66, and so on.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as distinguishes three kinds of numbers according to how they
are stored in the target machine. Integers are numbers that
would fit into an int in the C language. Bignums are
integers, but they are stored in more than 32 bits. Flonums
are floating point numbers, described below.
3.6.2.1 Integers 3.6.2.2 Bignums 3.6.2.3 Flonums
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A binary integer is `0b' or `0B' followed by zero or more of the binary digits `01'.
An octal integer is `0' followed by zero or more of the octal digits (`01234567').
A decimal integer starts with a non-zero digit followed by zero or more digits (`0123456789').
A hexadecimal integer is `0x' or `0X' followed by one or more hexadecimal digits chosen from `0123456789abcdefABCDEF'.
Integers have the usual values. To denote a negative integer, use the prefix operator `-' discussed under expressions (see section Prefix Operators).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A bignum has the same syntax and semantics as an integer except that the number (or its negative) takes more than 32 bits to represent in binary. The distinction is made because in some places integers are permitted while bignums are not.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A flonum represents a floating point number. The translation is
indirect: a decimal floating point number from the text is converted by
as to a generic binary floating point number of more than
sufficient precision. This generic floating point number is converted
to a particular computer's floating point format (or formats) by a
portion of as specialized to that computer.
A flonum is written by writing (in order)
as the rest of the number is a flonum.
e is recommended. Case is not important.
On the H8/300, Renesas / SuperH SH, and AMD 29K architectures, the letter must be one of the letters `DFPRSX' (in upper or lower case).
On the ARC, the letter must be one of the letters `DFRS' (in upper or lower case).
On the Intel 960 architecture, the letter must be one of the letters `DFT' (in upper or lower case).
On the HPPA architecture, the letter must be `E' (upper case only).
At least one of the integer part or the fractional part must be present. The floating point number has the usual base-10 value.
as does all processing using integers. Flonums are computed
independently of any floating point hardware in the computer running
as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.1 Background 4.2 Linker Sections 4.3 Assembler Internal Sections 4.4 Sub-Sections 4.5 bss Section
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Roughly, a section is a range of addresses, with no gaps; all data "in" those addresses is treated the same for some particular purpose. For example there may be a "read only" section.
The linker ld reads many object files (partial programs) and
combines their contents to form a runnable program. When as
emits an object file, the partial program is assumed to start at address 0.
ld assigns the final addresses for the partial program, so that
different partial programs do not overlap. This is actually an
oversimplification, but it suffices to explain how as uses
sections.
ld moves blocks of bytes of your program to their run-time
addresses. These blocks slide to their run-time addresses as rigid
units; their length does not change and neither does the order of bytes
within them. Such a rigid unit is called a section. Assigning
run-time addresses to sections is called relocation. It includes
the task of adjusting mentions of object-file addresses so they refer to
the proper run-time addresses.
For the H8/300, and for the Renesas / SuperH SH,
as pads sections if needed to
ensure they end on a word (sixteen bit) boundary.
An object file written by as has at least three sections, any
of which may be empty. These are named text, data and
bss sections.
When it generates COFF or ELF output,
as can also generate whatever other named sections you specify
using the `.section' directive (see section .section).
If you do not use any directives that place output in the `.text'
or `.data' sections, these sections still exist, but are empty.
When as generates SOM or ELF output for the HPPA,
as can also generate whatever other named sections you
specify using the `.space' and `.subspace' directives. See
HP9000 Series 800 Assembly Language Reference Manual
(HP 92432-90001) for details on the `.space' and `.subspace'
assembler directives.
Additionally, as uses different names for the standard
text, data, and bss sections when generating SOM output. Program text
is placed into the `$CODE$' section, data into `$DATA$', and
BSS into `$BSS$'.
Within the object file, the text section starts at address 0, the
data section follows, and the bss section follows the data section.
When generating either SOM or ELF output files on the HPPA, the text
section starts at address 0, the data section at address
0x4000000, and the bss section follows the data section.
To let ld know which data changes when the sections are
relocated, and how to change that data, as also writes to the
object file details of the relocation needed. To perform relocation
ld must know, each time an address in the object
file is mentioned:
(address) - (start-address of section)? |
In fact, every address as ever uses is expressed as
(section) + (offset into section) |
as computes have this section-relative
nature.
(For some object formats, such as SOM for the HPPA, some expressions are
symbol-relative instead.)
In this manual we use the notation {secname N} to mean "offset N into section secname."
Apart from text, data and bss sections you need to know about the
absolute section. When ld mixes partial programs,
addresses in the absolute section remain unchanged. For example, address
{absolute 0} is "relocated" to run-time address 0 by
ld. Although the linker never arranges two partial programs'
data sections with overlapping addresses after linking, by definition
their absolute sections must overlap. Address {absolute 239} in one
part of a program is always the same address when the program is running as
address {absolute 239} in any other part of the program.
The idea of sections is extended to the undefined section. Any address whose section is unknown at assembly time is by definition rendered {undefined U}---where U is filled in later. Since numbers are always defined, the only way to generate an undefined address is to mention an undefined symbol. A reference to a named common block would be such a symbol: its value is unknown at assembly time so it has section undefined.
By analogy the word section is used to describe groups of sections in
the linked program. ld puts all partial programs' text
sections in contiguous addresses in the linked program. It is
customary to refer to the text section of a program, meaning all
the addresses of all partial programs' text sections. Likewise for
data and bss sections.
Some sections are manipulated by ld; others are invented for
use of as and have no meaning except during assembly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ld deals with just four kinds of sections, summarized below.
as and ld treat them as
separate but equal sections. Anything you can say of one section is
true of another.
When the program is running, however, it is
customary for the text section to be unalterable. The
text section is often shared among processes: it contains
instructions, constants and the like. The data section of a running
program is usually alterable: for example, C variables would be stored
in the data section.
ld must
not change when relocating. In this sense we speak of absolute
addresses being "unrelocatable": they do not change during relocation.
An idealized example of three relocatable sections follows. The example uses the traditional section names `.text' and `.data'. Memory addresses are on the horizontal axis.
+-----+----+--+
partial program # 1: |ttttt|dddd|00|
+-----+----+--+
text data bss
seg. seg. seg.
+---+---+---+
partial program # 2: |TTT|DDD|000|
+---+---+---+
+--+---+-----+--+----+---+-----+~~
linked program: | |TTT|ttttt| |dddd|DDD|00000|
+--+---+-----+--+----+---+-----+~~
addresses: 0 ...
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These sections are meant only for the internal use of as. They
have no meaning at run-time. You do not really need to know about these
sections for most purposes; but they can be mentioned in as
warning messages, so it might be helpful to have an idea of their
meanings to as. These sections are used to permit the
value of every expression in your assembly language program to be a
section-relative address.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Assembled bytes
conventionally
fall into two sections: text and data.
You may have separate groups of
data in named sections
text or data
that you want to end up near to each other in the object file, even though they
are not contiguous in the assembler source. as allows you to
use subsections for this purpose. Within each section, there can be
numbered subsections with values from 0 to 8192. Objects assembled into the
same subsection go into the object file together with other objects in the same
subsection. For example, a compiler might want to store constants in the text
section, but might not want to have them interspersed with the program being
assembled. In this case, the compiler could issue a `.text 0' before each
section of code being output, and a `.text 1' before each group of
constants being output.
Subsections are optional. If you do not use subsections, everything goes in subsection number zero.
Each subsection is zero-padded up to a multiple of four bytes.
(Subsections may be padded a different amount on different flavors
of as.)
Subsections appear in your object file in numeric order, lowest numbered
to highest. (All this to be compatible with other people's assemblers.)
The object file contains no representation of subsections; ld and
other programs that manipulate object files see no trace of them.
They just see all your text subsections as a text section, and all your
data subsections as a data section.
To specify which subsection you want subsequent statements assembled
into, use a numeric argument to specify it, in a `.text
expression' or a `.data expression' statement.
When generating COFF output, you
can also use an extra subsection
argument with arbitrary named sections: `.section name,
expression'.
When generating ELF output, you
can also use the .subsection directive (see section 7.108 .subsection name)
to specify a subsection: `.subsection expression'.
Expression should be an absolute expression
(see section 6. Expressions). If you just say `.text' then `.text 0'
is assumed. Likewise `.data' means `.data 0'. Assembly
begins in text 0. For instance:
.text 0 # The default subsection is text 0 anyway. .ascii "This lives in the first text subsection. *" .text 1 .ascii "But this lives in the second text subsection." .data 0 .ascii "This lives in the data section," .ascii "in the first data subsection." .text 0 .ascii "This lives in the first text section," .ascii "immediately following the asterisk (*)." |
Each section has a location counter incremented by one for every byte
assembled into that section. Because subsections are merely a convenience
restricted to as there is no concept of a subsection location
counter. There is no way to directly manipulate a location counter--but the
.align directive changes it, and any label definition captures its
current value. The location counter of the section where statements are being
assembled is said to be the active location counter.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The bss section is used for local common variable storage. You may allocate address space in the bss section, but you may not dictate data to load into it before your program executes. When your program starts running, all the contents of the bss section are zeroed bytes.
The .lcomm pseudo-op defines a symbol in the bss section; see
.lcomm.
The .comm pseudo-op may be used to declare a common symbol, which is
another form of uninitialized symbol; see .comm.
When assembling for a target which supports multiple sections, such as ELF or
COFF, you may switch into the .bss section and define symbols as usual;
see .section. You may only assemble zero values into the
section. Typically the section will only contain symbol definitions and
.skip directives (see section .skip).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Symbols are a central concept: the programmer uses symbols to name things, the linker uses symbols to link, and the debugger uses symbols to debug.
Warning: as does not place symbols in the object file in
the same order they were declared. This may break some debuggers.
5.1 Labels 5.2 Giving Symbols Other Values 5.3 Symbol Names 5.4 The Special Dot Symbol 5.5 Symbol Attributes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A label is written as a symbol immediately followed by a colon `:'. The symbol then represents the current value of the active location counter, and is, for example, a suitable instruction operand. You are warned if you use the same symbol to represent two different locations: the first definition overrides any other definitions.
On the HPPA, the usual form for a label need not be immediately followed by a
colon, but instead must start in column zero. Only one label may be defined on
a single line. To work around this, the HPPA version of as also
provides a special directive .label for defining labels more flexibly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A symbol can be given an arbitrary value by writing a symbol, followed
by an equals sign `=', followed by an expression
(see section 6. Expressions). This is equivalent to using the .set
directive. See section .set. In the same way, using a double
equals sign `='`=' here represents an equivalent of the
.eqv directive. See section .eqv.
Blackfin does not support symbol assignment with `='.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Symbol names begin with a letter or with one of `._'. On most
machines, you can also use $ in symbol names; exceptions are
noted in 9. Machine Dependent Features. That character may be followed by any
string of digits, letters, dollar signs (unless otherwise noted for a
particular target machine), and underscores.
Case of letters is significant: foo is a different symbol name
than Foo.
Each symbol has exactly one name. Each name in an assembly language program refers to exactly one symbol. You may use that symbol name any number of times in a program.
A local symbol is any symbol beginning with certain local label prefixes. By default, the local label prefix is `.L' for ELF systems or `L' for traditional a.out systems, but each target may have its own set of local label prefixes. On the HPPA local symbols begin with `L$'.
Local symbols are defined and used within the assembler, but they are normally not saved in object files. Thus, they are not visible when debugging. You may use the `-L' option (see section Include Local Symbols: `-L') to retain the local symbols in the object files.
Local labels help compilers and programmers use names temporarily. They create symbols which are guaranteed to be unique over the entire scope of the input source code and which can be referred to by a simple notation. To define a local label, write a label of the form `N:' (where N represents any positive integer). To refer to the most recent previous definition of that label write `Nb', using the same number as when you defined the label. To refer to the next definition of a local label, write `Nf'---the `b' stands for "backwards" and the `f' stands for "forwards".
There is no restriction on how you can use these labels, and you can reuse them too. So that it is possible to repeatedly define the same local label (using the same number `N'), although you can only refer to the most recently defined local label of that number (for a backwards reference) or the next definition of a specific local label for a forward reference. It is also worth noting that the first 10 local labels (`0:'...`9:') are implemented in a slightly more efficient manner than the others.
Here is an example:
1: branch 1f 2: branch 1b 1: branch 2f 2: branch 1b |
Which is the equivalent of:
label_1: branch label_3 label_2: branch label_1 label_3: branch label_4 label_4: branch label_3 |
Local label names are only a notational device. They are immediately transformed into more conventional symbol names before the assembler uses them. The symbol names are stored in the symbol table, appear in error messages, and are optionally emitted to the object file. The names are constructed using these parts:
local label prefix
as and ld forget symbols
that start with the local label prefix. These labels are
used for symbols you are never intended to see. If you use the
`-L' option then as retains these symbols in the
object file. If you also instruct ld to retain these symbols,
you may use them in debugging.
number
C-B
ordinal number
So for example, the first 1: may be named .L1C-B1, and
the 44th 3: may be named .L3C-B44.
as also supports an even more local form of local labels called
dollar labels. These labels go out of scope (i.e., they become undefined) as
soon as a non-local label is defined. Thus they remain valid for only a small
region of the input source code. Normal local labels, by contrast, remain in
scope for the entire file, or until they are redefined by another occurrence of
the same local label.
Dollar labels are defined in exactly the same way as ordinary local labels, except that they have a dollar sign suffix to their numeric value, e.g., `55$:'.
They can also be distinguished from ordinary local labels by their transformed names which use ASCII character `\001' (control-A) as the magic character to distinguish them from ordinary labels. For example, the fifth definition of `6$' may be named `.L6C-A5'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The special symbol `.' refers to the current address that
as is assembling into. Thus, the expression `melvin:
.long .' defines melvin to contain its own address.
Assigning a value to . is treated the same as a .org
directive.
Thus, the expression `.=.+4' is the same as saying
`.space 4'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Every symbol has, as well as its name, the attributes "Value" and "Type". Depending on output format, symbols can also have auxiliary attributes.
If you use a symbol without defining it, as assumes zero for
all these attributes, and probably won't warn you. This makes the
symbol an externally defined symbol, which is generally what you
would want.
5.5.1 Value 5.5.2 Type 5.5.3 Symbol Attributes: a.out5.5.4 Symbol Attributes for COFF 5.5.5 Symbol Attributes for SOM
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The value of a symbol is (usually) 32 bits. For a symbol which labels a
location in the text, data, bss or absolute sections the value is the
number of addresses from the start of that section to the label.
Naturally for text, data and bss sections the value of a symbol changes
as ld changes section base addresses during linking. Absolute
symbols' values do not change during linking: that is why they are
called absolute.
The value of an undefined symbol is treated in a special way. If it is
0 then the symbol is not defined in this assembler source file, and
ld tries to determine its value from other files linked into the
same program. You make this kind of symbol simply by mentioning a symbol
name without defining it. A non-zero value represents a .comm
common declaration. The value is how much common storage to reserve, in
bytes (addresses). The symbol refers to the first address of the
allocated storage.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The type attribute of a symbol contains relocation (section) information, any flag settings indicating that a symbol is external, and (optionally), other information for linkers and debuggers. The exact format depends on the object-code output format in use.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a.out
5.5.3.1 Descriptor 5.5.3.2 Other
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is an arbitrary 16-bit value. You may establish a symbol's
descriptor value by using a .desc statement
(see section .desc). A descriptor value means nothing to
as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is an arbitrary 8-bit value. It means nothing to as.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The COFF format supports a multitude of auxiliary symbol attributes;
like the primary symbol attributes, they are set between .def and
.endef directives.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The symbol name is set with .def; the value and type,
respectively, with .val and .type.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The as directives .dim, .line, .scl,
.size, .tag, and .weak can generate auxiliary symbol
table information for COFF.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The SOM format for the HPPA supports a multitude of symbol attributes set with
the .EXPORT and .IMPORT directives.
The attributes are described in HP9000 Series 800 Assembly
Language Reference Manual (HP 92432-90001) under the IMPORT and
EXPORT assembler directive documentation.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An expression specifies an address or numeric value. Whitespace may precede and/or follow an expression.
The result of an expression must be an absolute number, or else an offset into
a particular section. If an expression is not absolute, and there is not
enough information when as sees the expression to know its
section, a second pass over the source program might be necessary to interpret
the expression--but the second pass is currently not implemented.
as aborts with an error message in this situation.
6.1 Empty Expressions 6.2 Integer Expressions
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An empty expression has no value: it is just whitespace or null.
Wherever an absolute expression is required, you may omit the
expression, and as assumes a value of (absolute) 0. This
is compatible with other assemblers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An integer expression is one or more arguments delimited by operators.
6.2.1 Arguments 6.2.2 Operators 6.2.3 Prefix Operator Prefix Operators 6.2.4 Infix Operators
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Arguments are symbols, numbers or subexpressions. In other contexts arguments are sometimes called "arithmetic operands". In this manual, to avoid confusing them with the "instruction operands" of the machine language, we use the term "argument" to refer to parts of expressions only, reserving the word "operand" to refer only to machine instruction operands.
Symbols are evaluated to yield {section NNN} where section is one of text, data, bss, absolute, or undefined. NNN is a signed, 2's complement 32 bit integer.
Numbers are usually integers.
A number can be a flonum or bignum. In this case, you are warned
that only the low order 32 bits are used, and as pretends
these 32 bits are an integer. You may write integer-manipulating
instructions that act on exotic constants, compatible with other
assemblers.
Subexpressions are a left parenthesis `(' followed by an integer expression, followed by a right parenthesis `)'; or a prefix operator followed by an argument.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Operators are arithmetic functions, like + or %. Prefix
operators are followed by an argument. Infix operators appear
between their arguments. Operators may be preceded and/or followed by
whitespace.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as has the following prefix operators. They each take
one argument, which must be absolute.
-
~
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Infix operators take two arguments, one on either side. Operators
have precedence, but operations with equal precedence are performed left
to right. Apart from + or `-', both arguments must be
absolute, and the result is absolute.
*
/
%
<<
>>
|
Bitwise Inclusive Or.
&
^
!
+
-
==
<>
!=
<
>
>=
<=
The comparison operators can be used as infix operators. A true results has a value of -1 whereas a false result has a value of 0. Note, these operators perform signed comparisons.
&&
||
These two logical operations can be used to combine the results of sub expressions. Note, unlike the comparison operators a true result returns a value of 1 but a false results does still return 0. Also note that the logical or operator has a slightly lower precedence than logical and.
In short, it's only meaningful to add or subtract the offsets in an address; you can only have a defined section in one of the two arguments.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
All assembler directives have names that begin with a period (`.'). The rest of the name is letters, usually in lower case.
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 9. Machine Dependent Features.
7.1 .abort7.2 .ABORT(COFF).ABORT
7.3 .align abs-expr, abs-expr, abs-expr.align abs-expr , abs-expr7.4 .altmacro7.5 .ascii "string"...7.6 .asciz "string"...7.7 .balign[wl] abs-expr, abs-expr, abs-expr.balign abs-expr , abs-expr7.8 .byte expressions7.9 .cfi_sections section_list.cfi_startproc [simple],.cfi_endproc, etc.7.30 .comm symbol , length7.31 .data subsection7.32 .def name7.33 .desc symbol, abs-expression7.34 .dim
7.35 .double flonums7.36 .eject7.37 .else7.38 .elseif7.39 .end7.40 .endef
7.58 .hword expressions7.59 .ident7.60 .if absolute expression7.61 .incbin "file"[,skip[,count]]7.62 .include "file"7.63 .int expressions7.64 .internal names
7.65 .irp symbol,values...7.66 .irpc symbol,values...7.67 .lcomm symbol , length7.68 .lflags7.69 .line line-number
7.70 .linkonce [type]7.71 .list7.72 .ln line-number7.73 .loc fileno lineno [column] [options].loc fileno lineno7.74 .loc_mark_labels enable7.75 .local names
7.76 .long expressions
7.77 .macro.macro name args...7.78 .mri val7.79 .noaltmacro7.80 .nolist7.81 .octa bignums7.82 .offset loc7.83 .org new-lc , fill7.84 .p2align[wl] abs-expr, abs-expr, abs-expr.p2align abs-expr, abs-expr, abs-expr7.85 .popsection7.86 .previous
7.87 .print string7.88 .protected names
7.89 .psize lines , columns7.90 .purgem name7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]].pushsection name
7.92 .quad bignums7.93 .reloc offset, reloc_name[, expression]7.94 .rept count7.95 .sbttl "subheading"7.96 .scl class7.97 .section name.section name[, flags]
7.98 .set symbol, expression7.99 .short expressions7.100 .single flonums7.101 .size.size [name , expression]7.102 .skip size , fill
7.103 .sleb128 expressions7.104 .space size , fill7.105 .stabd, .stabn, .stabs
7.106 .string"str",.string8"str",.string16.string "str",.string8 "str",.string16 "str",.string32 "str",.string64 "str"7.107 .struct expression7.108 .subsection name.subsection7.109 .symver.symver name,name2@nodename
7.110 .tag structname
7.111 .text subsection7.112 .title "heading"7.113 .type.type <int | name , type description>
7.114 .uleb128 expressions7.115 .val addr
7.116 .version "string"7.117 .vtable_entry table, offset7.118 .vtable_inherit child, parent
7.119 .warning "string"7.120 .weak names7.121 .weakref alias, target.weakref alias, symbol7.122 .word expressions7.123 Deprecated Directives
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.abort
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 as to
quit also. One day .abort will not be supported.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.ABORT (COFF)
When producing COFF output, as accepts this directive as a
synonym for `.abort'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.align abs-expr, abs-expr, abs-expr 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.
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.
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.
The way the required alignment is specified varies from system to system. For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32, s390, sparc, tic4x, tic80 and xtensa, the first expression is the alignment request in bytes. For example `.align 8' 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. For the tic54x, the first expression is the alignment request in words.
For other systems, including ppc, i386 using a.out format, arm and strongarm, it is the number of low-order zero bits the location counter must have after advancement. For example `.align 3' advances the location counter until it a multiple of 8. If the location counter is already a multiple of 8, no change is needed.
This inconsistency is due to the different behaviors of the various
native assemblers for these systems which GAS must emulate.
GAS also provides .balign and .p2align directives,
described later, which have a consistent behavior across all
architectures (but are specific to GAS).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.altmacro
LOCAL name [ , ... ]
LOCAL, is available. It is used to
generate a string replacement for each of the name arguments, and
replace any instances of name in each macro expansion. The
replacement string is unique in the assembly, and different for each
separate macro expansion. LOCAL allows you to write macros that
define symbols, without fear of conflict between separate macro expansions.
String delimiters
"string":
'string'
<string>
single-character string escape
Expression results as strings
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.ascii "string"...
.ascii expects zero or more string literals (see section 3.6.1.1 Strings)
separated by commas. It assembles each string (with no automatic
trailing zero byte) into consecutive addresses.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.asciz "string"...
.asciz is just like .ascii, but each string is followed by
a zero byte. The "z" in `.asciz' stands for "zero".
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.balign[wl] abs-expr, abs-expr, abs-expr 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 `.balign 8' 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.
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.
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.
The .balignw and .balignl directives are variants of the
.balign directive. The .balignw directive treats the fill
pattern as a two byte word value. The .balignl directives treats the
fill pattern as a four byte longword value. For example, .balignw
4,0x368d 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.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.byte expressions
.byte expects zero or more expressions, separated by commas.
Each expression is assembled into the next byte.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_sections section_list .cfi_sections may be used to specify whether CFI directives
should emit .eh_frame section and/or .debug_frame section.
If section_list is .eh_frame, .eh_frame is emitted,
if section_list is .debug_frame, .debug_frame is emitted.
To emit both use .eh_frame, .debug_frame. The default if this
directive is not used is .cfi_sections .eh_frame.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_startproc [simple] .cfi_startproc is used at the beginning of each function that
should have an entry in .eh_frame. It initializes some internal
data structures. Don't forget to close the function by
.cfi_endproc.
Unless .cfi_startproc is used along with parameter simple
it also emits some architecture dependent initial CFI instructions.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_endproc .cfi_endproc is used at the end of a function where it closes its
unwind entry previously opened by
.cfi_startproc, and emits it to .eh_frame.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_personality encoding [, exp] .cfi_personality defines personality routine and its encoding.
encoding must be a constant determining how the personality
should be encoded. If it is 255 (DW_EH_PE_omit), second
argument is not present, otherwise second argument should be
a constant or a symbol name. When using indirect encodings,
the symbol provided should be the location where personality
can be loaded from, not the personality routine itself.
The default after .cfi_startproc is .cfi_personality 0xff,
no personality routine.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_lsda encoding [, exp] .cfi_lsda defines LSDA and its encoding.
encoding must be a constant determining how the LSDA
should be encoded. If it is 255 (DW_EH_PE_omit), second
argument is not present, otherwise second argument should be a constant
or a symbol name. The default after .cfi_startproc is .cfi_lsda 0xff,
no LSDA.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_def_cfa register, offset .cfi_def_cfa defines a rule for computing CFA as: take
address from register and add offset to it.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_def_cfa_register register .cfi_def_cfa_register modifies a rule for computing CFA. From
now on register will be used instead of the old one. Offset
remains the same.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_def_cfa_offset offset .cfi_def_cfa_offset modifies a rule for computing CFA. Register
remains the same, but offset is new. Note that it is the
absolute offset that will be added to a defined register to compute
CFA address.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_adjust_cfa_offset offset .cfi_def_cfa_offset but offset is a relative
value that is added/substracted from the previous offset.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_offset register, offset
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_rel_offset register, offset .cfi_offset
using the known displacement of the CFA register from the CFA.
This is often easier to use, because the number will match the
code it's annotating.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_register register1, register2
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_restore register .cfi_restore says that the rule for register is now the
same as it was at the beginning of the function, after all initial
instruction added by .cfi_startproc were executed.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_undefined register
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_same_value register
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_remember_state, .cfi_remember_state,
then totally screw them up by subsequent .cfi_* directives and when
everything is hopelessly bad, use .cfi_restore_state to restore
the previous saved state.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_return_column register
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_signal_frame
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_window_save
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_escape expression[, ...]
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.cfi_val_encoded_addr register, encoding, label .cfi_personality for details on this encoding.
The usefulness of equating a register to a fixed label is probably limited to the return address register. Here, it can be useful to mark a code segment that has only one return address which is reached by a direct branch and no copy of the return address exists in memory or another register.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.comm symbol , length
.comm declares a common symbol named symbol. 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 ld does not see a
definition for the symbol--just one or more common symbols--then it will
allocate length bytes of uninitialized memory. length must be an
absolute expression. If ld 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.
When using ELF or (as a GNU extension) PE, the .comm directive takes
an optional third argument. This is the desired alignment of the symbol,
specified for ELF as a byte boundary (for example, an alignment of 16 means
that the least significant 4 bits of the address should be zero), and for PE
as a power of two (for example, an alignment of 5 means aligned to a 32-byte
boundary). The alignment must be an absolute expression, and it must be a
power of two. If ld allocates uninitialized memory for the
common symbol, it will use the alignment when placing the symbol. If no
alignment is specified, as 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 on ELF, or the default section alignment of 4 on PE(1).
The syntax for .comm differs slightly on the HPPA. The syntax is
`symbol .comm, length'; symbol is optional.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.data subsection
.data tells as to assemble the following statements onto the
end of the data subsection numbered subsection (which is an
absolute expression). If subsection is omitted, it defaults
to zero.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.def name
Begin defining debugging information for a symbol name; the
definition extends until the .endef directive is encountered.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.desc symbol, abs-expression This directive sets the descriptor of the symbol (see section 5.5 Symbol Attributes) to the low 16 bits of an absolute expression.
The `.desc' directive is not available when as is
configured for COFF output; it is only for a.out or b.out
object format. For the sake of compatibility, as accepts
it, but produces no output, when configured for COFF.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.dim
This directive is generated by compilers to include auxiliary debugging
information in the symbol table. It is only permitted inside
.def/.endef pairs.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.double flonums
.double expects zero or more flonums, separated by commas. It
assembles floating point numbers.
The exact kind of floating point numbers emitted depends on how
as is configured. See section 9. Machine Dependent Features.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.eject Force a page break at this point, when generating assembly listings.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.else
.else is part of the as support for conditional
assembly; see .if. It marks the beginning of a section
of code to be assembled if the condition for the preceding .if
was false.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.elseif
.elseif is part of the as support for conditional
assembly; see .if. It is shorthand for beginning a new
.if block that would otherwise fill the entire .else section.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.end
.end marks the end of the assembly file. as does not
process anything in the file past the .end directive.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.endef
This directive flags the end of a symbol definition begun with
.def.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.endfunc .endfunc marks the end of a function specified with .func.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.endif
.endif is part of the as support for conditional assembly;
it marks the end of a block of code that is only assembled
conditionally. See section .if.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.equ symbol, expression
This directive sets the value of symbol to expression.
It is synonymous with `.set'; see .set.
The syntax for equ on the HPPA is
`symbol .equ expression'.
The syntax for equ on the Z80 is
`symbol equ expression'.
On the Z80 it is an eror if symbol is already defined,
but the symbol is not protected from later redefinition.
Compare 7.44 .equiv symbol, expression.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.equiv symbol, expression .equiv directive is like .equ and .set, except that
the assembler will signal an error if symbol is already defined. Note a
symbol which has been referenced but not actually defined is considered to be
undefined.
Except for the contents of the error message, this is roughly equivalent to
.ifdef SYM .err .endif .equ SYM,VAL |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.eqv symbol, expression .eqv directive is like .equiv, but no attempt is made to
evaluate the expression or any part of it immediately. Instead each time
the resulting symbol is used in an expression, a snapshot of its current
value is taken.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.err as assembles a .err directive, it will print an error
message and, unless the `-Z' option was used, it will not generate an
object file. This can be used to signal an error in conditionally compiled code.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.error "string"
Similarly to .err, this directive emits an error, but you can specify a
string that will be emitted as the error message. If you don't specify the
message, it defaults to ".error directive invoked in source file".
See section Error and Warning Messages.
.error "This code has not been assembled and tested." |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.exitm .macro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.extern
.extern is accepted in the source program--for compatibility
with other assemblers--but it is ignored. as treats
all undefined symbols as external.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.fail expression
Generates an error or a warning. If the value of the expression is 500
or more, as will print a warning message. If the value is less
than 500, as will print an error message. The message will
include the value of expression. This can occasionally be useful inside
complex nested macros or conditional assembly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.file
There are two different versions of the .file directive. Targets
that support DWARF2 line number information use the DWARF2 version of
.file. Other targets use the default version.
This version of the .file directive tells as that we
are about to start a new logical file. The syntax is:
.file string |
string is the new file name. In general, the filename is
recognized whether or not it is surrounded by quotes `"'; but if you wish
to specify an empty file name, you must give the quotes--"". This
statement may go away in future: it is only recognized to be compatible with
old as programs.
When emitting DWARF2 line number information, .file assigns filenames
to the .debug_line file name table. The syntax is:
.file fileno filename |
The fileno operand should be a unique positive integer to use as the index of the entry in the table. The filename operand is a C string literal.
The detail of filename indices is exposed to the user because the filename
table is shared with the .debug_info section of the DWARF2 debugging
information, and thus the user must know the exact indices that table
entries will have.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.fill repeat , size , value
repeat, size and value are absolute expressions.
This emits repeat copies of size bytes. Repeat
may be zero or more. Size 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 repeat bytes
is taken from an 8-byte number. The highest order 4 bytes are
zero. The lowest order 4 bytes are value rendered in the
byte-order of an integer on the computer as is assembling for.
Each size bytes in a repetition is taken from the lowest order
size bytes of this number. Again, this bizarre behavior is
compatible with other people's assemblers.
size and value are optional. If the second comma and value are absent, value is assumed zero. If the first comma and following tokens are absent, size is assumed to be 1.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.float flonums
This directive assembles zero or more flonums, separated by commas. It
has the same effect as .single.
The exact kind of floating point numbers emitted depends on how
as is configured.
See section 9. Machine Dependent Features.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.func name[,label] .func emits debugging information to denote function name, and
is ignored unless the file is assembled with debugging enabled.
Only `--gstabs[+]' is currently supported.
label is the entry point of the function and if omitted name
prepended with the `leading char' is used.
`leading char' is usually _ or nothing, depending on the target.
All functions are currently defined to have void return type.
The function must be terminated with .endfunc.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.global symbol, .globl symbol
.global makes the symbol visible to ld. If you define
symbol in your partial program, its value is made available to
other partial programs that are linked with it. Otherwise,
symbol takes its attributes from a symbol of the same name
from another file linked into the same program.
Both spellings (`.globl' and `.global') are accepted, for compatibility with other assemblers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.gnu_attribute tag,value | [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.hidden names
This is one of the ELF visibility directives. The other two are
.internal (see section .internal) and
.protected (see section .protected).
This directive overrides the named symbols default visibility (which is set by
their binding: local, global or weak). The directive sets the visibility to
hidden which means that the symbols are not visible to other components.
Such symbols are always considered to be protected as well.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.hword expressions This expects zero or more expressions, and emits a 16 bit number for each.
This directive is a synonym for `.short'; depending on the target architecture, it may also be a synonym for `.word'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.ident
This directive is used by some assemblers to place tags in object files. The
behavior of this directive varies depending on the target. When using the
a.out object file format, as simply accepts the directive for
source-file compatibility with existing assemblers, but does not emit anything
for it. When using COFF, comments are emitted to the .comment or
.rdata section, depending on the target. When using ELF, comments are
emitted to the .comment section.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.if absolute expression
.if 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 absolute expression) is non-zero. The end of
the conditional section of code must be marked by .endif
(see section .endif); optionally, you may include code for the
alternative condition, flagged by .else (see section .else).
If you have several conditions to check, .elseif may be used to avoid
nesting blocks if/else within each subsequent .else block.
The following variants of .if are also supported:
.ifdef symbol
.ifb text
.ifc string1,string2
.ifeq absolute expression
.ifeqs string1,string2
.ifc. The strings must be quoted using double quotes.
.ifge absolute expression
.ifgt absolute expression
.ifle absolute expression
.iflt absolute expression
.ifnb text
.ifb, but the sense of the test is reversed: this assembles the
following section of code if the operand is non-blank (non-empty).
.ifnc string1,string2.
.ifc, but the sense of the test is reversed: this assembles the
following section of code if the two strings are not the same.
.ifndef symbol
.ifnotdef symbol
.ifne absolute expression
.if).
.ifnes string1,string2
.ifeqs, but the sense of the test is reversed: this assembles the
following section of code if the two strings are not the same.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.incbin "file"[,skip[,count]]
The incbin directive includes file verbatim at the current
location. You can control the search paths used with the `-I' command-line
option (see section Command-Line Options). Quotation marks are required
around file.
The skip argument skips a number of bytes from the start of the
file. The count argument indicates the maximum number of bytes to
read. Note that the data is not aligned in any way, so it is the user's
responsibility to make sure that proper alignment is provided both before and
after the incbin directive.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.include "file"
This directive provides a way to include supporting files at specified
points in your source program. The code from file is assembled as
if it followed the point of the .include; when the end of the
included file is reached, assembly of the original file continues. You
can control the search paths used with the `-I' command-line option
(see section Command-Line Options). Quotation marks are required
around file.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.int expressions Expect zero or more expressions, 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.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.internal names
This is one of the ELF visibility directives. The other two are
.hidden (see section .hidden) and
.protected (see section .protected).
This directive overrides the named symbols default visibility (which is set by
their binding: local, global or weak). The directive sets the visibility to
internal which means that the symbols are considered to be hidden
(i.e., not visible to other components), and that some extra, processor specific
processing must also be performed upon the symbols as well.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.irp symbol,values...
Evaluate a sequence of statements assigning different values to symbol.
The sequence of statements starts at the .irp directive, and is
terminated by an .endr directive. For each value, symbol is
set to value, and the sequence of statements is assembled. If no
value is listed, the sequence of statements is assembled once, with
symbol set to the null string. To refer to symbol within the
sequence of statements, use \symbol.
For example, assembling
.irp param,1,2,3
move d\param,sp@-
.endr
|
is equivalent to assembling
move d1,sp@-
move d2,sp@-
move d3,sp@-
|
For some caveats with the spelling of symbol, see also 7.77 .macro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.irpc symbol,values...
Evaluate a sequence of statements assigning different values to symbol.
The sequence of statements starts at the .irpc directive, and is
terminated by an .endr directive. For each character in value,
symbol is set to the character, and the sequence of statements is
assembled. If no value is listed, the sequence of statements is
assembled once, with symbol set to the null string. To refer to
symbol within the sequence of statements, use \symbol.
For example, assembling
.irpc param,123
move d\param,sp@-
.endr
|
is equivalent to assembling
move d1,sp@-
move d2,sp@-
move d3,sp@-
|
For some caveats with the spelling of symbol, see also the discussion
at See section 7.77 .macro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.lcomm symbol , length
Reserve length (an absolute expression) bytes for a local common
denoted by symbol. The section and value of symbol 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. Symbol
is not declared global (see section .global), so is normally
not visible to ld.
Some targets permit a third argument to be used with .lcomm. This
argument specifies the desired alignment of the symbol in the bss section.
The syntax for .lcomm differs slightly on the HPPA. The syntax is
`symbol .lcomm, length'; symbol is optional.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.lflags
as accepts this directive, for compatibility with other
assemblers, but ignores it.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.line line-number
Change the logical line number. line-number 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 line-number - 1. One day
as will no longer support this directive: it is recognized only
for compatibility with existing assembler programs.
Even though this is a directive associated with the a.out or
b.out object-code formats, as still recognizes it
when producing COFF output, and treats `.line' as though it
were the COFF `.ln' if it is found outside a
.def/.endef pair.
Inside a .def, `.line' is, instead, one of the directives
used by compilers to generate auxiliary symbol information for
debugging.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.linkonce [type] .linkonce 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.
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.
The type argument is optional. If specified, it must be one of the following strings. For example:
.linkonce same_size |
discard
one_only
same_size
same_contents
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.list
Control (in conjunction with the .nolist directive) whether or
not assembly listings are generated. These two directives maintain an
internal counter (which is zero initially). .list increments the
counter, and .nolist decrements it. Assembly listings are
generated whenever the counter is greater than zero.
By default, listings are disabled. When you enable them (with the `-a' command line option; see section Command-Line Options), the initial value of the listing counter is one.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.ln line-number `.ln' is a synonym for `.line'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.loc fileno lineno [column] [options] .loc directive will add a row to the .debug_line line
number matrix corresponding to the immediately following assembly
instruction. The fileno, lineno, and optional column
arguments will be applied to the .debug_line state machine before
the row is added.
The options are a sequence of the following tokens in any order:
basic_block
basic_block register in the
.debug_line state machine to true.
prologue_end
prologue_end register in the
.debug_line state machine to true.
epilogue_begin
epilogue_begin register in the
.debug_line state machine to true.
is_stmt value
is_stmt register in the
.debug_line state machine to value, which must be
either 0 or 1.
isa value
isa register in the .debug_line
state machine to value, which must be an unsigned integer.
discriminator value
discriminator register in the .debug_line
state machine to value, which must be an unsigned integer.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.loc_mark_labels enable .loc_mark_labels directive makes the assembler emit an entry
to the .debug_line line number matrix with the basic_block
register in the state machine set whenever a code label is seen.
The enable argument should be either 1 or 0, to enable or disable
this function respectively.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.local names
This directive, which is available for ELF targets, marks each symbol in
the comma-separated list of names as a local symbol so that it
will not be externally visible. If the symbols do not already exist,
they will be created.
For targets where the .lcomm directive (see section 7.67 .lcomm symbol , length) does not
accept an alignment argument, which is the case for most ELF targets,
the .local directive can be used in combination with .comm
(see section 7.30 .comm symbol , length ) to define aligned local common data.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.long expressions
.long is the same as `.int'. See section .int.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.macro
The commands .macro and .endm allow you to define macros that
generate assembly output. For example, this definition specifies a macro
sum that puts a sequence of numbers into memory:
.macro sum from=0, to=5
.long \from
.if \to-\from
sum "(\from+1)",\to
.endif
.endm
|
With that definition, `SUM 0,5' is equivalent to this assembly input:
.long 0
.long 1
.long 2
.long 3
.long 4
.long 5
|
.macro macname
.macro macname macargs ...
req'), or whether it takes all of the remaining arguments
(through `:vararg'). You can supply a default value for any
macro argument by following the name with `=deflt'. You
cannot define two macros with the same macname unless it has been
subject to the .purgem directive (see section 7.90 .purgem name) between the two
definitions. For example, these are all valid .macro statements:
.macro comm
comm, which takes no
arguments.
.macro plus1 p, p1
.macro plus1 p p1
plus1,
which takes two arguments; within the macro definition, write
`\p' or `\p1' to evaluate the arguments.
.macro reserve_str p1=0 p2
reserve_str, 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
`reserve_str a,b' (with `\p1' evaluating to
a and `\p2' evaluating to b), or as `reserve_str
,b' (with `\p1' evaluating as the default, in this case
`0', and `\p2' evaluating to b).
.macro m p1:req, p2=0, p3:vararg
m, with at least three
arguments. The first argument must always have a value specified, but
not the second, which instead has a default value. The third formal
will get assigned all remaining arguments specified at invocation time.
When you call a macro, you can specify the argument values either by position, or by keyword. For example, `sum 9,17' is equivalent to `sum to=17, from=9'.
Note that since each of the macargs can be an identifier exactly
as any other one permitted by the target architecture, there may be
occasional problems if the target hand-crafts special meanings to certain
characters when they occur in a special position. For example, if the colon
(:) is generally permitted to be part of a symbol name, but the
architecture specific code special-cases it when occurring as the final
character of a symbol (to denote a label), then the macro parameter
replacement code will have no way of knowing that and consider the whole
construct (including the colon) an identifier, and check only this
identifier for being the subject to parameter substitution. So for example
this macro definition:
.macro label l \l: .endm |
might not work as expected. Invoking `label foo' might not create a label called `foo' but instead just insert the text `\l:' into the assembler source, probably generating an error about an unrecognised identifier.
Similarly problems might occur with the period character (`.') which is often allowed inside opcode names (and hence identifier names). So for example constructing a macro to build an opcode from a base name and a length specifier like this:
.macro opcode base length
\base.\length
.endm
|
and invoking it as `opcode store l' will not create a `store.l' instruction but instead generate some kind of error as the assembler tries to interpret the text `\base.\length'.
There are several possible ways around this problem:
Insert white space
.macro label l \l : .endm |
Use `\()'
.macro opcode base length
\base\().\length
.endm
|
Use the alternate macro syntax mode
.altmacro .macro label l l&: .endm |
Note: this problem of correctly identifying string parameters to pseudo ops
also applies to the identifiers used in .irp (see section 7.65 .irp symbol,values...)
and .irpc (see section 7.66 .irpc symbol,values...) as well.
.endm
.exitm
\@
as maintains a counter of how many macros it has
executed in this pseudo-variable; you can copy that number to your
output with `\@', but only within a macro definition.
LOCAL name [ , ... ]
LOCAL is only available if you select "alternate
macro syntax" with `--alternate' or .altmacro.
See section .altmacro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.mri val
If val is non-zero, this tells as to enter MRI mode. If
val is zero, this tells as to exit MRI mode. This change
affects code assembled until the next .mri directive, or until the end
of the file. See section MRI mode.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.noaltmacro .altmacro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.nolist
Control (in conjunction with the .list directive) whether or
not assembly listings are generated. These two directives maintain an
internal counter (which is zero initially). .list increments the
counter, and .nolist decrements it. Assembly listings are
generated whenever the counter is greater than zero.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.octa bignums This directive expects zero or more bignums, separated by commas. For each bignum, it emits a 16-byte integer.
The term "octa" comes from contexts in which a "word" is two bytes; hence octa-word for 16 bytes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.offset loc
Set the location counter to loc in the absolute section. loc must
be an absolute expression. This directive may be useful for defining
symbols with absolute values. Do not confuse it with the .org
directive.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.org new-lc , fill
Advance the location counter of the current section to
new-lc. new-lc is either an absolute expression or an
expression with the same section as the current subsection. That is,
you can't use .org to cross sections: if new-lc has the
wrong section, the .org directive is ignored. To be compatible
with former assemblers, if the section of new-lc is absolute,
as issues a warning, then pretends the section of new-lc
is the same as the current subsection.
.org may only increase the location counter, or leave it
unchanged; you cannot use .org to move the location counter
backwards.
Because as tries to assemble programs in one pass, new-lc
may not be undefined. If you really detest this restriction we eagerly await
a chance to share your improved assembler.
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.
When the location counter (of the current subsection) is advanced, the intervening bytes are filled with fill which should be an absolute expression. If the comma and fill are omitted, fill defaults to zero.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.p2align[wl] abs-expr, abs-expr, abs-expr 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 `.p2align 3' advances the location counter until it a multiple of 8. If the location counter is already a multiple of 8, no change is needed.
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.
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.
The .p2alignw and .p2alignl directives are variants of the
.p2align directive. The .p2alignw directive treats the fill
pattern as a two byte word value. The .p2alignl directives treats the
fill pattern as a four byte longword value. For example, .p2alignw
2,0x368d 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.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.popsection
This is one of the ELF section stack manipulation directives. The others are
.section (see section 7.97 .section name), .subsection (see section 7.108 .subsection name),
.pushsection (see section 7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]), and .previous
(see section 7.86 .previous).
This directive replaces the current section (and subsection) with the top section (and subsection) on the section stack. This section is popped off the stack.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.previous
This is one of the ELF section stack manipulation directives. The others are
.section (see section 7.97 .section name), .subsection (see section 7.108 .subsection name),
.pushsection (see section 7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]), and .popsection
(see section 7.85 .popsection).
This directive swaps the current section (and subsection) with most recently
referenced section/subsection pair prior to this one. Multiple
.previous directives in a row will flip between two sections (and their
subsections). For example:
.section A .subsection 1 .word 0x1234 .subsection 2 .word 0x5678 .previous .word 0x9abc |
Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of section A. Whilst:
.section A .subsection 1 # Now in section A subsection 1 .word 0x1234 .section B .subsection 0 # Now in section B subsection 0 .word 0x5678 .subsection 1 # Now in section B subsection 1 .word 0x9abc .previous # Now in section B subsection 0 .word 0xdef0 |
Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of section B and 0x9abc into subsection 1 of section B.
In terms of the section stack, this directive swaps the current section with the top section on the section stack.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.print string
as will print string on the standard output during
assembly. You must put string in double quotes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.protected names
This is one of the ELF visibility directives. The other two are
.hidden (see section 7.57 .hidden names) and .internal (see section 7.64 .internal names).
This directive overrides the named symbols default visibility (which is set by
their binding: local, global or weak). The directive sets the visibility to
protected which means that any references to the symbols from within the
components that defines them must be resolved to the definition in that
component, even if a definition in another component would normally preempt
this.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.psize lines , columns Use this directive to declare the number of lines--and, optionally, the number of columns--to use for each page, when generating listings.
If you do not use .psize, listings use a default line-count
of 60. You may omit the comma and columns specification; the
default width is 200 columns.
as generates formfeeds whenever the specified number of
lines is exceeded (or whenever you explicitly request one, using
.eject).
If you specify lines as 0, no formfeeds are generated save
those explicitly specified with .eject.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.purgem name
Undefine the macro name, so that later uses of the string will not be
expanded. See section 7.77 .macro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.pushsection name [, subsection] [, "flags"[, @type[,arguments]]]
This is one of the ELF section stack manipulation directives. The others are
.section (see section 7.97 .section name), .subsection (see section 7.108 .subsection name),
.popsection (see section 7.85 .popsection), and .previous
(see section 7.86 .previous).
This directive pushes the current section (and subsection) onto the
top of the section stack, and then replaces the current section and
subsection with name and subsection. The optional
flags, type and arguments are treated the same
as in the .section (see section 7.97 .section name) directive.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.quad bignums
.quad 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.
The term "quad" comes from contexts in which a "word" is two bytes; hence quad-word for 8 bytes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.reloc offset, reloc_name[, expression] Generate a relocation at offset of type reloc_name with value expression. If offset is a number, the relocation is generated in the current section. If offset is an expression that resolves to a symbol plus offset, the relocation is generated in the given symbol's section. expression, if present, must resolve to a symbol plus addend or to an absolute value, but note that not all targets support an addend. e.g. ELF REL targets such as i386 store an addend in the section contents rather than in the relocation. This low level interface does not support addends stored in the section.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.rept count
Repeat the sequence of lines between the .rept directive and the next
.endr directive count times.
For example, assembling
.rept 3
.long 0
.endr
|
is equivalent to assembling
.long 0
.long 0
.long 0
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.sbttl "subheading" Use subheading as the title (third line, immediately after the title line) when generating assembly listings.
This directive affects subsequent pages, as well as the current page if it appears within ten lines of the top of a page.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.scl class
Set the storage-class value for a symbol. This directive may only be
used inside a .def/.endef pair. Storage class may flag
whether a symbol is static or external, or it may record further
symbolic debugging information.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.section name
Use the .section directive to assemble the following code into a section
named name.
This directive is only supported for targets that actually support arbitrarily
named sections; on a.out targets, for example, it is not accepted, even
with a standard a.out section name.
For COFF targets, the .section directive is used in one of the following
ways:
.section name[, "flags"] .section name[, subsection] |
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:
b
n
w
d
r
x
s
a
y
0-9
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. Note the n and w flags remove attributes
from the section, rather than adding them, so if they are used on their own it
will be as if no flags had been specified at all.
If the optional argument to the .section directive is not quoted, it is
taken as a subsection number (see section 4.4 Sub-Sections).
This is one of the ELF section stack manipulation directives. The others are
.subsection (see section 7.108 .subsection name), .pushsection
(see section 7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]), .popsection (see section 7.85 .popsection), and
.previous (see section 7.86 .previous).
For ELF targets, the .section directive is used like this:
.section name [, "flags"[, @type[,flag_specific_arguments]]] |
The optional flags argument is a quoted string which may contain any combination of the following characters:
a
e
w
x
M
S
G
T
?
The optional type argument may contain one of the following constants:
@progbits
@nobits
@note
@init_array
@fini_array
@preinit_array
Many targets only support the first three section types.
Note on targets where the @ character is the start of a comment (eg
ARM) then another character is used instead. For example the ARM port uses the
% character.
If flags contains the M symbol then the type argument must
be specified as well as an extra argument---entsize---like this:
.section name , "flags"M, @type, entsize |
Sections with the M flag but not S flag must contain fixed size
constants, each entsize octets long. Sections with both M and
S must contain zero terminated strings where each character is
entsize bytes long. The linker may remove duplicates within sections with
the same name, same entity size and same flags. entsize must be an
absolute expression. For sections with both M and S, a string
which is a suffix of a larger string is considered a duplicate. Thus
"def" will be merged with "abcdef"; A reference to the first
"def" will be changed to a reference to "abcdef"+3.
If flags contains the G symbol then the type argument must
be present along with an additional field like this:
.section name , "flags"G, @type, GroupName[, linkage] |
The GroupName field specifies the name of the section group to which this particular section belongs. The optional linkage field can contain:
comdat
.gnu.linkonce
Note: if both the M and G flags are present then the fields for the Merge flag should come first, like this:
.section name , "flags"MG, @type, entsize, GroupName[, linkage] |
If flags contains the ? symbol then it may not also contain the
G symbol and the GroupName or linkage fields should not be
present. Instead, ? says to consider the section that's current before
this directive. If that section used G, then the new section will use
G with those same GroupName and linkage fields implicitly.
If not, then the ? symbol has no effect.
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.
For ELF targets, the assembler supports another type of .section
directive for compatibility with the Solaris assembler:
.section "name"[, flags...] |
Note that the section name is quoted. There may be a sequence of comma separated flags:
#alloc
#write
#execinstr
#exclude
#tls
This directive replaces the current section and subsection. See the
contents of the gas testsuite directory gas/testsuite/gas/elf for
some examples of how this directive and the other section stack directives
work.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.set symbol, expression Set the value of symbol to expression. This changes symbol's value and type to conform to expression. If symbol was flagged as external, it remains flagged (see section 5.5 Symbol Attributes).
You may .set a symbol many times in the same assembly.
If you .set a global symbol, the value stored in the object
file is the last value stored into it.
On Z80 set is a real instruction, use
`symbol defl expression' instead.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.short expressions
.short is normally the same as `.word'.
See section .word.
In some configurations, however, .short and .word generate
numbers of different lengths. See section 9. Machine Dependent Features.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.single flonums
This directive assembles zero or more flonums, separated by commas. It
has the same effect as .float.
The exact kind of floating point numbers emitted depends on how
as is configured. See section 9. Machine Dependent Features.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.size This directive is used to set the size associated with a symbol.
For COFF targets, the .size directive is only permitted inside
.def/.endef pairs. It is used like this:
.size expression |
For ELF targets, the .size directive is used like this:
.size name , expression |
This directive sets the size associated with a symbol name. The size in bytes is computed from expression which can make use of label arithmetic. This directive is typically used to set the size of function symbols.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.skip size , fill This directive emits size bytes, each of value fill. Both size and fill are absolute expressions. If the comma and fill are omitted, fill is assumed to be zero. This is the same as `.space'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.sleb128 expressions
sleb128 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 .uleb128.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.space size , fill This directive emits size bytes, each of value fill. Both size and fill are absolute expressions. If the comma and fill are omitted, fill is assumed to be zero. This is the same as `.skip'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.stabd, .stabn, .stabs
There are three directives that begin `.stab'.
All emit symbols (see section 5. Symbols), for use by symbolic debuggers.
The symbols are not entered in the as hash table: they
cannot be referenced elsewhere in the source file.
Up to five fields are required:
ld
and debuggers choke on silly bit patterns.
If a warning is detected while reading a .stabd, .stabn,
or .stabs statement, the symbol has probably already been created;
you get a half-formed symbol in your object file. This is
compatible with earlier assemblers!
.stabd type , other , desc
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 .stabd was
assembled.
.stabn type , other , desc , value
"".
.stabs string , type , other , desc , value
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.string "str", .string8 "str", .string16 .string32 "str", .string64 "str"
Copy the characters in str 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 Strings.
The variants string16, string32 and string64 differ from
the string pseudo opcode in that each 8-bit character from str is
copied and expanded to 16, 32 or 64 bits respectively. The expanded characters
are stored in target endianness byte order.
Example:
.string32 "BYE" expands to: .string "B\0\0\0Y\0\0\0E\0\0\0" /* On little endian targets. */ .string "\0\0\0B\0\0\0Y\0\0\0E" /* On big endian targets. */ |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.struct expression Switch to the absolute section, and set the section offset to expression, which must be an absolute expression. You might use this as follows:
.struct 0
field1:
.struct field1 + 4
field2:
.struct field2 + 4
field3:
|
field1 to have the value 0, the symbol
field2 to have the value 4, and the symbol field3 to have the
value 8. Assembly would be left in the absolute section, and you would need to
use a .section directive of some sort to change to some other section
before further assembly.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.subsection name
This is one of the ELF section stack manipulation directives. The others are
.section (see section 7.97 .section name), .pushsection (see section 7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]),
.popsection (see section 7.85 .popsection), and .previous
(see section 7.86 .previous).
This directive replaces the current subsection with name. The current
section is not changed. The replaced subsection is put onto the section stack
in place of the then current top of stack subsection.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.symver .symver 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.
For ELF targets, the .symver directive can be used like this:
.symver name, name2@nodename |
.symver directive effectively creates a symbol
alias with the name name2@nodename, and in fact the main reason that we
just don't try and create a regular alias is that the @ character isn't
permitted in symbol names. The name2 part of the name is the actual name
of the symbol by which it will be externally referenced. The name name
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 nodename 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 nodename should correspond to the
nodename of the symbol you are trying to override.
If the symbol name is not defined within the file being assembled, all references to name will be changed to name2@nodename. If no reference to name is made, name2@nodename will be removed from the symbol table.
Another usage of the .symver directive is:
.symver name, name2@@nodename |
The third usage of the .symver directive is:
.symver name, name2@@@nodename |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.tag structname
This directive is generated by compilers to include auxiliary debugging
information in the symbol table. It is only permitted inside
.def/.endef pairs. Tags are used to link structure
definitions in the symbol table with instances of those structures.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.text subsection
Tells as to assemble the following statements onto the end of
the text subsection numbered subsection, which is an absolute
expression. If subsection is omitted, subsection number zero
is used.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.title "heading" Use heading as the title (second line, immediately after the source file name and pagenumber) when generating assembly listings.
This directive affects subsequent pages, as well as the current page if it appears within ten lines of the top of a page.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.type This directive is used to set the type of a symbol.
For COFF targets, this directive is permitted only within
.def/.endef pairs. It is used like this:
.type int |
This records the integer int as the type attribute of a symbol table entry.
For ELF targets, the .type directive is used like this:
.type name , type description |
This sets the type of symbol name to be either a function symbol or an object symbol. There are five different syntaxes supported for the type description field, in order to provide compatibility with various other assemblers.
Because some of the characters used in these syntaxes (such as `@' and `#') are comment characters for some architectures, some of the syntaxes below do not work on all architectures. The first variant will be accepted by the GNU assembler on all architectures so that variant should be used for maximum portability, if you do not need to assemble your code with other assemblers.
The syntaxes supported are:
.type <name> STT_<TYPE_IN_UPPER_CASE> .type <name>,#<type> .type <name>,@<type> .type <name>,%<type> .type <name>,"<type>" |
The types supported are:
STT_FUNC
function
STT_GNU_IFUNC
gnu_indirect_function
STT_OBJECT
object
STT_TLS
tls_object
STT_COMMON
common
STT_NOTYPE
notype
gnu_unique_object
Note: Some targets support extra types in addition to those listed above.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.uleb128 expressions
uleb128 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 .sleb128.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.val addr
This directive, permitted only within .def/.endef pairs,
records the address addr as the value attribute of a symbol table
entry.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.version "string"
This directive creates a .note section and places into it an ELF
formatted note of type NT_VERSION. The note's name is set to string.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.vtable_entry table, offset
This directive finds or creates a symbol table and creates a
VTABLE_ENTRY relocation for it with an addend of offset.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.vtable_inherit child, parent
This directive finds the symbol child and finds or creates the symbol
parent and then creates a VTABLE_INHERIT relocation for the
parent whose addend is the value of the child symbol. As a special case the
parent name of 0 is treated as referring to the *ABS* section.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.warning "string" .error
(see section .error "string"), but just emits a warning.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.weak names
This directive sets the weak attribute on the comma separated list of symbol
names. If the symbols do not already exist, they will be created.
On COFF targets other than PE, weak symbols are a GNU extension. This
directive sets the weak attribute on the comma separated list of symbol
names. If the symbols do not already exist, they will be created.
On the PE target, weak symbols are supported natively as weak aliases. When a weak symbol is created that is not an alias, GAS creates an alternate symbol to hold the default value.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.weakref alias, target This directive creates an alias to the target symbol that enables the symbol to be referenced with weak-symbol semantics, but without actually making it weak. If direct references or definitions of the symbol are present, then the symbol will not be weak, but if all references to it are through weak references, the symbol will be marked as weak in the symbol table.
The effect is equivalent to moving all references to the alias to a separate assembly source file, renaming the alias to the symbol in it, declaring the symbol as weak there, and running a reloadable link to merge the object files resulting from the assembly of the new source file and the old source file that had the references to the alias removed.
The alias itself never makes to the symbol table, and is entirely handled within the assembler.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.word expressions This directive expects zero or more expressions, of any section, separated by commas.
The size of the number emitted, and its byte order, depend on what target computer the assembly is for.
Warning: Special Treatment to support Compilers
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 9. Machine Dependent Features), you can ignore this issue.
In order to assemble compiler output into something that works,
as occasionally does strange things to `.word' directives.
Directives of the form `.word sym1-sym2' are often emitted by
compilers as part of jump tables. Therefore, when as assembles a
directive of the form `.word sym1-sym2', and the difference between
sym1 and sym2 does not fit in 16 bits, as
creates a secondary jump table, 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 sym2. The original `.word'
contains sym1 minus the address of the long-jump to
sym2.
If there were several occurrences of `.word sym1-sym2' before the
secondary jump table, all of them are adjusted. If there was a
`.word sym3-sym4', that also did not fit in sixteen bits, a
long-jump to sym4 is included in the secondary jump table,
and the .word directives are adjusted to contain sym3
minus the address of the long-jump to sym4; and so on, for as many
entries in the original jump table as necessary.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
One day these directives won't work. They are included for compatibility with older assemblers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as assembles source files written for a specific architecture
into object files for that architecture. But not all object files are alike.
Many architectures support incompatible variations. For instance, floating
point arguments might be passed in floating point registers if the object file
requires hardware floating point support--or floating point arguments might be
passed in integer registers if the object file supports processors with no
hardware floating point unit. Or, if two objects are built for different
generations of the same architecture, the combination may require the
newer generation at run-time.
This information is useful during and after linking. At link time,
ld can warn about incompatible object files. After link
time, tools like gdb can use it to process the linked file
correctly.
Compatibility information is recorded as a series of object attributes. Each attribute has a vendor, tag, and value. The vendor is a string, and indicates who sets the meaning of the tag. The tag is an integer, and indicates what property the attribute describes. The value may be a string or an integer, and indicates how the property affects this object. Missing attributes are the same as attributes with a zero value or empty string value.
Object attributes were developed as part of the ABI for the ARM Architecture. The file format is documented in ELF for the ARM Architecture.
8.1 GNU Object Attributes 8.2 Defining New Object Attributes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The .gnu_attribute directive records an object attribute
with vendor `gnu'.
Except for `Tag_compatibility', which has both an integer and a string for
its value, GNU attributes have a string value if the tag number is odd and
an integer value if the tag number is even. The second bit (tag &
2 is set for architecture-independent attributes and clear for
architecture-dependent ones.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These attributes are valid on all architectures.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you want to define a new GNU object attribute, here are the places you will need to modify. New attributes should be discussed on the `binutils' mailing list.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The machine instruction sets are (almost by definition) different on
each machine where as runs. Floating point representations
vary as well, and as often supports a few additional
directives or command-line options for compatibility with other
assemblers on a particular platform. Finally, some versions of
as support special pseudo-instructions for branch
optimization.
This chapter discusses most of these differences, though it does not include details on any machine's instruction set. For details on that subject, see the hardware manufacturer's manual.
9.1 H8/300 Dependent Features Renesas H8/300 Dependent Features 9.2 M32C Dependent Features 9.4 Renesas / SuperH SH Dependent Features 9.5 SuperH SH64 Dependent Features 9.3 RX Dependent Features 9.6 v850 Dependent Features V850 Dependent Features
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.1.1 Options 9.1.2 Syntax 9.1.3 Floating Point 9.1.4 H8/300 Machine Directives 9.1.5 Opcodes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Renesas H8/300 version of as has one
machine-dependent option:
-h-tick-hex
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.1.2.1 Special Characters 9.1.2.2 Register Names 9.1.2.3 Addressing Modes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`;' is the line comment character.
`$' can be used instead of a newline to separate statements. Therefore you may not use `$' in symbol names on the H8/300.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use predefined symbols of the form `rnh' and `rnl' to refer to the H8/300 registers as sixteen 8-bit general-purpose registers. n is a digit from `0' to `7'); for instance, both `r0h' and `r7l' are valid register names.
You can also use the eight predefined symbols `rn' to refer to the H8/300 registers as 16-bit registers (you must use this form for addressing).
On the H8/300H, you can also use the eight predefined symbols `ern' (`er0' ... `er7') to refer to the 32-bit general purpose registers.
The two control registers are called pc (program counter; a
16-bit register, except on the H8/300H where it is 24 bits) and
ccr (condition code register; an 8-bit register). r7 is
used as the stack pointer, and can also be called sp.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as understands the following addressing modes for the H8/300:
rn
@rn
@(d, rn)
@(d:16, rn)
@(d:24, rn)
@rn+
@-rn
@aa
@aa:8
@aa:16
@aa:24
aa. (The address size `:24' only makes
sense on the H8/300H.)
#xx
#xx:8
#xx:16
#xx:32
as neither
requires this nor uses it--the data size required is taken from
context.
@@aa
@@aa:8
as neither requires this nor uses it.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The H8/300 family has no hardware floating point, but the .float
directive generates IEEE floating-point numbers for compatibility
with other development tools.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as has the following machine-dependent directives for
the H8/300:
.h8300h
.int emit 32-bit numbers rather than the usual (16-bit)
for the H8/300 family.
.h8300s
.int emit 32-bit numbers rather than the usual (16-bit)
for the H8/300 family.
.h8300hn
.int emit 32-bit numbers rather than
the usual (16-bit) for the H8/300 family.
.h8300sn
.int emit 32-bit numbers rather than
the usual (16-bit) for the H8/300 family.
On the H8/300 family (including the H8/300H) `.word' directives generate 16-bit numbers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For detailed information on the H8/300 machine instruction set, see H8/300 Series Programming Manual. For information specific to the H8/300H, see H8/300H Series Programming Manual (Renesas).
as implements all the standard H8/300 opcodes. No additional
pseudo-instructions are needed on this family.
The following table summarizes the H8/300 opcodes, and their arguments. Entries marked `*' are opcodes used only on the H8/300H.
Legend:
Rs source register
Rd destination register
abs absolute address
imm immediate data
disp:N N-bit displacement from a register
pcrel:N N-bit displacement relative to program counter
add.b #imm,rd * andc #imm,ccr
add.b rs,rd band #imm,rd
add.w rs,rd band #imm,@rd
* add.w #imm,rd band #imm,@abs:8
* add.l rs,rd bra pcrel:8
* add.l #imm,rd * bra pcrel:16
adds #imm,rd bt pcrel:8
addx #imm,rd * bt pcrel:16
addx rs,rd brn pcrel:8
and.b #imm,rd * brn pcrel:16
and.b rs,rd bf pcrel:8
* and.w rs,rd * bf pcrel:16
* and.w #imm,rd bhi pcrel:8
* and.l #imm,rd * bhi pcrel:16
* and.l rs,rd bls pcrel:8
* bls pcrel:16 bld #imm,rd
bcc pcrel:8 bld #imm,@rd
* bcc pcrel:16 bld #imm,@abs:8
bhs pcrel:8 bnot #imm,rd
* bhs pcrel:16 bnot #imm,@rd
bcs pcrel:8 bnot #imm,@abs:8
* bcs pcrel:16 bnot rs,rd
blo pcrel:8 bnot rs,@rd
* blo pcrel:16 bnot rs,@abs:8
bne pcrel:8 bor #imm,rd
* bne pcrel:16 bor #imm,@rd
beq pcrel:8 bor #imm,@abs:8
* beq pcrel:16 bset #imm,rd
bvc pcrel:8 bset #imm,@rd
* bvc pcrel:16 bset #imm,@abs:8
bvs pcrel:8 bset rs,rd
* bvs pcrel:16 bset rs,@rd
bpl pcrel:8 bset rs,@abs:8
* bpl pcrel:16 bsr pcrel:8
bmi pcrel:8 bsr pcrel:16
* bmi pcrel:16 bst #imm,rd
bge pcrel:8 bst #imm,@rd
* bge pcrel:16 bst #imm,@abs:8
blt pcrel:8 btst #imm,rd
* blt pcrel:16 btst #imm,@rd
bgt pcrel:8 btst #imm,@abs:8
* bgt pcrel:16 btst rs,rd
ble pcrel:8 btst rs,@rd
* ble pcrel:16 btst rs,@abs:8
bclr #imm,rd bxor #imm,rd
bclr #imm,@rd bxor #imm,@rd
bclr #imm,@abs:8 bxor #imm,@abs:8
bclr rs,rd cmp.b #imm,rd
bclr rs,@rd cmp.b rs,rd
bclr rs,@abs:8 cmp.w rs,rd
biand #imm,rd cmp.w rs,rd
biand #imm,@rd * cmp.w #imm,rd
biand #imm,@abs:8 * cmp.l #imm,rd
bild #imm,rd * cmp.l rs,rd
bild #imm,@rd daa rs
bild #imm,@abs:8 das rs
bior #imm,rd dec.b rs
bior #imm,@rd * dec.w #imm,rd
bior #imm,@abs:8 * dec.l #imm,rd
bist #imm,rd divxu.b rs,rd
bist #imm,@rd * divxu.w rs,rd
bist #imm,@abs:8 * divxs.b rs,rd
bixor #imm,rd * divxs.w rs,rd
bixor #imm,@rd eepmov
bixor #imm,@abs:8 * eepmovw
* exts.w rd mov.w rs,@abs:16
* exts.l rd * mov.l #imm,rd
* extu.w rd * mov.l rs,rd
* extu.l rd * mov.l @rs,rd
inc rs * mov.l @(disp:16,rs),rd
* inc.w #imm,rd * mov.l @(disp:24,rs),rd
* inc.l #imm,rd * mov.l @rs+,rd
jmp @rs * mov.l @abs:16,rd
jmp abs * mov.l @abs:24,rd
jmp @@abs:8 * mov.l rs,@rd
jsr @rs * mov.l rs,@(disp:16,rd)
jsr abs * mov.l rs,@(disp:24,rd)
jsr @@abs:8 * mov.l rs,@-rd
ldc #imm,ccr * mov.l rs,@abs:16
ldc rs,ccr * mov.l rs,@abs:24
* ldc @abs:16,ccr movfpe @abs:16,rd
* ldc @abs:24,ccr movtpe rs,@abs:16
* ldc @(disp:16,rs),ccr mulxu.b rs,rd
* ldc @(disp:24,rs),ccr * mulxu.w rs,rd
* ldc @rs+,ccr * mulxs.b rs,rd
* ldc @rs,ccr * mulxs.w rs,rd
* mov.b @(disp:24,rs),rd neg.b rs
* mov.b rs,@(disp:24,rd) * neg.w rs
mov.b @abs:16,rd * neg.l rs
mov.b rs,rd nop
mov.b @abs:8,rd not.b rs
mov.b rs,@abs:8 * not.w rs
mov.b rs,rd * not.l rs
mov.b #imm,rd or.b #imm,rd
mov.b @rs,rd or.b rs,rd
mov.b @(disp:16,rs),rd * or.w #imm,rd
mov.b @rs+,rd * or.w rs,rd
mov.b @abs:8,rd * or.l #imm,rd
mov.b rs,@rd * or.l rs,rd
mov.b rs,@(disp:16,rd) orc #imm,ccr
mov.b rs,@-rd pop.w rs
mov.b rs,@abs:8 * pop.l rs
mov.w rs,@rd push.w rs
* mov.w @(disp:24,rs),rd * push.l rs
* mov.w rs,@(disp:24,rd) rotl.b rs
* mov.w @abs:24,rd * rotl.w rs
* mov.w rs,@abs:24 * rotl.l rs
mov.w rs,rd rotr.b rs
mov.w #imm,rd * rotr.w rs
mov.w @rs,rd * rotr.l rs
mov.w @(disp:16,rs),rd rotxl.b rs
mov.w @rs+,rd * rotxl.w rs
mov.w @abs:16,rd * rotxl.l rs
mov.w rs,@(disp:16,rd) rotxr.b rs
mov.w rs,@-rd * rotxr.w rs
* rotxr.l rs * stc ccr,@(disp:24,rd)
bpt * stc ccr,@-rd
rte * stc ccr,@abs:16
rts * stc ccr,@abs:24
shal.b rs sub.b rs,rd
* shal.w rs sub.w rs,rd
* shal.l rs * sub.w #imm,rd
shar.b rs * sub.l rs,rd
* shar.w rs * sub.l #imm,rd
* shar.l rs subs #imm,rd
shll.b rs subx #imm,rd
* shll.w rs subx rs,rd
* shll.l rs * trapa #imm
shlr.b rs xor #imm,rd
* shlr.w rs xor rs,rd
* shlr.l rs * xor.w #imm,rd
sleep * xor.w rs,rd
stc ccr,rd * xor.l #imm,rd
* stc ccr,@rs * xor.l rs,rd
* stc ccr,@(disp:16,rd) xorc #imm,ccr
|
Four H8/300 instructions (add, cmp, mov,
sub) are defined with variants using the suffixes `.b',
`.w', and `.l' to specify the size of a memory operand.
as supports these suffixes, but does not require them;
since one of the operands is always a register, as can
deduce the correct size.
For example, since r0 refers to a 16-bit register,
mov r0,@foo is equivalent to mov.w r0,@foo |
If you use the size suffixes, as issues a warning when
the suffix and the register size do not match.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as can assemble code for several different members of
the Renesas M32C family. Normally the default is to assemble code for
the M16C microprocessor. The -m32c option may be used to
change the default to the M32C microprocessor.
9.2.1 M32C Options 9.2.2 M32C Syntax
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as has these
machine-dependent options:
-m32c
-m16c
-relax
-h-tick-hex
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.2.2.1 Symbolic Operand Modifiers 9.2.2.2 Special Characters
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The assembler supports several modifiers when using symbol addresses in M32C instruction operands. The general syntax is the following:
%modifier(symbol) |
%dsp8
%dsp16
These modifiers override the assembler's assumptions about how big a symbol's address is. Normally, when it sees an operand like `sym[a0]' it assumes `sym' may require the widest displacement field (16 bits for `-m16c', 24 bits for `-m32c'). These modifiers tell it to assume the address will fit in an 8 or 16 bit (respectively) unsigned displacement. Note that, of course, if it doesn't actually fit you will get linker errors. Example:
mov.w %dsp8(sym)[a0],r1 mov.b #0,%dsp8(sym)[a0] |
%hi8
This modifier allows you to load bits 16 through 23 of a 24 bit address into an 8 bit register. This is useful with, for example, the M16C `smovf' instruction, which expects a 20 bit address in `r1h' and `a0'. Example:
mov.b #%hi8(sym),r1h mov.w #%lo16(sym),a0 smovf.b |
%lo16
Likewise, this modifier allows you to load bits 0 through 15 of a 24 bit address into a 16 bit register.
%hi16
This modifier allows you to load bits 16 through 31 of a 32 bit address into a 16 bit register. While the M32C family only has 24 bits of address space, it does support addresses in pairs of 16 bit registers (like `a1a0' for the `lde' instruction). This modifier is for loading the upper half in such cases. Example:
mov.w #%hi16(sym),a1 mov.w #%lo16(sym),a0 ... lde.w [a1a0],r1 |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The presence of a `;' character on a line indicates the start of a comment that extends to the end of that line.
If a `#' appears as the first character of a line, the whole line is treated as a comment, but in this case the line can also be a logical line number directive (see section 3.3 Comments) or a preprocessor control command (see section 3.1 Preprocessing).
The `|' character can be used to separate statements on the same line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.3.1 RX Options RX Assembler Command Line Options 9.3.2 Symbolic Operand Modifiers 9.3.3 Assembler Directives 9.3.4 Floating Point 9.3.5 Syntax for the RX Syntax
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Renesas RX port of as has a few target specfic
command line options:
-m32bit-doubles
-m64bit-doubles
-mbig-endian
-mlittle-endian
-muse-conventional-section-names
-muse-renesas-section-names
-msmall-data-limit
-mcpu=name
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The assembler supports several modifiers when using symbol addresses in RX instruction operands. The general syntax is the following:
%modifier(symbol) |
%gp
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The RX version of as has the following specific
assembler directives:
.3byte
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The floating point formats generated by directives are these.
.float
Single precision (32-bit) floating point constants.
.double
double directive generates double precision
(64-bit) floating point constants, otherwise it generates
single precision (32-bit) floating point constants. To force
the generation of 64-bit floating point constants used the dc.d
directive instead.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.3.5.1 Special Characters
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The presence of a `;' appearing anywhere on a line indicates the start of a comment that extends to the end of that line.
If a `#' appears as the first character of a line then the whole line is treated as a comment, but in this case the line can also be a logical line number directive (see section 3.3 Comments) or a preprocessor control command (see section 3.1 Preprocessing).
The `!' character can be used to separate statements on the same line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.4.1 Options 9.4.2 Syntax 9.4.3 Floating Point 9.4.4 SH Machine Directives 9.4.5 Opcodes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as has following command-line options for the Renesas
(formerly Hitachi) / SuperH SH family.
--little
--big
--relax
--small
--dsp
--renesas
--allow-reg-prefix
--fdpic
--isa=sh4 | sh4a
--isa=dsp
--isa=fp
--isa=all
-h-tick-hex
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.4.2.1 Special Characters 9.4.2.2 Register Names 9.4.2.3 Addressing Modes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`!' is the line comment character.
You can use `;' instead of a newline to separate statements.
If a `#' appears as the first character of a line then the whole line is treated as a comment, but in this case the line could also be a logical line number directive (see section 3.3 Comments) or a preprocessor control command (see section 3.1 Preprocessing).
Since `$' has no special meaning, you may use it in symbol names.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', `r5', `r6', `r7', `r8', `r9', `r10', `r11', `r12', `r13', `r14', and `r15' to refer to the SH registers.
The SH also has these control registers:
pr
pc
mach
macl
sr
gbr
vbr
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as understands the following addressing modes for the SH.
Rn in the following refers to any of the numbered
registers, but not the control registers.
Rn
@Rn
@-Rn
@Rn+
@(disp, Rn)
@(R0, Rn)
@(disp, GBR)
GBR offset
@(R0, GBR)
addr
@(disp, PC)
as implementation allows you to use the simpler form
addr anywhere a PC relative address is called for; the alternate
form is supported for compatibility with other assemblers.
#imm
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
SH2E, SH3E and SH4 groups have on-chip floating-point unit (FPU). Other
SH groups can use .float directive to generate IEEE
floating-point numbers.
SH2E and SH3E support single-precision floating point calculations as well as entirely PCAPI compatible emulation of double-precision floating point calculations. SH2E and SH3E instructions are a subset of the floating point calculations conforming to the IEEE754 standard.
In addition to single-precision and double-precision floating-point operation capability, the on-chip FPU of SH4 has a 128-bit graphic engine that enables 32-bit floating-point data to be processed 128 bits at a time. It also supports 4 * 4 array operations and inner product operations. Also, a superscalar architecture is employed that enables simultaneous execution of two instructions (including FPU instructions), providing performance of up to twice that of conventional architectures at the same frequency.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
uaword
ualong
as will issue a warning when a misaligned .word or
.long directive is used. You may use .uaword or
.ualong to indicate that the value is intentionally misaligned.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For detailed information on the SH machine instruction set, see SH-Microcomputer User's Manual (Renesas) or SH-4 32-bit CPU Core Architecture (SuperH) and SuperH (SH) 64-Bit RISC Series (SuperH).
as implements all the standard SH opcodes. No additional
pseudo-instructions are needed on this family. Note, however, that
because as supports a simpler form of PC-relative
addressing, you may simply write (for example)
mov.l bar,r0 |
where other assemblers might require an explicit displacement to
bar from the program counter:
mov.l @(disp, PC) |
Here is a summary of SH opcodes:
Legend: Rn a numbered register Rm another numbered register #imm immediate data disp displacement disp8 8-bit displacement disp12 12-bit displacement add #imm,Rn lds.l @Rn+,PR add Rm,Rn mac.w @Rm+,@Rn+ addc Rm,Rn mov #imm,Rn addv Rm,Rn mov Rm,Rn and #imm,R0 mov.b Rm,@(R0,Rn) and Rm,Rn mov.b Rm,@-Rn and.b #imm,@(R0,GBR) mov.b Rm,@Rn bf disp8 mov.b @(disp,Rm),R0 bra disp12 mov.b @(disp,GBR),R0 bsr disp12 mov.b @(R0,Rm),Rn bt disp8 mov.b @Rm+,Rn clrmac mov.b @Rm,Rn clrt mov.b R0,@(disp,Rm) cmp/eq #imm,R0 mov.b R0,@(disp,GBR) cmp/eq Rm,Rn mov.l Rm,@(disp,Rn) cmp/ge Rm,Rn mov.l Rm,@(R0,Rn) cmp/gt Rm,Rn mov.l Rm,@-Rn cmp/hi Rm,Rn mov.l Rm,@Rn cmp/hs Rm,Rn mov.l @(disp,Rn),Rm cmp/pl Rn mov.l @(disp,GBR),R0 cmp/pz Rn mov.l @(disp,PC),Rn cmp/str Rm,Rn mov.l @(R0,Rm),Rn div0s Rm,Rn mov.l @Rm+,Rn div0u mov.l @Rm,Rn div1 Rm,Rn mov.l R0,@(disp,GBR) exts.b Rm,Rn mov.w Rm,@(R0,Rn) exts.w Rm,Rn mov.w Rm,@-Rn extu.b Rm,Rn mov.w Rm,@Rn extu.w Rm,Rn mov.w @(disp,Rm),R0 jmp @Rn mov.w @(disp,GBR),R0 jsr @Rn mov.w @(disp,PC),Rn ldc Rn,GBR mov.w @(R0,Rm),Rn ldc Rn,SR mov.w @Rm+,Rn ldc Rn,VBR mov.w @Rm,Rn ldc.l @Rn+,GBR mov.w R0,@(disp,Rm) ldc.l @Rn+,SR mov.w R0,@(disp,GBR) ldc.l @Rn+,VBR mova @(disp,PC),R0 lds Rn,MACH movt Rn lds Rn,MACL muls Rm,Rn lds Rn,PR mulu Rm,Rn lds.l @Rn+,MACH neg Rm,Rn lds.l @Rn+,MACL negc Rm,Rn nop stc VBR,Rn not Rm,Rn stc.l GBR,@-Rn or #imm,R0 stc.l SR,@-Rn or Rm,Rn stc.l VBR,@-Rn or.b #imm,@(R0,GBR) sts MACH,Rn rotcl Rn sts MACL,Rn rotcr Rn sts PR,Rn rotl Rn sts.l MACH,@-Rn rotr Rn sts.l MACL,@-Rn rte sts.l PR,@-Rn rts sub Rm,Rn sett subc Rm,Rn shal Rn subv Rm,Rn shar Rn swap.b Rm,Rn shll Rn swap.w Rm,Rn shll16 Rn tas.b @Rn shll2 Rn trapa #imm shll8 Rn tst #imm,R0 shlr Rn tst Rm,Rn shlr16 Rn tst.b #imm,@(R0,GBR) shlr2 Rn xor #imm,R0 shlr8 Rn xor Rm,Rn sleep xor.b #imm,@(R0,GBR) stc GBR,Rn xtrct Rm,Rn stc SR,Rn |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.5.1 Options 9.5.2 Syntax 9.5.3 SH64 Machine Directives 9.5.4 Opcodes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-isa=sh4 | sh4a
-isa=dsp
-isa=fp
-isa=all
-isa=shmedia | -isa=shcompact
SHmedia specifies the
32-bit opcodes, and SHcompact specifies the 16-bit opcodes
compatible with previous SH families. The default depends on the ABI
selected; the default for the 64-bit ABI is SHmedia, and the default for
the 32-bit ABI is SHcompact. If neither the ABI nor the ISA is
specified, the default is 32-bit SHcompact.
Note that the .mode pseudo-op is not permitted if the ISA is not
specified on the command line.
-abi=32 | -abi=64
Note that the .abi pseudo-op is not permitted if the ABI is not
specified on the command line. When the ABI is specified on the command
line, any .abi pseudo-ops in the source must match it.
-shcompact-const-crange
-no-mix
-no-expand
-expand-pt32
-h-tick-hex
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.5.2.1 Special Characters 9.5.2.2 Register Names 9.5.2.3 Addressing Modes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`!' is the line comment character.
If a `#' appears as the first character of a line then the whole line is treated as a comment, but in this case the line could also be a logical line number directive (see section 3.3 Comments) or a preprocessor control command (see section 3.1 Preprocessing).
You can use `;' instead of a newline to separate statements.
Since `$' has no special meaning, you may use it in symbol names.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use the predefined symbols `r0' through `r63' to refer
to the SH64 general registers, `cr0' through cr63 for
control registers, `tr0' through `tr7' for target address
registers, `fr0' through `fr63' for single-precision floating
point registers, `dr0' through `dr62' (even numbered registers
only) for double-precision floating point registers, `fv0' through
`fv60' (multiples of four only) for single-precision floating point
vectors, `fp0' through `fp62' (even numbered registers only)
for single-precision floating point pairs, `mtrx0' through
`mtrx48' (multiples of 16 only) for 4x4 matrices of
single-precision floating point registers, `pc' for the program
counter, and `fpscr' for the floating point status and control
register.
You can also refer to the control registers by the mnemonics `sr', `ssr', `pssr', `intevt', `expevt', `pexpevt', `tra', `spc', `pspc', `resvec', `vbr', `tea', `dcr', `kcr0', `kcr1', `ctc', and `usr'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
SH64 operands consist of either a register or immediate value. The immediate value can be a constant or label reference (or portion of a label reference), as in this example:
movi 4,r2 pt function, tr4 movi (function >> 16) & 65535,r0 shori function & 65535, r0 ld.l r0,4,r0 |
Instruction label references can reference labels in either SHmedia or
SHcompact. To differentiate between the two, labels in SHmedia sections
will always have the least significant bit set (i.e. they will be odd),
which SHcompact labels will have the least significant bit reset
(i.e. they will be even). If you need to reference the actual address
of a label, you can use the datalabel modifier, as in this
example:
.long function .long datalabel function |
In that example, the first longword may or may not have the least significant bit set depending on whether the label is an SHmedia label or an SHcompact label. The second longword will be the actual address of the label, regardless of what type of label it is.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In addition to the SH directives, the SH64 provides the following directives:
.mode [shmedia|shcompact]
.isa [shmedia|shcompact]
objdump rely on symbolic
labels to determine when such mode switches occur (by checking the least
significant bit of the label's address), so such mode/isa changes should
always be followed by a label (in practice, this is true anyway). Note
that you cannot use these directives if you didn't specify an ISA on the
command line.
.abi [32|64]
.uaquad
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For detailed information on the SH64 machine instruction set, see SuperH 64 bit RISC Series Architecture Manual (SuperH, Inc.).
as implements all the standard SH64 opcodes. In
addition, the following pseudo-opcodes may be expanded into one or more
alternate opcodes:
movi
movi opcode,
as will replace the movi with a sequence of
movi and shori opcodes.
pt
movi and shori opcode,
followed by a ptrel opcode, or to a pta or ptb
opcode, depending on the label referenced.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.6.1 Options 9.6.2 Syntax 9.6.3 Floating Point 9.6.4 V850 Machine Directives 9.6.5 Opcodes
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as supports the following additional command-line options
for the V850 processor family:
-wsigned_overflow
-wunsigned_overflow
-mv850
-mv850e
-mv850e1
-mv850any
-mv850e2
-mv850e2v3
-mrelax
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.6.2.1 Special Characters 9.6.2.2 Register Names
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`#' is the line comment character. If a `#' appears as the first character of a line, the whole line is treated as a comment, but in this case the line can also be a logical line number directive (see section 3.3 Comments) or a preprocessor control command (see section 3.1 Preprocessing).
Two dashes (`--') can also be used to start a line comment.
The `;' character can be used to separate statements on the same line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as supports the following names for registers:
general register 0
general register 1
general register 2
general register 3
general register 4
general register 5
general register 6
general register 7
general register 8
general register 9
general register 10
general register 11
general register 12
general register 13
general register 14
general register 15
general register 16
general register 17
general register 18
general register 19
general register 20
general register 21
general register 22
general register 23
general register 24
general register 25
general register 26
general register 27
general register 28
general register 29
general register 30
general register 31
system register 0
system register 1
system register 2
system register 3
system register 4
system register 5
system register 16
system register 17
system register 18
system register 19
system register 20
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The V850 family uses IEEE floating-point numbers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
.offset <expression>
.section "name", <type>
.v850
.v850e
.v850e1
.v850e2
.v850e2v3
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
as implements all the standard V850 opcodes.
as also implements the following pseudo ops:
hi0()
`mulhi hi0(here - there), r5, r6'
computes the difference between the address of labels 'here' and 'there', takes the upper 16 bits of this difference, shifts it down 16 bits and then multiplies it by the lower 16 bits in register 5, putting the result into register 6.
lo()
`addi lo(here - there), r5, r6'
computes the difference between the address of labels 'here' and 'there', takes the lower 16 bits of this difference and adds it to register 5, putting the result into register 6.
hi()
`movhi hi(here), r0, r6' `movea lo(here), r6, r6'
The reason for this special behaviour is that movea performs a sign extension on its immediate operand. So for example if the address of 'here' was 0xFFFFFFFF then without the special behaviour of the hi() pseudo-op the movhi instruction would put 0xFFFF0000 into r6, then the movea instruction would takes its immediate operand, 0xFFFF, sign extend it to 32 bits, 0xFFFFFFFF, and then add it into r6 giving 0xFFFEFFFF which is wrong (the fifth nibble is E). With the hi() pseudo op adding in the top bit of the lo() pseudo op, the movhi instruction actually stores 0 into r6 (0xFFFF + 1 = 0x0000), so that the movea instruction stores 0xFFFFFFFF into r6 - the right value.
hilo()
`mov hilo(here), r6'
computes the absolute address of label 'here' and puts the result into register 6.
sdaoff()
`ld.w sdaoff(_a_variable)[gp],r6'
loads the contents of the location pointed to by the label '_a_variable' into register 6, provided that the label is located somewhere within +/- 32K of the address held in the GP register. [Note the linker assumes that the GP register contains a fixed address set to the address of the label called '__gp'. This can either be set up automatically by the linker, or specifically set by using the `--defsym __gp=<value>' command line option].
tdaoff()
`sld.w tdaoff(_a_variable)[ep],r6'
loads the contents of the location pointed to by the label '_a_variable' into register 6, provided that the label is located somewhere within +256 bytes of the address held in the EP register. [Note the linker assumes that the EP register contains a fixed address set to the address of the label called '__ep'. This can either be set up automatically by the linker, or specifically set by using the `--defsym __ep=<value>' command line option].
zdaoff()
`movea zdaoff(_a_variable),zero,r6'
puts the address of the label '_a_variable' into register 6, assuming that the label is somewhere within the first 32K of memory. (Strictly speaking it also possible to access the last 32K of memory as well, as the offsets are signed).
ctoff()
`callt ctoff(table_func1)'
will put the call the function whoes address is held in the call table at the location labeled 'table_func1'.
.longcall name
name. The linker will attempt to shorten this call
sequence if name is within a 22bit offset of the call. Only
valid if the -mrelax command line switch has been enabled.
.longjump name
name. The linker will attempt to shorten this code
sequence if name is within a 22bit offset of the jump. Only
valid if the -mrelax command line switch has been enabled.
For information on the V850 instruction set, see V850 Family 32-/16-Bit single-Chip Microcontroller Architecture Manual from NEC. Ltd.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Your bug reports play an essential role in making as reliable.
Reporting a bug may help you by bringing a solution to your problem, or it may
not. But in any case the principal function of a bug report is to help the
entire community by making the next version of as work better.
Bug reports are your contribution to the maintenance of as.
In order for a bug report to serve its purpose, you must include the information that enables us to fix the bug.
10.1 Have You Found a Bug? Have you found a bug? 10.2 How to Report Bugs How to report bugs
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you are not sure whether you have found a bug, here are some guidelines:
as bug. Reliable assemblers never crash.
as produces an error message for valid input, that is a bug.
as does not produce an error message for invalid input, that
is a bug. However, you should note that your idea of "invalid input" might
be our idea of "an extension" or "support for traditional practice".
as are welcome in any case.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A number of companies and individuals offer support for GNU products. If
you obtained as from a support organization, we recommend you
contact that organization first.
You can find contact information for many support companies and individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
In any event, we also recommend that you send bug reports for as
to http://www.sourceware.org/bugzilla/.
The fundamental principle of reporting bugs usefully is this: report all the facts. If you are not sure whether to state a fact or leave it out, state it!
Often people omit facts because they think they know what causes the problem and assume that some details do not matter. Thus, you might assume that the name of a symbol you use in an example does not matter. Well, probably it does not, but one cannot be sure. Perhaps the bug is a stray memory reference which happens to fetch from the location where that name is stored in memory; perhaps, if the name were different, the contents of that location would fool the assembler into doing the right thing despite the bug. Play it safe and give a specific, complete example. That is the easiest thing for you to do, and the most helpful.
Keep in mind that the purpose of a bug report is to enable us to fix the bug if it is new to us. Therefore, always write your bug reports on the assumption that the bug has not been reported previously.
Sometimes people give a few sketchy facts and ask, "Does this ring a bell?" This cannot help us fix a bug, so it is basically useless. We respond by asking for enough details to enable us to investigate. You might as well expedite matters by sending them to begin with.
To enable us to fix the bug, you should include all these things:
as. as announces it if you start
it with the `--version' argument.
Without this, we will not know whether there is any point in looking for
the bug in the current version of as.
as source.
as---e.g.
"gcc-2.7".
If we were to try to guess the arguments, we would probably guess wrong and then we might not encounter the bug.
gcc, use
the options `-v --save-temps'; this will save the assembler source in a
file with an extension of `.s', and also show you exactly how
as is being run.
Of course, if the bug is that as gets a fatal signal, then we
will certainly notice it. But if the bug is incorrect output, we might not
notice unless it is glaringly wrong. You might as well not give us a chance to
make a mistake.
Even if the problem you experience is a fatal signal, you should still say so
explicitly. Suppose something strange is going on, such as, your copy of
as is out of sync, or you have encountered a bug in the C
library on your system. (This has happened!) Your copy might crash and ours
would not. If you told us to expect a crash, then when ours fails to crash, we
would know that the bug was not happening for us. If you had not told us to
expect a crash, then we would not be able to draw any conclusion from our
observations.
as source, send us context
diffs, as generated by diff with the `-u', `-c', or `-p'
option. Always send diffs from the old file to the new file. If you even
discuss something in the as source, refer to it by context, not
by line number.
The line numbers in our development sources will not match those in your sources. Your line numbers would convey no useful information to us.
Here are some things that are not necessary:
Often people who encounter a bug spend a lot of time investigating which changes to the input file will make the bug go away and which changes will not affect it.
This is often time consuming and not very useful, because the way we will find the bug is by running a single example under the debugger with breakpoints, not by pure deduction from a series of examples. We recommend that you save your time for something else.
Of course, if you can find a simpler example to report instead of the original one, that is a convenience for us. Errors in the output will be easier to spot, running under the debugger will take less time, and so on.
However, simplification is not vital; if you do not want to do this, report the bug anyway and send us the entire test case you used.
A patch for the bug does help us if it is a good one. But do not omit the necessary information, such as the test case, on the assumption that a patch is all we need. We might see problems with your patch and decide to fix the problem another way, or we might not understand it at all.
Sometimes with a program as complicated as as it is very hard to
construct an example that will make the program follow a certain path through
the code. If you do not send us the example, we will not be able to construct
one, so we will not be able to verify that the bug is fixed.
And if we cannot understand what bug you are trying to fix, or why your patch should be an improvement, we will not install it. A test case will help us to understand.
Such guesses are usually wrong. Even we cannot guess right about such things without first using the debugger to find the facts.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you have contributed to GAS and your name isn't listed here,
it is not meant as a slight. We just don't know about it. Send mail to the
maintainer, and we'll correct the situation. Currently
the maintainer is Ken Raeburn (email address raeburn@cygnus.com).
Dean Elsner wrote the original GNU assembler for the VAX.(2)
Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug information and the 68k series machines, most of the preprocessing pass, and extensive changes in `messages.c', `input-file.c', `write.c'.
K. Richard Pixley maintained GAS for a while, adding various enhancements and many bug fixes, including merging support for several processors, breaking GAS up to handle multiple object file format back ends (including heavy rewrite, testing, an integration of the coff and b.out back ends), adding configuration including heavy testing and verification of cross assemblers and file splits and renaming, converted GAS to strictly ANSI C including full prototypes, added support for m680[34]0 and cpu32, did considerable work on i960 including a COFF port (including considerable amounts of reverse engineering), a SPARC opcode file rewrite, DECstation, rs6000, and hp300hpux host ports, updated "know" assertions and made them work, much other reorganization, cleanup, and lint.
Ken Raeburn wrote the high-level BFD interface code to replace most of the code in format-specific I/O modules.
The original VMS support was contributed by David L. Kashtan. Eric Youngdale has done much work with it since.
The Intel 80386 machine description was written by Eliot Dresselhaus.
Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
The Motorola 88k machine description was contributed by Devon Bowen of Buffalo University and Torbjorn Granlund of the Swedish Institute of Computer Science.
Keith Knowles at the Open Software Foundation wrote the original MIPS back end (`tc-mips.c', `tc-mips.h'), and contributed Rose format support (which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to support a.out format.
Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k, tc-h8300), and IEEE 695 object file format (obj-ieee), was written by Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to use BFD for some low-level operations, for use with the H8/300 and AMD 29k targets.
John Gilmore built the AMD 29000 support, added .include support, and
simplified the configuration of which versions accept which directives. He
updated the 68k machine description so that Motorola's opcodes always produced
fixed-size instructions (e.g., jsr), while synthetic instructions
remained shrinkable (jbsr). John fixed many bugs, including true tested
cross-compilation support, and one bug in relaxation that took a week and
required the proverbial one-bit fix.
Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the 68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix), added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and PowerPC assembler, and made a few other minor patches.
Steve Chamberlain made GAS able to generate listings.
Hewlett-Packard contributed support for the HP9000/300.
Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM) along with a fairly extensive HPPA testsuite (for both SOM and ELF object formats). This work was supported by both the Center for Software Science at the University of Utah and Cygnus Support.
Support for ELF format files has been worked on by Mark Eichin of Cygnus Support (original, incomplete implementation for SPARC), Pete Hoogenboom and Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc, and some initial 64-bit support).
Linas Vepstas added GAS support for the ESA/390 "IBM 370" architecture.
Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD support for openVMS/Alpha.
Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic* flavors.
David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica, Inc. added support for Xtensa processors.
Several engineers at Cygnus Support have also provided many small bug fixes and configuration enhancements.
Jon Beniston added support for the Lattice Mico32 architecture.
Many others have contributed large or small bugfixes and enhancements. If you have contributed significant work and are not mentioned on this list, and want to be, let us know. Some of the history has been lost; we are not intentionally leaving anyone out.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. http://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. |
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
The "publisher" means any person or entity that distributes copies of the Document to the public.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements."
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document.
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site.
"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.
"Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document.
An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (C) year your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. |
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this:
with the Invariant Sections being list their titles, with
the Front-Cover Texts being list, and with the Back-Cover Texts
being list.
|
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| Jump to: | #
$
-
.
:
\
A B C D E F G H I J L M N O P Q R S T U V W Z |
|---|
| Jump to: | #
$
-
.
:
\
A B C D E F G H I J L M N O P Q R S T U V W Z |
|---|
| [Top] | [Contents] | [Index] | [ ? ] |
This
is not the same as the executable image file alignment controlled by ld's
`--section-alignment' option; image file sections in PE are aligned to
multiples of 4096, which is far too large an alignment for ordinary variables.
It is rather the default alignment for (non-debug) sections within object
(`*.o') files, which are less strictly aligned.
Any more details?
| [Top] | [Contents] | [Index] | [ ? ] |
.include Search Path: `-I' path
a.out
.abort
.ABORT (COFF)
.align abs-expr, abs-expr, abs-expr
.altmacro
.ascii "string"...
.asciz "string"...
.balign[wl] abs-expr, abs-expr, abs-expr
.byte expressions
.cfi_sections section_list
.cfi_startproc [simple]
.cfi_endproc
.cfi_personality encoding [, exp]
.cfi_lsda encoding [, exp]
.cfi_def_cfa register, offset
.cfi_def_cfa_register register
.cfi_def_cfa_offset offset
.cfi_adjust_cfa_offset offset
.cfi_offset register, offset
.cfi_rel_offset register, offset
.cfi_register register1, register2
.cfi_restore register
.cfi_undefined register
.cfi_same_value register
.cfi_remember_state,
.cfi_return_column register
.cfi_signal_frame
.cfi_window_save
.cfi_escape expression[, ...]
.cfi_val_encoded_addr register, encoding, label
.comm symbol , length
.data subsection
.def name
.desc symbol, abs-expression
.dim
.double flonums
.eject
.else
.elseif
.end
.endef
.endfunc
.endif
.equ symbol, expression
.equiv symbol, expression
.eqv symbol, expression
.err
.error "string"
.exitm
.extern
.fail expression
.file
.fill repeat , size , value
.float flonums
.func name[,label]
.global symbol, .globl symbol
.gnu_attribute tag,value
.hidden names
.hword expressions
.ident
.if absolute expression
.incbin "file"[,skip[,count]]
.include "file"
.int expressions
.internal names
.irp symbol,values...
.irpc symbol,values...
.lcomm symbol , length
.lflags
.line line-number
.linkonce [type]
.list
.ln line-number
.loc fileno lineno [column] [options]
.loc_mark_labels enable
.local names
.long expressions
.macro
.mri val
.noaltmacro
.nolist
.octa bignums
.offset loc
.org new-lc , fill
.p2align[wl] abs-expr, abs-expr, abs-expr
.popsection
.previous
.print string
.protected names
.psize lines , columns
.purgem name
.pushsection name [, subsection] [, "flags"[, @type[,arguments]]]
.quad bignums
.reloc offset, reloc_name[, expression]
.rept count
.sbttl "subheading"
.scl class
.section name
.set symbol, expression
.short expressions
.single flonums
.size
.skip size , fill
.sleb128 expressions
.space size , fill
.stabd, .stabn, .stabs
.string "str", .string8 "str", .string16
.struct expression
.subsection name
.symver
.tag structname
.text subsection
.title "heading"
.type
.uleb128 expressions
.val addr
.version "string"
.vtable_entry table, offset
.vtable_inherit child, parent
.warning "string"
.weak names
.weakref alias, target
.word expressions
| [Top] | [Contents] | [Index] | [ ? ] |
1. Overview
2. Command-Line Options
3. Syntax
4. Sections and Relocation
5. Symbols
6. Expressions
7. Assembler Directives
8. Object Attributes
9. Machine Dependent Features
10. Reporting Bugs
11. Acknowledgements
A. GNU Free Documentation License
AS Index
| [Top] | [Contents] | [Index] | [ ? ] |
| Button | Name | Go to | From 1.2.3 go to |
|---|---|---|---|
| [ < ] | Back | previous section in reading order | 1.2.2 |
| [ > ] | Forward | next section in reading order | 1.2.4 |
| [ << ] | FastBack | previous or up-and-previous section | 1.1 |
| [ Up ] | Up | up section | 1.2 |
| [ >> ] | FastForward | next or up-and-next section | 1.3 |
| [Top] | Top | cover (top) of document | |
| [Contents] | Contents | table of contents | |
| [Index] | Index | concept index | |
| [ ? ] | About | this page |