[prog] assembly code translation of a C file

Mary mary-linuxchix at puzzling.org
Tue Nov 1 09:22:19 EST 2005


On Tue, Nov 01, 2005, Aslı  wrote:
> Do you a know a compiler that will show me the assembly  translation
> when i give it the C code ?

The GNU C compiler (gcc) will do this. You want the following options:
-S. This is described in the man page ("man gcc") as follows:

-S  Stop after the stage of compilation proper; do not assemble.
The output is in the form of an assembler code file for each
non-assembler input file specified.

By default, the assembler file name for a source file is made
by replacing the suffix .c, .i, etc., with .s.

Input files that don’t require compilation are ignored.

-Mary


More information about the Programming mailing list