My understanding is that a compiler converts the high level language into machine code. I have a question as to whether a compiler(say VC++) in-turn uses an assembler too? I remember seeing assembly code, whenever there is a crash or something like that.
My understanding is that a compiler converts the high level language into machine code.
Share
It depends on the compiler; many compilers can compile to assembly. For instance, if you pass the ‘-S’ flag to gcc, like:
That will output assembly for your test.c file into the file test.S which you can look at. (I recommend using -O0 if you’re gonna be trying to read the assembly, because compiler optimizations in there will likely confuse the heck out of you).
Since you mentioned Visual C++ in your question, Paul Dixon points out below that Visual C++ uses the /FA flag to accomplish the same thing.