How does one do this?
If I want to analyze how something is getting compiled, how would I get the emitted assembly code?
Here are the steps to see/print the assembly code of any C program on your Windows
console /terminal/ command prompt :
Write a C program in a C code editor like codeblocks and save it with an extention .c
Compile and run it.
Once run successfully, go to the folder where you have installed your gcc compiler and give the
following command to get a ' .s ' file of the ' .c' file
C:\ gcc> gcc -S complete path of the C file ENTER
An example command ( as in my case)
C:\gcc> gcc -S D:\Aa_C_Certified\alternate_letters.c
This outputs a ' .s' file of the original ' .c' file
4 . After this , type the following command
C;\gcc> cpp filename.s ENTER
Example command ( as in my case)
C;\gcc> cpp alternate_letters.s
This will print/output the entire Assembly language code of your C program.