[Top] [Contents] [Index] [ ? ]

Using as

This file is a user guide to the GNU assembler as (GNU Binutils) version 2.23.20140402.

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".

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  Who Did What
A. GNU Free Documentation License  
AS Index  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Overview

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
Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed.

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]
Turn on listings, in any of a variety of ways:

-ac
omit false conditionals

-ad
omit debugging directives

-ag
include general information, like as version and options passed

-ah
include high-level source

-al
include assembly

-am
include macro expansions

-an
omit forms processing

-as
include symbols

=file
set the name of the listing 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
Begin in alternate macro mode. See section .altmacro.

--compress-debug-sections
Compress DWARF debug sections using zlib. The debug sections are renamed to begin with `.zdebug', and the resulting object file may not be compatible with older linkers and object file utilities.

--nocompress-debug-sections
Do not compress DWARF debug sections. This is the default.

-D
Ignored. This option is accepted for script compatibility with calls to other assemblers.

--debug-prefix-map old=new
When assembling files in directory `old', record debugging information describing them as in `new' instead.

--defsym sym=value
Define the symbol sym to be value before assembling the input file. value must be an integer constant. As in C, a leading `0x' indicates a hexadecimal value, and a leading `0' indicates an octal value. The value of the symbol can be overridden inside a source file via the use of a .set pseudo-op.

-f
"fast"---skip whitespace and comment preprocessing (assume source is compiler output).

-g
--gen-debug
Generate debugging information for each assembler source line using whichever debug format is preferred by the target. This currently means either STABS, ECOFF or DWARF2.

--gstabs
Generate stabs debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it.

--gstabs+
Generate stabs debugging information for each assembler line, with GNU extensions that probably only gdb can handle, and that could make other debuggers crash or refuse to read your program. This may help debugging assembler code. Currently the only GNU extension is the location of the current working directory at assembling time.

--gdwarf-2
Generate DWARF2 debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it. Note--this option is only supported by some targets, not all of them.

--size-check=error
--size-check=warning
Issue an error or warning for invalid ELF .size directive.

--help
Print a summary of the command line options and exit.

--target-help
Print a summary of all target specific options and exit.

-I dir
Add directory dir to the search list for .include directives.

-J
Don't warn about signed overflow.

-K
Issue warnings when difference tables altered for long displacements.

-L
--keep-locals
Keep (in the symbol table) local symbols. These symbols start with system-specific local label prefixes, typically `.L' for ELF systems or `L' for traditional a.out systems. See section 5.3 Symbol Names.

--listing-lhs-width=number
Set the maximum width, in words, of the output data column for an assembler listing to number.

--listing-lhs-width2=number
Set the maximum width, in words, of the output data column for continuation lines in an assembler listing to number.

--listing-rhs-width=number
Set the maximum width of an input source line, as displayed in a listing, to number bytes.

--listing-cont-lines=number
Set the maximum number of lines printed in a listing for a single line of input to number + 1.

-o objfile
Name the object-file output from as objfile.

-R
Fold the data section into the text section.

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
This option reduces GAS's memory requirements, at the expense of making the assembly processes slower. Currently this switch is a synonym for `--hash-size=4051', but in the future it may have other effects as well.

--statistics
Print the maximum space (in bytes) and total time (in seconds) used by assembly.

--strip-local-absolute
Remove local absolute symbols from the outgoing symbol table.

-v
-version
Print the as version.

--version
Print the as version and exit.

-W
--no-warn
Suppress warning messages.

--fatal-warnings
Treat warnings as errors.

--warn
Don't suppress warning messages or treat them as errors.

-w
Ignored.

-x
Ignored.

-Z
Generate an object file even after errors.

-- | files ...
Standard input, or source files to assemble.

The following options are available when as is configured for an ARC processor.

-marc[5|6|7|8]
This option selects the core processor variant.
-EB | -EL
Select either big-endian (-EB) or little-endian (-EL) output.

The following options are available when as is configured for the ARM processor family.

-mcpu=processor[+extension...]
Specify which ARM processor variant is the target.
-march=architecture[+extension...]
Specify which ARM architecture variant is used by the target.
-mfpu=floating-point-format
Select which Floating Point architecture is the target.
-mfloat-abi=abi
Select which floating point ABI is in use.
-mthumb
Enable Thumb only instruction decoding.
-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant
Select which procedure calling convention is in use.
-EB | -EL
Select either big-endian (-EB) or little-endian (-EL) output.
-mthumb-interwork
Specify that the code has been generated with interworking between Thumb and ARM code in mind.
-k
Specify that PIC code has been generated.

The following options are available when as is configured for the Renesas M32C and M16C processors.

-m32c
Assemble M32C instructions.

-m16c
Assemble M16C instructions (the default).

-relax
Enable support for link-time relaxations.

-h-tick-hex
Support H'00 style hex constants in addition to 0x00 style.

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] [ ? ]

1.1 Structure of this Manual

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] [ ? ]

1.2 The GNU Assembler

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] [ ? ]

1.3 Object File Formats

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] [ ? ]

1.4 Command Line

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] [ ? ]

1.5 Input Files

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.

Filenames and Line-numbers

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] [ ? ]

1.6 Output (Object) File

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] [ ? ]

1.7 Error and Warning Messages

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
The file name and line number are derived as for warning messages. The actual message text may be rather less explanatory because many of them aren't supposed to happen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Command-Line Options

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 .include Search 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] [ ? ]

2.1 Enable Listings: `-a[cdghlns]'

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] [ ? ]

2.2 `--alternate'

Begin in alternate macro mode, see .altmacro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 `-D'

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] [ ? ]

2.4 Work Faster: `-f'

`-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] [ ? ]

2.5 .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] [ ? ]

2.6 Difference Tables: `-K'

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] [ ? ]

2.7 Include Local Symbols: `-L'

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] [ ? ]

2.8 Configuring listing output: `--listing'

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'
Sets the maximum width, in words, of the first line of the hex byte dump. This dump appears on the left hand side of the listing output.

--listing-lhs-width2=`number'
Sets the maximum width, in words, of any further lines of the hex byte dump for a given input source line. If this value is not specified, it defaults to being the same as the value specified for `--listing-lhs-width'. If neither switch is used the default is to one.

--listing-rhs-width=`number'
Sets the maximum width, in characters, of the source line that is displayed alongside the hex dump. The default value for this parameter is 100. The source line is displayed on the right hand side of the listing output.

--listing-cont-lines=`number'
Sets the maximum number of continuation lines of hex dump that will be displayed for a given single line of source input. The default value is 4.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.9 Assemble in MRI Compatibility Mode: `-M'

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:

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.10 Dependency Tracking: `--MD'

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] [ ? ]

2.11 Name the Object File: `-o'

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] [ ? ]

2.12 Join Data and Text Sections: `-R'

`-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] [ ? ]

2.13 Display Assembly Statistics: `--statistics'

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] [ ? ]

2.14 Compatible Output: `--traditional-format'

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] [ ? ]

2.15 Announce Version: `-v'

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] [ ? ]

2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'

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] [ ? ]

2.17 Generate Object File in Spite of Errors: `-Z'

After an error message, 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] [ ? ]

3. Syntax

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] [ ? ]

3.1 Preprocessing

The as internal preprocessor:

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] [ ? ]

3.2 Whitespace

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] [ ? ]

3.3 Comments

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.
This feature is deprecated, and may disappear from future versions of as.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Symbols

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] [ ? ]

3.5 Statements

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] [ ? ]

3.6 Constants

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] [ ? ]

3.6.1 Character Constants

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] [ ? ]

3.6.1.1 Strings

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.

\b
Mnemonic for backspace; for ASCII this is octal code 010.

\f
Mnemonic for FormFeed; for ASCII this is octal code 014.

\n
Mnemonic for newline; for ASCII this is octal code 012.

\r
Mnemonic for carriage-Return; for ASCII this is octal code 015.

\t
Mnemonic for horizontal Tab; for ASCII this is octal code 011.

\ digit digit digit
An octal character code. The numeric code is 3 octal digits. For compatibility with other Unix systems, 8 and 9 are accepted as digits: for example, \008 has the value 010, and \009 the value 011.

\x hex-digits...
A hex character code. All trailing hex digits are combined. Either upper or lower case x works.

\\
Represents one `\' character.

\"
Represents one `"' character. Needed in strings to represent this character, because an unescaped `"' would end the string.

\ anything-else
Any other character when escaped by \ gives a warning, but assembles as if the `\' was not present. The idea is that if you used an escape sequence you clearly didn't want the literal interpretation of the following character. However 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] [ ? ]

3.6.1.2 Characters

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] [ ? ]

3.6.2 Number Constants

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] [ ? ]

3.6.2.1 Integers

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] [ ? ]

3.6.2.2 Bignums

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] [ ? ]

3.6.2.3 Flonums

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)

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. Sections and Relocation

4.1 Background  
4.2 Linker Sections  
4.3 Assembler Internal Sections  
4.4 Sub-Sections  
4.5 bss Section  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 Background

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:

In fact, every address as ever uses is expressed as
 
(section) + (offset into section)
Further, most expressions 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] [ ? ]

4.2 Linker Sections

ld deals with just four kinds of sections, summarized below.

named sections
text section
data section
These sections hold your program. 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.

bss section
This section contains zeroed bytes when your program begins running. It is used to hold uninitialized variables or common storage. The length of each partial program's bss section is important, but because it starts out containing zeroed bytes there is no need to store explicit zero bytes in the object file. The bss section was invented to eliminate those explicit zeros from object files.

absolute section
Address 0 of this section is always "relocated" to runtime address 0. This is useful if you want to refer to an address that ld must not change when relocating. In this sense we speak of absolute addresses being "unrelocatable": they do not change during relocation.

undefined section
This "section" is a catch-all for address references to objects not in the preceding sections.

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] [ ? ]

4.3 Assembler Internal Sections

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.

ASSEMBLER-INTERNAL-LOGIC-ERROR!
An internal assembler logic error has been found. This means there is a bug in the assembler.

expr section
The assembler stores complex expression internally as combinations of symbols. When it needs to represent an expression as a symbol, it puts it in the expr section.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 Sub-Sections

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] [ ? ]

4.5 bss Section

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] [ ? ]

5. Symbols

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] [ ? ]

5.1 Labels

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] [ ? ]

5.2 Giving Symbols Other Values

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] [ ? ]

5.3 Symbol Names

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.

Local Symbol Names

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

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
All local symbols begin with the system-specific local label prefix. Normally both 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
This is the number that was used in the local label definition. So if the label is written `55:' then the number is `55'.

C-B
This unusual character is included so you do not accidentally invent a symbol of the same name. The character has ASCII value of `\002' (control-B).

ordinal number
This is a serial number to keep the labels distinct. The first definition of `0:' gets the number `1'. The 15th definition of `0:' gets the number `15', and so on. Likewise the first definition of `1:' gets the number `1' and its 15th definition gets `15' as well.

So for example, the first 1: may be named .L1C-B1, and the 44th 3: may be named .L3C-B44.

Dollar Local Labels

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] [ ? ]

5.4 The Special Dot Symbol

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] [ ? ]

5.5 Symbol Attributes

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.out  
5.5.4 Symbol Attributes for COFF  
5.5.5 Symbol Attributes for SOM  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.1 Value

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] [ ? ]

5.5.2 Type

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] [ ? ]

5.5.3 Symbol Attributes: a.out

5.5.3.1 Descriptor  
5.5.3.2 Other  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.3.1 Descriptor

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] [ ? ]

5.5.3.2 Other

This is an arbitrary 8-bit value. It means nothing to as.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.4 Symbol Attributes for COFF

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] [ ? ]

5.5.4.1 Primary Attributes

The symbol name is set with .def; the value and type, respectively, with .val and .type.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.4.2 Auxiliary Attributes

The as directives .dim, .line, .scl, .size, .tag, and .weak can generate auxiliary symbol table information for COFF.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5.5 Symbol Attributes for SOM

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] [ ? ]

6. Expressions

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] [ ? ]

6.1 Empty Expressions

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] [ ? ]

6.2 Integer Expressions

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] [ ? ]

6.2.1 Arguments

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] [ ? ]

6.2.2 Operators

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] [ ? ]

6.2.3 Prefix Operator

as has the following prefix operators. They each take one argument, which must be absolute.

-
Negation. Two's complement negation.
~
Complementation. Bitwise not.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.4 Infix Operators

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.

  1. Highest Precedence

    *
    Multiplication.

    /
    Division. Truncation is the same as the C operator `/'

    %
    Remainder.

    <<
    Shift Left. Same as the C operator `<<'.

    >>
    Shift Right. Same as the C operator `>>'.

  2. Intermediate precedence

    |

    Bitwise Inclusive Or.

    &
    Bitwise And.

    ^
    Bitwise Exclusive Or.

    !
    Bitwise Or Not.

  3. Low Precedence

    +
    Addition. If either argument is absolute, the result has the section of the other argument. You may not add together arguments from different sections.

    -
    Subtraction. If the right argument is absolute, the result has the section of the left argument. If both arguments are in the same section, the result is absolute. You may not subtract arguments from different sections.

    ==
    Is Equal To
    <>
    !=
    Is Not Equal To
    <
    Is Less Than
    >
    Is Greater Than
    >=
    Is Greater Than Or Equal To
    <=
    Is Less Than Or Equal To

    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.

  4. Lowest Precedence

    &&
    Logical And.

    ||
    Logical Or.

    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] [ ? ]

7. Assembler Directives

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 .abort  
7.2 .ABORT (COFF)  .ABORT

7.3 .align abs-expr, abs-expr, abs-expr  .align abs-expr , abs-expr
7.4 .altmacro  
7.5 .ascii "string"...  
7.6 .asciz "string"...  
7.7 .balign[wl] abs-expr, abs-expr, abs-expr  .balign abs-expr , abs-expr
7.8 .byte expressions  
7.9 .cfi_sections section_list  .cfi_startproc [simple], .cfi_endproc, etc.
7.30 .comm symbol , length   
7.31 .data subsection  
7.32 .def name  
7.33 .desc symbol, abs-expression  
7.34 .dim  

7.35 .double flonums  
7.36 .eject  
7.37 .else  
7.38 .elseif  
7.39 .end  
7.40 .endef  

7.41 .endfunc  
7.42 .endif  
7.43 .equ symbol, expression  
7.44 .equiv symbol, expression  
7.45 .eqv symbol, expression  
7.46 .err  
7.47 .error "string"  
7.48 .exitm  
7.49 .extern  
7.50 .fail expression  .fail
7.51 .file  
7.52 .fill repeat , size , value  
7.53 .float flonums  
7.54 .func name[,label]  .func
7.55 .global symbol, .globl symbol  
7.56 .gnu_attribute tag,value  
7.57 .hidden names  

7.58 .hword expressions  
7.59 .ident  
7.60 .if absolute expression  
7.61 .incbin "file"[,skip[,count]]  
7.62 .include "file"  
7.63 .int expressions  
7.64 .internal names  

7.65 .irp symbol,values...  
7.66 .irpc symbol,values...  
7.67 .lcomm symbol , length  
7.68 .lflags  
7.69 .line line-number  

7.70 .linkonce [type]  
7.71 .list  
7.72 .ln line-number  
7.73 .loc fileno lineno [column] [options]  .loc fileno lineno
7.74 .loc_mark_labels enable  
7.75 .local names  

7.76 .long expressions  

7.77 .macro  .macro name args...
7.78 .mri val  
7.79 .noaltmacro  
7.80 .nolist  
7.81 .octa bignums  
7.82 .offset loc  
7.83 .org new-lc , fill  
7.84 .p2align[wl] abs-expr, abs-expr, abs-expr  .p2align abs-expr, abs-expr, abs-expr
7.85 .popsection  
7.86 .previous  

7.87 .print string  
7.88 .protected names  

7.89 .psize lines , columns  
7.90 .purgem name  
7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]  .pushsection name

7.92 .quad bignums  
7.93 .reloc offset, reloc_name[, expression]  
7.94 .rept count  
7.95 .sbttl "subheading"  
7.96 .scl class  
7.97 .section name  .section name[, flags]

7.98 .set symbol, expression  
7.99 .short expressions  
7.100 .single flonums  
7.101 .size  .size [name , expression]
7.102 .skip size , fill  

7.103 .sleb128 expressions  
7.104 .space size , fill  
7.105 .stabd, .stabn, .stabs  

7.106 .string "str", .string8 "str", .string16  .string "str", .string8 "str", .string16 "str", .string32 "str", .string64 "str"
7.107 .struct expression  
7.108 .subsection name  .subsection
7.109 .symver  .symver name,name2@nodename

7.110 .tag structname  

7.111 .text subsection  
7.112 .title "heading"  
7.113 .type  .type <int | name , type description>

7.114 .uleb128 expressions  
7.115 .val addr  

7.116 .version "string"  
7.117 .vtable_entry table, offset  
7.118 .vtable_inherit child, parent  

7.119 .warning "string"  
7.120 .weak names  
7.121 .weakref alias, target  .weakref alias, symbol
7.122 .word expressions  
7.123 Deprecated Directives  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 .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] [ ? ]

7.2 .ABORT (COFF)

When producing COFF output, as accepts this directive as a synonym for `.abort'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 .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] [ ? ]

7.4 .altmacro

Enable alternate macro mode, enabling:

LOCAL name [ , ... ]
One additional directive, 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
You can write strings delimited in these other ways besides "string":

'string'
You can delimit strings with single-quote characters.

<string>
You can delimit strings with matching angle brackets.

single-character string escape
To include any single character literally in a string (even if the character would otherwise have some special meaning), you can prefix the character with `!' (an exclamation mark). For example, you can write `<4.3 !> 5.4!!>' to get the literal text `4.3 > 5.4!'.

Expression results as strings
You can write `%expr' to evaluate the expression expr and use the result as a string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.5 .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] [ ? ]

7.6 .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] [ ? ]

7.7 .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] [ ? ]

7.8 .byte expressions

.byte expects zero or more expressions, separated by commas. Each expression is assembled into the next byte.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.9 .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] [ ? ]

7.10 .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] [ ? ]

7.11 .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] [ ? ]

7.12 .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] [ ? ]

7.13 .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] [ ? ]

7.14 .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] [ ? ]

7.15 .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] [ ? ]

7.16 .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] [ ? ]

7.17 .cfi_adjust_cfa_offset offset

Same as .cfi_def_cfa_offset but offset is a relative value that is added/substracted from the previous offset.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.18 .cfi_offset register, offset

Previous value of register is saved at offset offset from CFA.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.19 .cfi_rel_offset register, offset

Previous value of register is saved at offset offset from the current CFA register. This is transformed to .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] [ ? ]

7.20 .cfi_register register1, register2

Previous value of register1 is saved in register register2.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.21 .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] [ ? ]

7.22 .cfi_undefined register

From now on the previous value of register can't be restored anymore.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.23 .cfi_same_value register

Current value of register is the same like in the previous frame, i.e. no restoration needed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.24 .cfi_remember_state,

First save all current rules for all registers by .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] [ ? ]

7.25 .cfi_return_column register

Change return column register, i.e. the return address is either directly in register or can be accessed by rules for register.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.26 .cfi_signal_frame

Mark current function as signal trampoline.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.27 .cfi_window_save

SPARC register window has been saved.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.28 .cfi_escape expression[, ...]

Allows the user to add arbitrary bytes to the unwind info. One might use this to add OS-specific CFI opcodes, or generic CFI opcodes that GAS does not yet support.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.29 .cfi_val_encoded_addr register, encoding, label

The current value of register is label. The value of label will be encoded in the output file according to encoding; see the description of .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] [ ? ]

7.30 .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] [ ? ]

7.31 .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] [ ? ]

7.32 .def name

Begin defining debugging information for a symbol name; the definition extends until the .endef directive is encountered.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.33 .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] [ ? ]

7.34 .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] [ ? ]

7.35 .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] [ ? ]

7.36 .eject

Force a page break at this point, when generating assembly listings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.37 .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] [ ? ]

7.38 .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] [ ? ]

7.39 .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] [ ? ]

7.40 .endef

This directive flags the end of a symbol definition begun with .def.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.41 .endfunc

.endfunc marks the end of a function specified with .func.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.42 .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] [ ? ]

7.43 .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] [ ? ]

7.44 .equiv symbol, expression

The .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
plus it protects the symbol from later redefinition.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.45 .eqv symbol, expression

The .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] [ ? ]

7.46 .err

If 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] [ ? ]

7.47 .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] [ ? ]

7.48 .exitm

Exit early from the current macro definition. See section 7.77 .macro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.49 .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] [ ? ]

7.50 .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] [ ? ]

7.51 .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.

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.

DWARF2 Version

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] [ ? ]

7.52 .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] [ ? ]

7.53 .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] [ ? ]

7.54 .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] [ ? ]

7.55 .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] [ ? ]

7.56 .gnu_attribute tag,value

Record a GNU object attribute for this file. See section 8. Object Attributes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.57 .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] [ ? ]

7.58 .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] [ ? ]

7.59 .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] [ ? ]

7.60 .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
Assembles the following section of code if the specified symbol has been defined. Note a symbol which has been referenced but not yet defined is considered to be undefined.

.ifb text
Assembles the following section of code if the operand is blank (empty).

.ifc string1,string2
Assembles the following section of code if the two strings are the same. The strings may be optionally quoted with single quotes. If they are not quoted, the first string stops at the first comma, and the second string stops at the end of the line. Strings which contain whitespace should be quoted. The string comparison is case sensitive.

.ifeq absolute expression
Assembles the following section of code if the argument is zero.

.ifeqs string1,string2
Another form of .ifc. The strings must be quoted using double quotes.

.ifge absolute expression
Assembles the following section of code if the argument is greater than or equal to zero.

.ifgt absolute expression
Assembles the following section of code if the argument is greater than zero.

.ifle absolute expression
Assembles the following section of code if the argument is less than or equal to zero.

.iflt absolute expression
Assembles the following section of code if the argument is less than zero.

.ifnb text
Like .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.
Like .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
Assembles the following section of code if the specified symbol has not been defined. Both spelling variants are equivalent. Note a symbol which has been referenced but not yet defined is considered to be undefined.

.ifne absolute expression
Assembles the following section of code if the argument is not equal to zero (in other words, this is equivalent to .if).

.ifnes string1,string2
Like .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] [ ? ]

7.61 .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] [ ? ]

7.62 .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] [ ? ]

7.63 .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] [ ? ]

7.64 .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] [ ? ]

7.65 .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] [ ? ]

7.66 .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] [ ? ]

7.67 .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] [ ? ]

7.68 .lflags

as accepts this directive, for compatibility with other assemblers, but ignores it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.69 .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] [ ? ]

7.70 .linkonce [type]

Mark the current section so that the linker only includes a single copy of it. This may be used to include the same section in several different object files, but ensure that the linker will only include it once in the final output file. The .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
Not all types may be supported on all object file formats.

discard
Silently discard duplicate sections. This is the default.

one_only
Warn if there are duplicate sections, but still keep only one copy.

same_size
Warn if any of the duplicates have different sizes.

same_contents
Warn if any of the duplicates do not have exactly the same contents.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.71 .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] [ ? ]

7.72 .ln line-number

`.ln' is a synonym for `.line'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.73 .loc fileno lineno [column] [options]

When emitting DWARF2 line number information, the .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
This option will set the basic_block register in the .debug_line state machine to true.

prologue_end
This option will set the prologue_end register in the .debug_line state machine to true.

epilogue_begin
This option will set the epilogue_begin register in the .debug_line state machine to true.

is_stmt value
This option will set the is_stmt register in the .debug_line state machine to value, which must be either 0 or 1.

isa value
This directive will set the isa register in the .debug_line state machine to value, which must be an unsigned integer.

discriminator value
This directive will set the discriminator register in the .debug_line state machine to value, which must be an unsigned integer.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.74 .loc_mark_labels enable

When emitting DWARF2 line number information, the .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] [ ? ]

7.75 .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] [ ? ]

7.76 .long expressions

.long is the same as `.int'. See section .int.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.77 .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 ...
Begin the definition of a macro called macname. If your macro definition requires arguments, specify their names after the macro name, separated by commas or spaces. You can qualify the macro argument to indicate whether all invocations must specify a non-blank value (through `: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
Begin the definition of a macro called comm, which takes no arguments.

.macro plus1 p, p1
.macro plus1 p p1
Either statement begins the definition of a macro called plus1, which takes two arguments; within the macro definition, write `\p' or `\p1' to evaluate the arguments.

.macro reserve_str p1=0 p2
Begin the definition of a macro called 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
Begin the definition of a macro called 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
If it is possible to use white space characters then this is the simplest solution. eg:

 
	.macro label l
\l :
	.endm

Use `\()'
The string `\()' can be used to separate the end of a macro argument from the following text. eg:

 
	.macro opcode base length
        \base\().\length
	.endm

Use the alternate macro syntax mode
In the alternative macro syntax mode the ampersand character (`&') can be used as a separator. eg:

 
	.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
Mark the end of a macro definition.

.exitm
Exit early from the current macro definition.

\@
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 [ , ... ]
Warning: LOCAL is only available if you select "alternate macro syntax" with `--alternate' or .altmacro. See section .altmacro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.78 .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] [ ? ]

7.79 .noaltmacro

Disable alternate macro mode. See section 7.4 .altmacro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.80 .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] [ ? ]

7.81 .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] [ ? ]

7.82 .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] [ ? ]

7.83 .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] [ ? ]

7.84 .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] [ ? ]

7.85 .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] [ ? ]

7.86 .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] [ ? ]

7.87 .print string

as will print string on the standard output during assembly. You must put string in double quotes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.88 .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] [ ? ]

7.89 .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] [ ? ]

7.90 .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] [ ? ]

7.91 .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] [ ? ]

7.92 .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] [ ? ]

7.93 .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] [ ? ]

7.94 .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] [ ? ]

7.95 .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] [ ? ]

7.96 .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] [ ? ]

7.97 .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.

COFF Version

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
bss section (uninitialized data)
n
section is not loaded
w
writable section
d
data section
r
read-only section
x
executable section
s
shared section (meaningful for PE targets)
a
ignored. (For compatibility with the ELF version)
y
section is not readable (meaningful for PE targets)
0-9
single-digit power-of-two section alignment (GNU extension)

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).

ELF Version

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
section is allocatable
e
section is excluded from executable and shared library.
w
section is writable
x
section is executable
M
section is mergeable
S
section contains zero terminated strings
G
section is a member of a section group
T
section is used for thread-local-storage
?
section is a member of the previously-current section's group, if any

The optional type argument may contain one of the following constants:

@progbits
section contains data
@nobits
section does not contain data (i.e., section only occupies space)
@note
section contains data which is used by things other than the program
@init_array
section contains an array of pointers to init functions
@fini_array
section contains an array of pointers to finish functions
@preinit_array
section contains an array of pointers to pre-init functions

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
indicates that only one copy of this section should be retained
.gnu.linkonce
an alias for comdat

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
section is allocatable
#write
section is writable
#execinstr
section is executable
#exclude
section is excluded from executable and shared library.
#tls
section is used for thread local storage

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] [ ? ]

7.98 .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] [ ? ]

7.99 .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] [ ? ]

7.100 .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] [ ? ]

7.101 .size

This directive is used to set the size associated with a symbol.

COFF Version

For COFF targets, the .size directive is only permitted inside .def/.endef pairs. It is used like this:

 
.size expression

ELF Version

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] [ ? ]

7.102 .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] [ ? ]

7.103 .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] [ ? ]

7.104 .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] [ ? ]

7.105 .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:

string
This is the symbol's name. It may contain any character except `\000', so is more general than ordinary symbol names. Some debuggers used to code arbitrarily complex structures into symbol names using this field.

type
An absolute expression. The symbol's type is set to the low 8 bits of this expression. Any bit pattern is permitted, but ld and debuggers choke on silly bit patterns.

other
An absolute expression. The symbol's "other" attribute is set to the low 8 bits of this expression.

desc
An absolute expression. The symbol's descriptor is set to the low 16 bits of this expression.

value
An absolute expression which becomes the symbol's value.

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
The name of the symbol is set to the empty string "".

.stabs string , type , other , desc , value
All five fields are specified.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.106 .string "str", .string8 "str", .string16

"str", .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] [ ? ]

7.107 .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:
This would define the symbol 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] [ ? ]

7.108 .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] [ ? ]

7.109 .symver

Use the .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
If the symbol name is defined within the file being assembled, the .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
In this case, the symbol name must exist and be defined within the file being assembled. It is similar to name2@nodename. The difference is name2@@nodename will also be used to resolve references to name2 by the linker.

The third usage of the .symver directive is:
 
.symver name, name2@@@nodename
When name is not defined within the file being assembled, it is treated as name2@nodename. When name is defined within the file being assembled, the symbol name, name, will be changed to name2@@nodename.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.110 .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] [ ? ]

7.111 .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] [ ? ]

7.112 .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] [ ? ]

7.113 .type

This directive is used to set the type of a symbol.

COFF Version

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.

ELF Version

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
Mark the symbol as being a function name.

STT_GNU_IFUNC
gnu_indirect_function
Mark the symbol as an indirect function when evaluated during reloc processing. (This is only supported on assemblers targeting GNU systems).

STT_OBJECT
object
Mark the symbol as being a data object.

STT_TLS
tls_object
Mark the symbol as being a thead-local data object.

STT_COMMON
common
Mark the symbol as being a common data object.

STT_NOTYPE
notype
Does not mark the symbol in any way. It is supported just for completeness.

gnu_unique_object
Marks the symbol as being a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. (This is only supported on assemblers targeting GNU systems).

Note: Some targets support extra types in addition to those listed above.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.114 .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] [ ? ]

7.115 .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] [ ? ]

7.116 .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] [ ? ]

7.117 .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] [ ? ]

7.118 .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] [ ? ]

7.119 .warning "string"

Similar to the directive .error (see section .error "string"), but just emits a warning.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.120 .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] [ ? ]

7.121 .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] [ ? ]

7.122 .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] [ ? ]

7.123 Deprecated Directives

One day these directives won't work. They are included for compatibility with older assemblers.

.abort
.line


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. Object Attributes

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] [ ? ]

8.1 GNU Object Attributes

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] [ ? ]

8.1.1 Common GNU attributes

These attributes are valid on all architectures.

Tag_compatibility (32)
The compatibility attribute takes an integer flag value and a vendor name. If the flag value is 0, the file is compatible with other toolchains. If it is 1, then the file is only compatible with the named toolchain. If it is greater than 1, the file can only be processed by other toolchains under some private arrangement indicated by the flag value and the vendor name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 Defining New Object Attributes

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] [ ? ]

9. Machine Dependent Features

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 H8/300 Dependent Features

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] [ ? ]

9.1.1 Options

The Renesas H8/300 version of as has one machine-dependent option:

-h-tick-hex
Support H'00 style hex constants in addition to 0x00 style.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.2 Syntax

9.1.2.1 Special Characters  
9.1.2.2 Register Names  
9.1.2.3 Addressing Modes  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.2.1 Special Characters

`;' 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] [ ? ]

9.1.2.2 Register Names

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] [ ? ]

9.1.2.3 Addressing Modes

as understands the following addressing modes for the H8/300:

rn
Register direct

@rn
Register indirect

@(d, rn)
@(d:16, rn)
@(d:24, rn)
Register indirect: 16-bit or 24-bit displacement d from register n. (24-bit displacements are only meaningful on the H8/300H.)

@rn+
Register indirect with post-increment

@-rn
Register indirect with pre-decrement

@aa
@aa:8
@aa:16
@aa:24
Absolute address aa. (The address size `:24' only makes sense on the H8/300H.)

#xx
#xx:8
#xx:16
#xx:32
Immediate data xx. You may specify the `:8', `:16', or `:32' for clarity, if you wish; but as neither requires this nor uses it--the data size required is taken from context.

@@aa
@@aa:8
Memory indirect. You may specify the `:8' for clarity, if you wish; but as neither requires this nor uses it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.3 Floating Point

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] [ ? ]

9.1.4 H8/300 Machine Directives

as has the following machine-dependent directives for the H8/300:

.h8300h
Recognize and emit additional instructions for the H8/300H variant, and also make .int emit 32-bit numbers rather than the usual (16-bit) for the H8/300 family.

.h8300s
Recognize and emit additional instructions for the H8S variant, and also make .int emit 32-bit numbers rather than the usual (16-bit) for the H8/300 family.

.h8300hn
Recognize and emit additional instructions for the H8/300H variant in normal mode, and also make .int emit 32-bit numbers rather than the usual (16-bit) for the H8/300 family.

.h8300sn
Recognize and emit additional instructions for the H8S variant in normal mode, and also make .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] [ ? ]

9.1.5 Opcodes

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] [ ? ]

9.2 M32C Dependent Features

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] [ ? ]

9.2.1 M32C Options

The Renesas M32C version of as has these machine-dependent options:
-m32c
Assemble M32C instructions.
-m16c
Assemble M16C instructions (default).

-relax
Enable support for link-time relaxations.

-h-tick-hex
Support H'00 style hex constants in addition to 0x00 style.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2.2 M32C Syntax

9.2.2.1 Symbolic Operand Modifiers  
9.2.2.2 Special Characters  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2.2.1 Symbolic Operand Modifiers

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] [ ? ]

9.2.2.2 Special Characters

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 RX Dependent Features

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] [ ? ]

9.3.1 RX Options

The Renesas RX port of as has a few target specfic command line options:

-m32bit-doubles
This option controls the ABI and indicates to use a 32-bit float ABI. It has no effect on the assembled instructions, but it does influence the behaviour of the `.double' pseudo-op. This is the default.

-m64bit-doubles
This option controls the ABI and indicates to use a 64-bit float ABI. It has no effect on the assembled instructions, but it does influence the behaviour of the `.double' pseudo-op.

-mbig-endian
This option controls the ABI and indicates to use a big-endian data ABI. It has no effect on the assembled instructions, but it does influence the behaviour of the `.short', `.hword', `.int', `.word', `.long', `.quad' and `.octa' pseudo-ops.

-mlittle-endian
This option controls the ABI and indicates to use a little-endian data ABI. It has no effect on the assembled instructions, but it does influence the behaviour of the `.short', `.hword', `.int', `.word', `.long', `.quad' and `.octa' pseudo-ops. This is the default.

-muse-conventional-section-names
This option controls the default names given to the code (.text), initialised data (.data) and uninitialised data sections (.bss).

-muse-renesas-section-names
This option controls the default names given to the code (.P), initialised data (.D_1) and uninitialised data sections (.B_1). This is the default.

-msmall-data-limit
This option tells the assembler that the small data limit feature of the RX port of GCC is being used. This results in the assembler generating an undefined reference to a symbol called __gp for use by the relocations that are needed to support the small data limit feature. This option is not enabled by default as it would otherwise pollute the symbol table.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.3.2 Symbolic Operand Modifiers

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] [ ? ]

9.3.3 Assembler Directives

The RX version of as has the following specific assembler directives:

.3byte
Inserts a 3-byte value into the output file at the current location.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.3.4 Floating Point

The floating point formats generated by directives are these.

.float
Single precision (32-bit) floating point constants.

.double
If the `-m64bit-doubles' command line option has been specified then then 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 Syntax for the RX

9.3.5.1 Special Characters  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.3.5.1 Special Characters

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 Renesas / SuperH SH Dependent Features

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] [ ? ]

9.4.1 Options

as has following command-line options for the Renesas (formerly Hitachi) / SuperH SH family.

--little
Generate little endian code.

--big
Generate big endian code.

--relax
Alter jump instructions for long displacements.

--small
Align sections to 4 byte boundaries, not 16.

--dsp
Enable sh-dsp insns, and disable sh3e / sh4 insns.

--renesas
Disable optimization with section symbol for compatibility with Renesas assembler.

--allow-reg-prefix
Allow '$' as a register name prefix.

--fdpic
Generate an FDPIC object file.

--isa=sh4 | sh4a
Specify the sh4 or sh4a instruction set.
--isa=dsp
Enable sh-dsp insns, and disable sh3e / sh4 insns.
--isa=fp
Enable sh2e, sh3e, sh4, and sh4a insn sets.
--isa=all
Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.

-h-tick-hex
Support H'00 style hex constants in addition to 0x00 style.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.2 Syntax

9.4.2.1 Special Characters  
9.4.2.2 Register Names  
9.4.2.3 Addressing Modes  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.2.1 Special Characters

`!' 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] [ ? ]

9.4.2.2 Register Names

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
procedure register (holds return address)

pc
program counter

mach
macl
high and low multiply accumulator registers

sr
status register

gbr
global base register

vbr
vector base register (for interrupt vectors)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.2.3 Addressing Modes

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
Register direct

@Rn
Register indirect

@-Rn
Register indirect with pre-decrement

@Rn+
Register indirect with post-increment

@(disp, Rn)
Register indirect with displacement

@(R0, Rn)
Register indexed

@(disp, GBR)
GBR offset

@(R0, GBR)
GBR indexed

addr
@(disp, PC)
PC relative address (for branch or for addressing memory). The 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
Immediate data


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.3 Floating Point

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] [ ? ]

9.4.4 SH Machine Directives

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] [ ? ]

9.4.5 Opcodes

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 SuperH SH64 Dependent Features

9.5.1 Options  
9.5.2 Syntax  
9.5.3 SH64 Machine Directives  
9.5.4 Opcodes  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.1 Options

-isa=sh4 | sh4a
Specify the sh4 or sh4a instruction set.
-isa=dsp
Enable sh-dsp insns, and disable sh3e / sh4 insns.
-isa=fp
Enable sh2e, sh3e, sh4, and sh4a insn sets.
-isa=all
Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.
-isa=shmedia | -isa=shcompact
Specify the default instruction set. 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
Specify the default ABI. If the ISA is specified and the ABI is not, the default ABI depends on the ISA, with SHmedia defaulting to 64-bit and SHcompact defaulting to 32-bit.

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
Emit code-range descriptors for constants in SHcompact code sections.

-no-mix
Disallow SHmedia code in the same section as constants and SHcompact code.

-no-expand
Do not expand MOVI, PT, PTA or PTB instructions.

-expand-pt32
With -abi=64, expand PT, PTA and PTB instructions to 32 bits only.

-h-tick-hex
Support H'00 style hex constants in addition to 0x00 style.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.2 Syntax

9.5.2.1 Special Characters  
9.5.2.2 Register Names  
9.5.2.3 Addressing Modes  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.2.1 Special Characters

`!' 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] [ ? ]

9.5.2.2 Register Names

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] [ ? ]

9.5.2.3 Addressing Modes

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] [ ? ]

9.5.3 SH64 Machine Directives

In addition to the SH directives, the SH64 provides the following directives:

.mode [shmedia|shcompact]
.isa [shmedia|shcompact]
Specify the ISA for the following instructions (the two directives are equivalent). Note that programs such as 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]
Specify the ABI for the following instructions. Note that you cannot use this directive unless you specified an ABI on the command line, and the ABIs specified must match.

.uaquad
Like .uaword and .ualong, this allows you to specify an intentionally unaligned quadword (64 bit word).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.4 Opcodes

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
If the value doesn't fit into a standard movi opcode, as will replace the movi with a sequence of movi and shori opcodes.

pt
This expands to a sequence of 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 v850 Dependent Features

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] [ ? ]

9.6.1 Options

as supports the following additional command-line options for the V850 processor family:

-wsigned_overflow
Causes warnings to be produced when signed immediate values overflow the space available for then within their opcodes. By default this option is disabled as it is possible to receive spurious warnings due to using exact bit patterns as immediate constants.

-wunsigned_overflow
Causes warnings to be produced when unsigned immediate values overflow the space available for then within their opcodes. By default this option is disabled as it is possible to receive spurious warnings due to using exact bit patterns as immediate constants.

-mv850
Specifies that the assembled code should be marked as being targeted at the V850 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

-mv850e
Specifies that the assembled code should be marked as being targeted at the V850E processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

-mv850e1
Specifies that the assembled code should be marked as being targeted at the V850E1 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

-mv850any
Specifies that the assembled code should be marked as being targeted at the V850 processor but support instructions that are specific to the extended variants of the process. This allows the production of binaries that contain target specific code, but which are also intended to be used in a generic fashion. For example libgcc.a contains generic routines used by the code produced by GCC for all versions of the v850 architecture, together with support routines only used by the V850E architecture.

-mv850e2
Specifies that the assembled code should be marked as being targeted at the V850E2 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

-mv850e2v3
Specifies that the assembled code should be marked as being targeted at the V850E2V3 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

-mrelax
Enables relaxation. This allows the .longcall and .longjump pseudo ops to be used in the assembler source code. These ops label sections of code which are either a long function call or a long branch. The assembler will then flag these sections of code and the linker will attempt to relax them.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.2 Syntax

9.6.2.1 Special Characters  
9.6.2.2 Register Names  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.2.1 Special Characters

`#' 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] [ ? ]

9.6.2.2 Register Names

as supports the following names for registers:

general register 0
r0, zero
general register 1
r1
general register 2
r2, hp
general register 3
r3, sp
general register 4
r4, gp
general register 5
r5, tp
general register 6
r6
general register 7
r7
general register 8
r8
general register 9
r9
general register 10
r10
general register 11
r11
general register 12
r12
general register 13
r13
general register 14
r14
general register 15
r15
general register 16
r16
general register 17
r17
general register 18
r18
general register 19
r19
general register 20
r20
general register 21
r21
general register 22
r22
general register 23
r23
general register 24
r24
general register 25
r25
general register 26
r26
general register 27
r27
general register 28
r28
general register 29
r29
general register 30
r30, ep
general register 31
r31, lp
system register 0
eipc
system register 1
eipsw
system register 2
fepc
system register 3
fepsw
system register 4
ecr
system register 5
psw
system register 16
ctpc
system register 17
ctpsw
system register 18
dbpc
system register 19
dbpsw
system register 20
ctbp


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.3 Floating Point

The V850 family uses IEEE floating-point numbers.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.4 V850 Machine Directives

.offset <expression>
Moves the offset into the current section to the specified amount.

.section "name", <type>
This is an extension to the standard .section directive. It sets the current section to be <type> and creates an alias for this section called "name".

.v850
Specifies that the assembled code should be marked as being targeted at the V850 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

.v850e
Specifies that the assembled code should be marked as being targeted at the V850E processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

.v850e1
Specifies that the assembled code should be marked as being targeted at the V850E1 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

.v850e2
Specifies that the assembled code should be marked as being targeted at the V850E2 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.

.v850e2v3
Specifies that the assembled code should be marked as being targeted at the V850E2V3 processor. This allows the linker to detect attempts to link such code with code assembled for other processors.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.5 Opcodes

as implements all the standard V850 opcodes.

as also implements the following pseudo ops:

hi0()
Computes the higher 16 bits of the given expression and stores it into the immediate operand field of the given instruction. For example:

`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()
Computes the lower 16 bits of the given expression and stores it into the immediate operand field of the given instruction. For example:

`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()
Computes the higher 16 bits of the given expression and then adds the value of the most significant bit of the lower 16 bits of the expression and stores the result into the immediate operand field of the given instruction. For example the following code can be used to compute the address of the label 'here' and store it into register 6:

`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()
Computes the 32 bit value of the given expression and stores it into the immediate operand field of the given instruction (which must be a mov instruction). For example:

`mov hilo(here), r6'

computes the absolute address of label 'here' and puts the result into register 6.

sdaoff()
Computes the offset of the named variable from the start of the Small Data Area (whoes address is held in register 4, the GP register) and stores the result as a 16 bit signed value in the immediate operand field of the given instruction. For example:

`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()
Computes the offset of the named variable from the start of the Tiny Data Area (whoes address is held in register 30, the EP register) and stores the result as a 4,5, 7 or 8 bit unsigned value in the immediate operand field of the given instruction. For example:

`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()
Computes the offset of the named variable from address 0 and stores the result as a 16 bit signed value in the immediate operand field of the given instruction. For example:

`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()
Computes the offset of the named variable from the start of the Call Table Area (whoes address is helg in system register 20, the CTBP register) and stores the result a 6 or 16 bit unsigned value in the immediate field of then given instruction or piece of data. For example:

`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
Indicates that the following sequence of instructions is a long call to function 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
Indicates that the following sequence of instructions is a long jump to label 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] [ ? ]

10. Reporting Bugs

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] [ ? ]

10.1 Have You Found a Bug?

If you are not sure whether you have found a bug, here are some guidelines:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2 How to Report Bugs

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:

Here are some things that are not necessary:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11. Acknowledgements

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] [ ? ]

A. GNU Free Documentation License

Version 1.3, 3 November 2008

 
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.

  1. PREAMBLE

    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.

  2. APPLICABILITY AND DEFINITIONS

    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.

  3. VERBATIM COPYING

    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.

  4. COPYING IN QUANTITY

    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.

  5. MODIFICATIONS

    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:

    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.

    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.

    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.

    4. Preserve all the copyright notices of the Document.

    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.

    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.

    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.

    8. Include an unaltered copy of this License.

    9. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.

    11. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.

    12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

    13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.

    14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.

    15. Preserve any Warranty Disclaimers.

    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.

  6. COMBINING DOCUMENTS

    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."

  7. COLLECTIONS OF DOCUMENTS

    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.

  8. AGGREGATION WITH INDEPENDENT WORKS

    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.

  9. TRANSLATION

    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.

  10. TERMINATION

    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.

  11. FUTURE REVISIONS OF THIS LICENSE

    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.

  12. RELICENSING

    "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.

ADDENDUM: How to use this License for your documents

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] [ ? ]

AS 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  

Index Entry Section

#
#3.3 Comments
#APP3.1 Preprocessing
#NO_APP3.1 Preprocessing

$
$ in symbol names9.4.2.1 Special Characters
$ in symbol names9.5.2.1 Special Characters

-
--1.4 Command Line
--allow-reg-prefix9.4.1 Options
--alternate2.2 `--alternate'
--big9.4.1 Options
--dsp9.4.1 Options
--fatal-warnings2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
--fdpic9.4.1 Options
--hash-size=number1. Overview
--listing-cont-lines2.8 Configuring listing output: `--listing'
--listing-lhs-width2.8 Configuring listing output: `--listing'
--listing-lhs-width22.8 Configuring listing output: `--listing'
--listing-rhs-width2.8 Configuring listing output: `--listing'
--little9.4.1 Options
--MD2.10 Dependency Tracking: `--MD'
--no-warn2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
--relax9.4.1 Options
--renesas9.4.1 Options
--small9.4.1 Options
--statistics2.13 Display Assembly Statistics: `--statistics'
--traditional-format2.14 Compatible Output: `--traditional-format'
--warn2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
-a2.1 Enable Listings: `-a[cdghlns]'
-ac2.1 Enable Listings: `-a[cdghlns]'
-ad2.1 Enable Listings: `-a[cdghlns]'
-ag2.1 Enable Listings: `-a[cdghlns]'
-ah2.1 Enable Listings: `-a[cdghlns]'
-al2.1 Enable Listings: `-a[cdghlns]'
-an2.1 Enable Listings: `-a[cdghlns]'
-as2.1 Enable Listings: `-a[cdghlns]'
-D2.3 `-D'
-f2.4 Work Faster: `-f'
-I path2.5 .include Search Path: `-I' path
-K2.6 Difference Tables: `-K'
-L2.7 Include Local Symbols: `-L'
-M2.9 Assemble in MRI Compatibility Mode: `-M'
`-m16c' option, M16C9.2.1 M32C Options
`-m32bit-doubles'9.3.1 RX Options
`-m32c' option, M32C9.2.1 M32C Options
`-m64bit-doubles'9.3.1 RX Options
`-mbig-endian'9.3.1 RX Options
`-mlittle-endian'9.3.1 RX Options
-mrelax command line option, V8509.6.1 Options
`-msmall-data-limit'9.3.1 RX Options
`-muse-conventional-section-names'9.3.1 RX Options
`-muse-renesas-section-names'9.3.1 RX Options
-mv850 command line option, V8509.6.1 Options
-mv850any command line option, V8509.6.1 Options
-mv850e command line option, V8509.6.1 Options
-mv850e1 command line option, V8509.6.1 Options
-mv850e2 command line option, V8509.6.1 Options
-mv850e2v3 command line option, V8509.6.1 Options
-o2.11 Name the Object File: `-o'
-R2.12 Join Data and Text Sections: `-R'
-v2.15 Announce Version: `-v'
-version2.15 Announce Version: `-v'
-W2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
-wsigned_overflow command line option, V8509.6.1 Options
-wunsigned_overflow command line option, V8509.6.1 Options

.
. (symbol)5.4 The Special Dot Symbol
.o1.6 Output (Object) File
.v850 directive, V8509.6.4 V850 Machine Directives
.v850e directive, V8509.6.4 V850 Machine Directives
.v850e1 directive, V8509.6.4 V850 Machine Directives
.v850e2 directive, V8509.6.4 V850 Machine Directives
.v850e2v3 directive, V8509.6.4 V850 Machine Directives

:
: (label)3.5 Statements

\
\" (doublequote character)3.6.1.1 Strings
\\ (`\' character)3.6.1.1 Strings
\b (backspace character)3.6.1.1 Strings
\ddd (octal character code)3.6.1.1 Strings
\f (formfeed character)3.6.1.1 Strings
\n (newline character)3.6.1.1 Strings
\r (carriage return character)3.6.1.1 Strings
\t (tab)3.6.1.1 Strings
\xd... (hex character code)3.6.1.1 Strings

A
a.out1.6 Output (Object) File
a.out symbol attributes5.5.3 Symbol Attributes: a.out
ABI options, SH649.5.1 Options
abort directive7.1 .abort
ABORT directive7.2 .ABORT (COFF)
absolute section4.2 Linker Sections
addition, permitted arguments6.2.4 Infix Operators
addresses6. Expressions
addresses, format of4.1 Background
addressing modes, H8/3009.1.2.3 Addressing Modes
addressing modes, SH9.4.2.3 Addressing Modes
addressing modes, SH649.5.2.3 Addressing Modes
advancing location counter7.83 .org new-lc , fill
align directive7.3 .align abs-expr, abs-expr, abs-expr
altered difference tables7.122 .word expressions
architecture options, M16C9.2.1 M32C Options
architecture options, M32C9.2.1 M32C Options
arguments for addition6.2.4 Infix Operators
arguments for subtraction6.2.4 Infix Operators
arguments in expressions6.2.1 Arguments
arithmetic functions6.2.2 Operators
arithmetic operands6.2.1 Arguments
ascii directive7.5 .ascii "string"...
asciz directive7.6 .asciz "string"...
assembler bugs, reporting10.2 How to Report Bugs
assembler crash10.1 Have You Found a Bug?
assembler directive .3byte, RX9.3.3 Assembler Directives
assembler directives, RX9.3.3 Assembler Directives
assembler internal logic error4.3 Assembler Internal Sections
assembler version2.15 Announce Version: `-v'
assembler, and linker4.1 Background
assembly listings, enabling2.1 Enable Listings: `-a[cdghlns]'
assigning values to symbols5.2 Giving Symbols Other Values
assigning values to symbols7.43 .equ symbol, expression
attributes, symbol5.5 Symbol Attributes
auxiliary attributes, COFF symbols5.5.4.2 Auxiliary Attributes
auxiliary symbol information, COFF7.34 .dim

B
backslash (\\)3.6.1.1 Strings
backspace (\b)3.6.1.1 Strings
balign directive7.7 .balign[wl] abs-expr, abs-expr, abs-expr
balignl directive7.7 .balign[wl] abs-expr, abs-expr, abs-expr
balignw directive7.7 .balign[wl] abs-expr, abs-expr, abs-expr
bignums3.6.2.2 Bignums
binary files, including7.61 .incbin "file"[,skip[,count]]
binary integers3.6.2.1 Integers
bss section4.2 Linker Sections
bss section4.5 bss Section
bug criteria10.1 Have You Found a Bug?
bug reports10.2 How to Report Bugs
bugs in assembler10. Reporting Bugs
byte directive7.8 .byte expressions

C
carriage return (\r)3.6.1.1 Strings
cfi_endproc directive7.11 .cfi_endproc
cfi_sections directive7.9 .cfi_sections section_list
cfi_startproc directive7.10 .cfi_startproc [simple]
character constants3.6.1 Character Constants
character escape codes3.6.1.1 Strings
character, single3.6.1.2 Characters
characters used in symbols3.4 Symbols
COFF auxiliary symbol information7.34 .dim
COFF structure debugging7.110 .tag structname
COFF symbol attributes5.5.4 Symbol Attributes for COFF
COFF symbol descriptor7.33 .desc symbol, abs-expression
COFF symbol storage class7.96 .scl class
COFF symbol typeCOFF Version
COFF symbols, debugging7.32 .def name
COFF value attribute7.115 .val addr
COMDAT7.70 .linkonce [type]
comm directive7.30 .comm symbol , length
command line conventions1.4 Command Line
command line options, V8509.6.1 Options
comments3.3 Comments
comments, removed by preprocessor3.1 Preprocessing
common sections7.70 .linkonce [type]
common variable storage4.5 bss Section
comparison expressions6.2.4 Infix Operators
conditional assembly7.60 .if absolute expression
constant, single character3.6.1.2 Characters
constants3.6 Constants
constants, bignum3.6.2.2 Bignums
constants, character3.6.1 Character Constants
constants, converted by preprocessor3.1 Preprocessing
constants, floating point3.6.2.3 Flonums
constants, integer3.6.2.1 Integers
constants, number3.6.2 Number Constants
constants, string3.6.1.1 Strings
crash of assembler10.1 Have You Found a Bug?
ctbp register, V8509.6.2.2 Register Names
ctoff pseudo-op, V8509.6.5 Opcodes
ctpc register, V8509.6.2.2 Register Names
ctpsw register, V8509.6.2.2 Register Names
current address5.4 The Special Dot Symbol
current address, advancing7.83 .org new-lc , fill

D
data and text sections, joining2.12 Join Data and Text Sections: `-R'
data directive7.31 .data subsection
data section4.2 Linker Sections
datalabel, SH649.5.2.3 Addressing Modes
dbpc register, V8509.6.2.2 Register Names
dbpsw register, V8509.6.2.2 Register Names
debuggers, and symbol order5. Symbols
debugging COFF symbols7.32 .def name
decimal integers3.6.2.1 Integers
def directive7.32 .def name
dependency tracking2.10 Dependency Tracking: `--MD'
deprecated directives7.123 Deprecated Directives
desc directive7.33 .desc symbol, abs-expression
descriptor, of a.out symbol5.5.3.1 Descriptor
difference tables altered7.122 .word expressions
difference tables, warning2.6 Difference Tables: `-K'
dim directive7.34 .dim
directives and instructions3.5 Statements
directives, machine independent7. Assembler Directives
dollar local symbolsDollar Local Labels
dot (symbol)5.4 The Special Dot Symbol
double directive7.35 .double flonums
double directive, RX9.3.4 Floating Point
doublequote (\")3.6.1.1 Strings

E
ecr register, V8509.6.2.2 Register Names
eight-byte integer7.92 .quad bignums
eipc register, V8509.6.2.2 Register Names
eipsw register, V8509.6.2.2 Register Names
eject directive7.36 .eject
ELF symbol typeELF Version
else directive7.37 .else
elseif directive7.38 .elseif
empty expressions6.1 Empty Expressions
end directive7.39 .end
endef directive7.40 .endef
endfunc directive7.41 .endfunc
endif directive7.42 .endif
endm directive7.77 .macro
EOF, newline must precede3.5 Statements
ep register, V8509.6.2.2 Register Names
equ directive7.43 .equ symbol, expression
equiv directive7.44 .equiv symbol, expression
eqv directive7.45 .eqv symbol, expression
err directive7.46 .err
error directive7.47 .error "string"
error messages1.7 Error and Warning Messages
error on valid input10.1 Have You Found a Bug?
errors, caused by warnings2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
errors, continuing after2.17 Generate Object File in Spite of Errors: `-Z'
escape codes, character3.6.1.1 Strings
exitm directive7.77 .macro
expr (internal section)4.3 Assembler Internal Sections
expression arguments6.2.1 Arguments
expressions6. Expressions
expressions, comparison6.2.4 Infix Operators
expressions, empty6.1 Empty Expressions
expressions, integer6.2 Integer Expressions
extern directive7.49 .extern

F
fail directive7.50 .fail expression
faster processing (`-f')2.4 Work Faster: `-f'
fatal signal10.1 Have You Found a Bug?
fepc register, V8509.6.2.2 Register Names
fepsw register, V8509.6.2.2 Register Names
file directive7.51 .file
file name, logicalDefault Version
files, including7.62 .include "file"
files, input1.5 Input Files
fill directive7.52 .fill repeat , size , value
filling memory7.102 .skip size , fill
filling memory7.104 .space size , fill
float directive7.53 .float flonums
float directive, RX9.3.4 Floating Point
floating point numbers3.6.2.3 Flonums
floating point numbers (double)7.35 .double flonums
floating point numbers (single)7.53 .float flonums
floating point numbers (single)7.100 .single flonums
floating point, H8/300 (IEEE)9.1.3 Floating Point
floating point, RX9.3.4 Floating Point
floating point, SH (IEEE)9.4.3 Floating Point
floating point, V850 (IEEE)9.6.3 Floating Point
flonums3.6.2.3 Flonums
format of error messages1.7 Error and Warning Messages
format of warning messages1.7 Error and Warning Messages
formfeed (\f)3.6.1.1 Strings
func directive7.54 .func name[,label]
functions, in expressions6.2.2 Operators

G
global directive7.55 .global symbol, .globl symbol
gp register, V8509.6.2.2 Register Names
grouping data4.4 Sub-Sections

H
H8/300 addressing modes9.1.2.3 Addressing Modes
H8/300 floating point (IEEE)9.1.3 Floating Point
H8/300 line comment character9.1.2.1 Special Characters
H8/300 line separator9.1.2.1 Special Characters
H8/300 machine directives (none)9.1.4 H8/300 Machine Directives
H8/300 opcode summary9.1.5 Opcodes
H8/300 options9.1.1 Options
H8/300 registers9.1.2.2 Register Names
H8/300 size suffixes9.1.5 Opcodes
H8/300 support9.1 H8/300 Dependent Features
H8/300H, assembling for9.1.4 H8/300 Machine Directives
hex character code (\xd...)3.6.1.1 Strings
hexadecimal integers3.6.2.1 Integers
hi pseudo-op, V8509.6.5 Opcodes
hi0 pseudo-op, V8509.6.5 Opcodes
hidden directive7.57 .hidden names
hilo pseudo-op, V8509.6.5 Opcodes
hword directive7.58 .hword expressions

I
ident directive7.59 .ident
if directive7.60 .if absolute expression
ifb directive7.60 .if absolute expression
ifc directive7.60 .if absolute expression
ifdef directive7.60 .if absolute expression
ifeq directive7.60 .if absolute expression
ifeqs directive7.60 .if absolute expression
ifge directive7.60 .if absolute expression
ifgt directive7.60 .if absolute expression
ifle directive7.60 .if absolute expression
iflt directive7.60 .if absolute expression
ifnb directive7.60 .if absolute expression
ifnc directive7.60 .if absolute expression
ifndef directive7.60 .if absolute expression
ifne directive7.60 .if absolute expression
ifnes directive7.60 .if absolute expression
ifnotdef directive7.60 .if absolute expression
incbin directive7.61 .incbin "file"[,skip[,count]]
include directive7.62 .include "file"
include directive search path2.5 .include Search Path: `-I' path
infix operators6.2.4 Infix Operators
input1.5 Input Files
input file linenumbersFilenames and Line-numbers
instruction summary, H8/3009.1.5 Opcodes
instruction summary, SH9.4.5 Opcodes
instruction summary, SH649.5.4 Opcodes
instructions and directives3.5 Statements
int directive7.63 .int expressions
int directive, H8/3009.1.4 H8/300 Machine Directives
integer expressions6.2 Integer Expressions
integer, 16-byte7.81 .octa bignums
integer, 8-byte7.92 .quad bignums
integers3.6.2.1 Integers
integers, 16-bit7.58 .hword expressions
integers, 32-bit7.63 .int expressions
integers, binary3.6.2.1 Integers
integers, decimal3.6.2.1 Integers
integers, hexadecimal3.6.2.1 Integers
integers, octal3.6.2.1 Integers
integers, one byte7.8 .byte expressions
internal assembler sections4.3 Assembler Internal Sections
internal directive7.64 .internal names
invalid input10.1 Have You Found a Bug?
invocation summary1. Overview
irp directive7.65 .irp symbol,values...
irpc directive7.66 .irpc symbol,values...
ISA options, SH649.5.1 Options

J
joining text and data sections2.12 Join Data and Text Sections: `-R'

L
label (:)3.5 Statements
labels5.1 Labels
lcomm directive7.67 .lcomm symbol , length
ld1.6 Output (Object) File
length of symbols3.4 Symbols
lflags directive (ignored)7.68 .lflags
line comment character3.3 Comments
line comment character, H8/3009.1.2.1 Special Characters
line comment character, M32C9.2.2.2 Special Characters
line comment character, RX9.3.5.1 Special Characters
line comment character, SH9.4.2.1 Special Characters
line comment character, SH649.5.2.1 Special Characters
line comment character, V8509.6.2.1 Special Characters
line directive7.69 .line line-number
line numbers, in input filesFilenames and Line-numbers
line numbers, in warnings/errors1.7 Error and Warning Messages
line separator character3.5 Statements
line separator, H8/3009.1.2.1 Special Characters
line separator, M32C9.2.2.2 Special Characters
line separator, RX9.3.5.1 Special Characters
line separator, SH9.4.2.1 Special Characters
line separator, SH649.5.2.1 Special Characters
line separator, V8509.6.2.1 Special Characters
lines starting with #3.3 Comments
linker1.6 Output (Object) File
linker, and assembler4.1 Background
linkonce directive7.70 .linkonce [type]
list directive7.71 .list
listing control, turning off7.80 .nolist
listing control, turning on7.71 .list
listing control: new page7.36 .eject
listing control: paper size7.89 .psize lines , columns
listing control: subtitle7.95 .sbttl "subheading"
listing control: title line7.112 .title "heading"
listings, enabling2.1 Enable Listings: `-a[cdghlns]'
ln directive7.72 .ln line-number
lo pseudo-op, V8509.6.5 Opcodes
loc directive7.73 .loc fileno lineno [column] [options]
loc_mark_labels directive7.74 .loc_mark_labels enable
local common symbols7.67 .lcomm symbol , length
local directive7.75 .local names
local labelsLocal Labels
local symbol namesLocal Symbol Names
local symbols, retaining in output2.7 Include Local Symbols: `-L'
location counter5.4 The Special Dot Symbol
location counter, advancing7.83 .org new-lc , fill
logical file nameDefault Version
logical line number7.69 .line line-number
logical line numbers3.3 Comments
long directive7.76 .long expressions
longcall pseudo-op, V8509.6.5 Opcodes
longjump pseudo-op, V8509.6.5 Opcodes
lp register, V8509.6.2.2 Register Names

M
M16C architecture option9.2.1 M32C Options
M32C architecture option9.2.1 M32C Options
M32C line comment character9.2.2.2 Special Characters
M32C line separator9.2.2.2 Special Characters
M32C modifiers9.2.2.1 Symbolic Operand Modifiers
M32C options9.2.1 M32C Options
M32C support9.2 M32C Dependent Features
machine dependencies9. Machine Dependent Features
machine directives, H8/300 (none)9.1.4 H8/300 Machine Directives
machine directives, SH9.4.4 SH Machine Directives
machine directives, SH649.5.3 SH64 Machine Directives
machine directives, V8509.6.4 V850 Machine Directives
machine independent directives7. Assembler Directives
machine instructions (not covered)1.1 Structure of this Manual
machine-independent syntax3. Syntax
macro directive7.77 .macro
macros7.77 .macro
macros, count executed7.77 .macro
make rules2.10 Dependency Tracking: `--MD'
manual, structure and purpose1.1 Structure of this Manual
Maximum number of continuation lines2.8 Configuring listing output: `--listing'
merging text and data sections2.12 Join Data and Text Sections: `-R'
messages from assembler1.7 Error and Warning Messages
minus, permitted arguments6.2.4 Infix Operators
mnemonics, H8/3009.1.5 Opcodes
mnemonics, SH9.4.5 Opcodes
mnemonics, SH649.5.4 Opcodes
modifiers, M32C9.2.2.1 Symbolic Operand Modifiers
MRI compatibility mode2.9 Assemble in MRI Compatibility Mode: `-M'
mri directive7.78 .mri val
MRI mode, temporarily7.78 .mri val

N
named section7.97 .section name
named sections4.2 Linker Sections
names, symbol5.3 Symbol Names
naming object file2.11 Name the Object File: `-o'
new page, in listings7.36 .eject
newline (\n)3.6.1.1 Strings
newline, required at file end3.5 Statements
nolist directive7.80 .nolist
null-terminated strings7.6 .asciz "string"...
number constants3.6.2 Number Constants
number of macros executed7.77 .macro
numbered subsections4.4 Sub-Sections
numbers, 16-bit7.58 .hword expressions
numeric values6. Expressions

O
object attributes8. Object Attributes
object file1.6 Output (Object) File
object file format1.3 Object File Formats
object file name2.11 Name the Object File: `-o'
object file, after errors2.17 Generate Object File in Spite of Errors: `-Z'
obsolescent directives7.123 Deprecated Directives
octa directive7.81 .octa bignums
octal character code (\ddd)3.6.1.1 Strings
octal integers3.6.2.1 Integers
offset directive7.82 .offset loc
offset directive, V8509.6.4 V850 Machine Directives
opcode summary, H8/3009.1.5 Opcodes
opcode summary, SH9.4.5 Opcodes
opcode summary, SH649.5.4 Opcodes
opcodes for V8509.6.5 Opcodes
operands in expressions6.2.1 Arguments
operator precedence6.2.4 Infix Operators
operators, in expressions6.2.2 Operators
operators, permitted arguments6.2.4 Infix Operators
option summary1. Overview
options for V850 (none)9.6.1 Options
options, all versions of assembler2. Command-Line Options
options, command line1.4 Command Line
options, H8/3009.1.1 Options
options, M32C9.2.1 M32C Options
options, RX9.3.1 RX Options
options, SH9.4.1 Options
options, SH649.5.1 Options
org directive7.83 .org new-lc , fill
other attribute, of a.out symbol5.5.3.2 Other
output file1.6 Output (Object) File

P
p2align directive7.84 .p2align[wl] abs-expr, abs-expr, abs-expr
p2alignl directive7.84 .p2align[wl] abs-expr, abs-expr, abs-expr
p2alignw directive7.84 .p2align[wl] abs-expr, abs-expr, abs-expr
padding the location counter7.3 .align abs-expr, abs-expr, abs-expr
padding the location counter given a power of two7.84 .p2align[wl] abs-expr, abs-expr, abs-expr
padding the location counter given number of bytes7.7 .balign[wl] abs-expr, abs-expr, abs-expr
page, in listings7.36 .eject
paper size, for listings7.89 .psize lines , columns
paths for .include2.5 .include Search Path: `-I' path
patterns, writing in memory7.52 .fill repeat , size , value
plus, permitted arguments6.2.4 Infix Operators
popsection directive7.85 .popsection
precedence of operators6.2.4 Infix Operators
precision, floating point3.6.2.3 Flonums
prefix operators6.2.3 Prefix Operator
preprocessing3.1 Preprocessing
preprocessing, turning on and off3.1 Preprocessing
previous directive7.86 .previous
primary attributes, COFF symbols5.5.4.1 Primary Attributes
print directive7.87 .print string
protected directive7.88 .protected names
pseudo-ops, machine independent7. Assembler Directives
psize directive7.89 .psize lines , columns
psw register, V8509.6.2.2 Register Names
purgem directive7.90 .purgem name
purpose of GNU assembler1.2 The GNU Assembler
pushsection directive7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]

Q
quad directive7.92 .quad bignums

R
register names, H8/3009.1.2.2 Register Names
register names, V8509.6.2.2 Register Names
registers, SH9.4.2.2 Register Names
registers, SH649.5.2.2 Register Names
reloc directive7.93 .reloc offset, reloc_name[, expression]
relocation4. Sections and Relocation
relocation example4.2 Linker Sections
reporting bugs in assembler10. Reporting Bugs
rept directive7.94 .rept count
RX assembler directive .3byte9.3.3 Assembler Directives
RX assembler directives9.3.3 Assembler Directives
RX floating point9.3.4 Floating Point
RX line comment character9.3.5.1 Special Characters
RX line separator9.3.5.1 Special Characters
RX modifiers9.3.2 Symbolic Operand Modifiers
RX options9.3.1 RX Options
RX support9.3 RX Dependent Features

S
sbttl directive7.95 .sbttl "subheading"
scl directive7.96 .scl class
sdaoff pseudo-op, V8509.6.5 Opcodes
search path for .include2.5 .include Search Path: `-I' path
section directive (COFF version)COFF Version
section directive (ELF version)ELF Version
section directive, V8509.6.4 V850 Machine Directives
Section Stack7.85 .popsection
Section Stack7.86 .previous
Section Stack7.91 .pushsection name [, subsection] [, "flags"[, @type[,arguments]]]
Section StackELF Version
Section Stack7.108 .subsection name
section-relative addressing4.1 Background
sections4. Sections and Relocation
sections in messages, internal4.3 Assembler Internal Sections
sections, named4.2 Linker Sections
set directive7.98 .set symbol, expression
SH addressing modes9.4.2.3 Addressing Modes
SH floating point (IEEE)9.4.3 Floating Point
SH line comment character9.4.2.1 Special Characters
SH line separator9.4.2.1 Special Characters
SH machine directives9.4.4 SH Machine Directives
SH opcode summary9.4.5 Opcodes
SH options9.4.1 Options
SH registers9.4.2.2 Register Names
SH support9.4 Renesas / SuperH SH Dependent Features
SH64 ABI options9.5.1 Options
SH64 addressing modes9.5.2.3 Addressing Modes
SH64 ISA options9.5.1 Options
SH64 line comment character9.5.2.1 Special Characters
SH64 line separator9.5.2.1 Special Characters
SH64 machine directives9.5.3 SH64 Machine Directives
SH64 opcode summary9.5.4 Opcodes
SH64 options9.5.1 Options
SH64 registers9.5.2.2 Register Names
SH64 support9.5 SuperH SH64 Dependent Features
short directive7.99 .short expressions
single character constant3.6.1.2 Characters
single directive7.100 .single flonums
sixteen bit integers7.58 .hword expressions
sixteen byte integer7.81 .octa bignums
size directive (COFF version)COFF Version
size directive (ELF version)ELF Version
size suffixes, H8/3009.1.5 Opcodes
skip directive7.102 .skip size , fill
sleb128 directive7.103 .sleb128 expressions
SOM symbol attributes5.5.5 Symbol Attributes for SOM
source program1.5 Input Files
sp register, V8509.6.2.2 Register Names
space directive7.104 .space size , fill
space used, maximum for assembly2.13 Display Assembly Statistics: `--statistics'
stabd directive7.105 .stabd, .stabn, .stabs
stabn directive7.105 .stabd, .stabn, .stabs
stabs directive7.105 .stabd, .stabn, .stabs
stabx directives7.105 .stabd, .stabn, .stabs
standard assembler sections4.1 Background
standard input, as input file1.4 Command Line
statement separator character3.5 Statements
statement separator, H8/3009.1.2.1 Special Characters
statement separator, M32C9.2.2.2 Special Characters
statement separator, RX9.3.5.1 Special Characters
statement separator, SH9.4.2.1 Special Characters
statement separator, SH649.5.2.1 Special Characters
statement separator, V8509.6.2.1 Special Characters
statements, structure of3.5 Statements
statistics, about assembly2.13 Display Assembly Statistics: `--statistics'
stopping the assembly7.1 .abort
string constants3.6.1.1 Strings
string directive7.106 .string "str", .string8 "str", .string16
string literals7.5 .ascii "string"...
string, copying to object file7.106 .string "str", .string8 "str", .string16
string16 directive7.106 .string "str", .string8 "str", .string16
string16, copying to object file7.106 .string "str", .string8 "str", .string16
string32 directive7.106 .string "str", .string8 "str", .string16
string32, copying to object file7.106 .string "str", .string8 "str", .string16
string64 directive7.106 .string "str", .string8 "str", .string16
string64, copying to object file7.106 .string "str", .string8 "str", .string16
string8 directive7.106 .string "str", .string8 "str", .string16
string8, copying to object file7.106 .string "str", .string8 "str", .string16
struct directive7.107 .struct expression
structure debugging, COFF7.110 .tag structname
subexpressions6.2.1 Arguments
subsection directive7.108 .subsection name
subtitles for listings7.95 .sbttl "subheading"
subtraction, permitted arguments6.2.4 Infix Operators
summary of options1. Overview
supporting files, including7.62 .include "file"
suppressing warnings2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
symbol attributes5.5 Symbol Attributes
symbol attributes, a.out5.5.3 Symbol Attributes: a.out
symbol attributes, COFF5.5.4 Symbol Attributes for COFF
symbol attributes, SOM5.5.5 Symbol Attributes for SOM
symbol descriptor, COFF7.33 .desc symbol, abs-expression
symbol modifiers9.2.2.1 Symbolic Operand Modifiers
symbol modifiers9.3.2 Symbolic Operand Modifiers
symbol names5.3 Symbol Names
symbol names, `$' in9.4.2.1 Special Characters
symbol names, `$' in9.5.2.1 Special Characters
symbol names, localLocal Symbol Names
symbol names, temporaryLocal Labels
symbol storage class (COFF)7.96 .scl class
symbol type5.5.2 Type
symbol type, COFFCOFF Version
symbol type, ELFELF Version
symbol value5.5.1 Value
symbol value, setting7.98 .set symbol, expression
symbol values, assigning5.2 Giving Symbols Other Values
symbol versioning7.109 .symver
symbol, common7.30 .comm symbol , length
symbol, making visible to linker7.55 .global symbol, .globl symbol
symbolic debuggers, information for7.105 .stabd, .stabn, .stabs
symbols5. Symbols
symbols, assigning values to7.43 .equ symbol, expression
symbols, local common7.67 .lcomm symbol , length
symver directive7.109 .symver
syntax, machine-independent3. Syntax
syntax, RX9.3.2 Symbolic Operand Modifiers

T
tab (\t)3.6.1.1 Strings
tag directive7.110 .tag structname
tdaoff pseudo-op, V8509.6.5 Opcodes
temporary symbol namesLocal Labels
text and data sections, joining2.12 Join Data and Text Sections: `-R'
text directive7.111 .text subsection
text section4.2 Linker Sections
time, total for assembly2.13 Display Assembly Statistics: `--statistics'
title directive7.112 .title "heading"
tp register, V8509.6.2.2 Register Names
trusted compiler2.4 Work Faster: `-f'
turning preprocessing on and off3.1 Preprocessing
type directive (COFF version)COFF Version
type directive (ELF version)ELF Version
type of a symbol5.5.2 Type

U
ualong directive, SH9.4.4 SH Machine Directives
uaword directive, SH9.4.4 SH Machine Directives
uleb128 directive7.114 .uleb128 expressions
undefined section4.2 Linker Sections

V
V850 command line options9.6.1 Options
V850 floating point (IEEE)9.6.3 Floating Point
V850 line comment character9.6.2.1 Special Characters
V850 line separator9.6.2.1 Special Characters
V850 machine directives9.6.4 V850 Machine Directives
V850 opcodes9.6.5 Opcodes
V850 options (none)9.6.1 Options
V850 register names9.6.2.2 Register Names
V850 support9.6 v850 Dependent Features
val directive7.115 .val addr
value attribute, COFF7.115 .val addr
value of a symbol5.5.1 Value
version directive7.116 .version "string"
version of assembler2.15 Announce Version: `-v'
versions of symbols7.109 .symver
visibility7.57 .hidden names
visibility7.64 .internal names
visibility7.88 .protected names
vtable_entry directive7.117 .vtable_entry table, offset
vtable_inherit directive7.118 .vtable_inherit child, parent

W
warning directive7.119 .warning "string"
warning for altered difference tables2.6 Difference Tables: `-K'
warning messages1.7 Error and Warning Messages
warnings, causing error2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
warnings, suppressing2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
warnings, switching on2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
weak directive7.120 .weak names
weakref directive7.121 .weakref alias, target
whitespace3.2 Whitespace
whitespace, removed by preprocessor3.1 Preprocessing
Width of continuation lines of disassembly output2.8 Configuring listing output: `--listing'
Width of first line disassembly output2.8 Configuring listing output: `--listing'
Width of source line output2.8 Configuring listing output: `--listing'
word directive7.122 .word expressions
word directive, H8/3009.1.4 H8/300 Machine Directives
writing patterns in memory7.52 .fill repeat , size , value

Z
zdaoff pseudo-op, V8509.6.5 Opcodes
zero register, V8509.6.2.2 Register Names
zero-terminated strings7.6 .asciz "string"...

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] [ ? ]

Footnotes

(1)

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.

(2)

Any more details?


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

Short Table of Contents

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] [ ? ]

About this document

This document was generated by prafull on February, 16 2012 using texi2html

The buttons in the navigation panels have the following meaning:

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  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

This document was generated on February, 16 2012 using texi2html