I am searching for a compiler or better IDE for C which could generate completely linked program, including functions from CRT, in assembler form. Is there any? I tried Visual C Express 2008. It has a disassembler, but its somewhat strange. I mean for some reason it shows many “strange” lines of code, such as mov a,#3 in about 100 lines…. It for study purposes. Thanks for tips.
I am searching for a compiler or better IDE for C which could generate
Share
gcc will generate ASM files. If you use
gcc -Wa,-adhln -g [source.c]gcc and as will interleave the C source lines with the generated assembly code.clang with LLVM will generate high quality ASM files.
Example:
This C function:
Becomes this ASM file:
When you do this, you will want optimizations OFF.
It is also possible to interleave the generated ASM code with the higher level source, such as the writer has done HERE.