2.1.6. --asm

This option instructs the compiler to write a listing to a file of the disassembly of the machine code generated by the compiler.

Object code is generated when this option is selected. The link step is also performed, unless the -c option is chosen.

Note

To produce a disassembly of the machine code generated by the compiler, without generating object code, select -S instead of --asm.

Usage

The action of --asm, and the full name of the disassembly file produced, depends on the combination of options used:

Table 2.1. Compiling with the --asm option

Compiler optionAction
--asm

Writes a listing to a file of the disassembly of the compiled source.

The link step is also performed, unless the -c option is used.

The disassembly is written to a text file whose name defaults to the name of the input file with the filename extension .s.

--asm -c

As for --asm, except that the link step is not performed.

--asm --interleave

As for --asm, except that the source code is interleaved with the disassembly.

The disassembly is written to a text file whose name defaults to the name of the input file with the filename extension .txt.

--asm --multifile

As for --asm, except that the compiler produces empty object files for the files merged into the main file.

--asm -o filename

As for --asm, except that the object file is named filename.

The disassembly is written to the file filename.s.

The name of the object file must not have the filename extension .s. If the filename extension of the object file is .s, the disassembly is written over the top of the object file. This might lead to unpredictable results.


See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential