I understand that compilers convert c source code to assembly and then to machine code. I searched through every compiler setting I could find, and their website but I can't get it to generate assembly. Also, the website states that Dev-C++ uses AT&T assembly, can I also convert from that to Intel?
Asked
Active
Viewed 1.1k times
3
-
In general a C++ compiler has in its tool chain an assembler for embedded assembler, here `__asm("mov %ax,%dx") ; // move AX to DX`. There normally is no assembler output, and it would be AT&T style. In this case I would **disassemble** the object code to Intel assembler. – Joop Eggen Mar 05 '12 at 03:39
2 Answers
4
Dev-C++ seems to use GCC.
You can try this option: gcc -S -masm=intel
as answered in this question: How do you use gcc to generate assembly code in Intel syntax?
I do not know how to set command line options on Dev-C++ but guides can be easily found.
-
Where would that line be typed? It's not c language, so I assume it isn't just part of the source file but I don't know when and where I would type it into the command prompt either. – skidup Mar 05 '12 at 03:49
-
1@user1248980 gcc also does C++ (g++). You need to find a place in the IDE where compiler options are specified. It's unrelated to your sources. – Pubby Mar 05 '12 at 03:54
0
C:\Program Files (x86)\Dev-Cpp\MinGW32\bin>gcc -S -masm=intel try.cpp
Type this in command prompt(location of gcc depends on where you have install dev-C++),it will generate assembly file,in my case try.s

Anshul Negi
- 41
- 7