Contents|Index|Previous|Next

Assembler options for SPARC

To use the GNU assembler, as, to assemble gcc output, configure gcc with the ‘--with-gnu-as’ switch (in GNUPro Toolkit distributions) or with the -mgas option, described in the following discussion.

-mgas
Compile using as to assemble gcc output.

-Wa
If you invoke as through 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 that you specify with ‘gcc -Wa’ must be separated by commas (the input, gcc, and the input, -Wa).

-L
The additional assembler option -L preserves local labels, which may make the listing output more intelligible to humans.

For example, in the following commandline, the assembler option, -ahl, requests a listing with interspersed high-level language and assembly language.

    $ sparc-coff-gcc -g -O -Wa,-alh,-L file.c

-L preserves local labels while the compiler debugging option, -g, gives the assembler the necessary debugging information.

Assembler options for listing output for SPARC and SPARClite

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

-a
By itself, -a requests listings of high-level language source, assembly language, and symbols.

-ah
Request a high-level language listing.

-al
Request an output-program assembly listing.

-as
Request a symbol table listing.

-ad
Omit debugging directives from the listing.

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

Assembler listing-control directives for SPARC and SPARClite

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

.list
Turn on listings from this point on.

.nolist
Turn off listings from this point on.

.psize linecount, columnwidth
Describe the page size for your output (the default is 60, 200). as generates form feeds after printing each group of linecount lines. To avoid these automatic form feeds, specify 0 as the linecount.

.eject
Skip to a new page (issue a form feed).

.title
Use heading as the title (this is the second line of the listing output, directly after the source file name and page number) when generating assembly listings.

.sbttl
Use subheading as the subtitle (this is the third line of the listing output, directly after the title line) when generating assembly listings.

-an
Turn off all forms processing.

Assembler options for the Fujitsu SPARClite

When configured for SPARC, the assembler recognizes the additional Fujitsu SPARClite machine instructions that GCC generates: -Asparclite.

A flag to the GNU assembler (configured for SPARC) explicitly selects this particular SPARC architecture. The SPARC assembler automatically selects the Fujitsu SPARClite architecture whenever it encounters one of the SPARClite-only instructions (divscc or scan).