Chapter 23. Overview

Table of Contents
23.1. The Assembler
23.2. Object File Formats
23.3. Command Line
23.4. Input Files
23.5. Output (Object) File
23.6. Error and Warning Messages

Here is a brief summary of how to invoke the assembler. For details, see Chapter 24.

m1750-coff-as [ -a[dhlns][=file] ] [ -D ]  [ --defsym sym=val ]
[ -f ] [ --help ] [ -I dir ] [ -J ] [ -K ] [ -L ]
[ -o objfile ] [ -R ] [ --statistics ] [ -v ] [ -version ]
[ --version ] [ -W ] [ -w ] [ -x ] [ -Z ]
[ -ACBA | -ACCA | -Av7]
[ -- | files ... ]
-a[dhlns]

Turn on listings, in any of a variety of ways:

-ad

omit debugging directives

-ah

include high-level source

-al

include assembly

-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”—that is, all listings turned on.

-D

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

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

-f

"fast"--skip white-space and comment preprocessing (assume source is compiler output).

--help

Print a summary of the command line 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 (in the symbol table) local symbols, starting with “L”.

.o objfile

Name the object-file output from the assembler objfile.

-R

Fold the data section into the text section.

--statistics

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

-v, -version

Print the as version.

--version

Print the as version and exit.

-W

Suppress warning messages.

-w

Ignored.

-x

Ignored.

-Z

Generate an object file even after errors.

-- | files ...

Standard input, or source files to assemble.

23.1. The Assembler

The GNU assembler is really a family of assemblers. If you 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.

The assembler is primarily intended to assemble the output of the compiler for use by the linker. Nevertheless, we've tried to make the assembler assemble correctly everything that other assemblers for the same machine would assemble.

Unlike older assemblers, the assembler 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 29.43).