How to view the program code in assembler?

devC ++, windows 10 x64

  • one
    See your compiler keys. For example, gcc key -S generates assembly code - Mike

2 answers 2

You can use a disassembler , for example, such as IDA . If you are interested in what exactly your own code compiles (otherwise why would you label C ++? :)), then many compilers (if not all :) generate an assembler listing along with the object files. In Visual C ++, the / Fa key is used for this, in GCC, as far as I know, the -S key.

  • where do I need to write -S ? - Basik2003
  • @ vasek2003 and how do you run the compilation? - αλεχολυτ
  • @alexolut from ide directly, I found this parameter, but writes that it was not possible to start the program / component due to incompatibility with the 64-bit version of windows
  • @ vasek2003 what ide, OS etc? Describe all this by editing your question, not in the form of comments. So it will be more correct. - αλεχολυτ
  • @alexolut did - vasek2003

The simplest thing is to add the -save-temps option to the Compiler options -> Add the following commands when calling the compiler. Then the assembly code will be in files with the .s extension. Another option is to use the option -Wa,-adhln=test.s - then the assembly code will be in the file test.s.