Contents|Index|Previous|Next
Assembler options for MIPS  

The following documentation discusses the assembler options for MIPS. To use the GNU assembler, as, to assemble gcc output, configure gcc with the switch, --with-gnu-as (in GNUPro Toolkit distributions) or with the option, -mgas. The assembler for MIPS architecture supports the MIPS R2000, R3000, and R4000 processors. Assembler options for listing output for MIPS

Use the following options to enable listing output from the assembler (the letters after -a may be combined into one option, such as -aln):

High-level listings require using a compiler debugging option like -g, and assembly listings (-al) also need to be requested.

Assembler listing-control directives for MIPS

Use the following listing-control assembler directives to control the appearance of the listing output (if you do not request listing output with one of the -a options, the following listing-control directives have no effect).
 

Assembler options for MIPS

The MIPS configurations of as support three special options, and accept one other for command-line compatibility. See Command-line options in Using as in GNUPro Utilities for information on the command-line options available with all configurations of the GNU assembler.
 

Assembler directives for debugging information for MIPS

MIPS ECOFF as supports several directives used for generating debugging information which are not supported by traditional MIPS assemblers:

    .def         .endef         .dim 
    .file        .scl           .size 
    .tag         .type          .val 
    .stabd       .stabn         .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 Assembler directives in Using as in GNUPro Utilities for full information on all GNU assembler directives.

MIPS ECOFF object code

The assembler supports some additional sections for a MIPS ECOFF target besides the usual .text, .data and .bss. The additional sections are:

Options for MIPS ECOFF object code Directives for MIPS ECOFF object code Registers used for integer arguments for MIPS
 
Arguments on MIPS architectures are not split, so that if a double word argument starts in R7, the entire word gets pushed onto the stack instead of being split between R7 and the stack.

If the first argument is an integer, the MIPS uses the following registers for all arguments.

The following calling convention for MIPS architectures depends on whether or not hardware floating-point is installed. Even if it is, the MIPS uses the registers for integer arguments whenever the first argument is an integer.

The MIPS uses the registers for floating-point arguments only for floating-point arguments and only if the first argument is a floating point.

The following calling convention for the MIPS also depends on whether you are using standard 32-bit mode or 64-bit mode; 32-bit mode only allows the MIPS to use even numbered registers, while 64-bit mode allows the MIPS to use both odd and even numbered registers.

Registers used for floating-point arguments for MIPS

If the first argument is a floating-point, the MIPS uses the following registers for floating-point arguments.

Calling conventions used for integer arguments for MIPS
 
The following conventions apply to integer arguments.

R0 is hardwired to the value 0. R1, which is also called AT, is reserved as the assembler’s temporary register. R26 through R29 and R31 have reserved uses. Registers R2 through R15, R24, and R25 can be used for temporary values.

When a function is compiled with the default options, it must return with R16 through R23 and R30 unchanged.

Calling conventions used for floating-point arguments for MIPS
 
The following conventions apply to floating-point arguments. None of the registers has a reserved use.


Top|Contents|Index|Previous|Next