Reputation: 8472
I'm playing with Ansi C in visual studio, created the simple Ansi C program (I had to change VS configuration to not use cpp but ansi c)
int a = 0;
int b = 0;
printf("Hello World! \n\n");
system("PAUSE");
return 0;
I compiled it and it generated this:
First of all I was expecting a simple .exe and I don't know why this .ilk and .pdb were created but the question here is how can I see the assembly code generated by the compiled c program?
thanks
Upvotes: 1
Views: 97
Reputation: 3788
Use the Assembler Output
setting in the Project Properties.
You can request that Visual Studio show the assembly code for your compiled program by:
Properties
from the menu that appears.Configuration Properties
> C/C++
> Output Files
.Assembler Output
from No Listing
to Assembly with Source Code (/FAs)
Now you will have a project-name.asm
file, located in the Debug or Release subdirectory of your project directory. That is a text file displaying the source code of your program, and the assembly code that each line was converted into.
Upvotes: 0
Reputation: 490693
The .ilk
is an incremental linking file, which can help speed up linking when you make minor changes to your code, then re-link.
The .pdb
is a Program database--use when debugging.
To get the assembly language to which your code translates, you can compile with /Fa
.
Upvotes: 3