You should use GNU as
to assemble GCC
output. To
ensure this, GCC
should be configured using the
`--with-gnu-as' switch (as it is in Cygnus distributions
). Alternatively, you can invoke GCC
with the -mgas
option.
GNU as
for MIPS architectures supports the MIPS R2000 and R3000
processors.
If you invoke as
via the GNU C compiler (version 2), you can use
the `-Wa' option to pass arguments through to the assembler. One
common use of this option is to exploit the assembler's listing
features. Assembler arguments you specify with gcc -Wa
must be
separated from each other (and the `-Wa') by commas. For example,
the `-alh' assembler option in the following commandline:
$ mips-idt-ecoff-gcc -c -g -O -Wa,-alh,-L file.c
requests a listing with high-level language and assembly language interspersed.
The example also illustrates two other convenient options to specify for assembler listings:
These are the options to enable listing output from the assembler. By itself, `-a' requests listings of high-level language source, assembly language, and symbols.
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.
You can use the `-ad' option to omit debugging directives from the listing.
When you specify one of these options, you can further control listing output and its appearance using these listing-control assembler directives:
.nolist
.list
.psize linecount , columnwidth
.eject
.title
.sbttl
If you do not request listing output with one of the `-a' options, these listing-control directives have no effect. You can also use the `-an' option to turn off all forms processing.
The letters after `-a' may be combined into one option, e.g., `-aln'.
The MIPS configurations of GNU as
support three special
options, and accept one other for command-line compatibility.
See section `Command-Line Options' in Using the GNU Assembler as, for information on the command-line options available with
all configurations of the GNU assembler.
-G num
gp
register. It is only accepted for targets
that use ECOFF format. The default value is 8.
-EB
-EL
as
can select big-endian or
little-endian output at run time (unlike the other GNU development
tools, which must be configured for one or the other). Use `-EB'
to select big-endian output, and `-EL' for little-endian.
-nocpp
as
, there is no need for `-nocpp', because the
GNU assembler itself never runs the C preprocessor.
MIPS ECOFF as
supports several directives used for generating
debugging information which are not supported by traditional MIPS
assemblers. These are .def
, .endef
, .dim
,
.file
, .scl
, .size
, .tag
, .type
,
.val
, .stabd
, .stabn
, and .stabs
. The
debugging information generated by the three .stab
directives can
only be read by GDB, not by traditional MIPS debuggers (this enhancement
is required to fully support C++ debugging). These directives are
primarily used by compilers, not assembly language programmers!
See section `Assembler Directives' in Using as, for
full information on all GNU as
directives.