Chapter 24. Assembler Command-Line Options

Table of Contents
24.1. Enable Listings: -a[cdhlns]
24.2. -D
24.3. Work Faster: -f
24.4. .include search path: -I path
24.5. Difference Tables: -K
24.6. Include Local Labels: -L
24.7. Name the Object File: -o
24.8. Join Data and Text Sections: -R
24.9. Display Assembly Statistics: --statistics
24.10. Announce Version: -v
24.11. Suppress Warnings: -W
24.12. Generate Object File in Spite of Errors: -Z

If you are invoking the assembler via the 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:

$ erc-coff-gcc -c -g -O -Wa,-alhd,-L file.c

emits a listing to standard output with high-level and assembly source.

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

24.1. Enable Listings: -a[cdhlns]

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 -ac option to omit false conditionals from a listing. Any lines that 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.