I am trying to learn assembly language. I have searched and found how to disassemble a .c file but I think it produces some optimized version of the program. Is there any way so that I can see the exact assembly code which corresponds to my C file.
I am trying to learn assembly language. I have searched and found how to
Share
The gcc option
-Oenables different levels of optimization. Use-O0to disable them and use-Sto output assembly.-O3is the highest level of optimization.Starting with gcc 4.8 the optimization level
-Ogis available. It enables optimizations that do not interfere with debugging and is the recommended default for the standard edit-compile-debug cycle.To change the dialect of the assembly to either intel or att use
-masm=intelor-masm=att.You can also enable certain optimizations manually with
-fname.Have a look at the gcc manual for much more.