迄今为止,对于C / C ++编程语言,我已经使用Code :: blocks程序来编写和编译程序。 不过,我需要知道如何通过Windows命令提示编译程序,因为我需要访问创build的汇编代码。 我的编译器是mingw32-gcc.exe,mingw32-g ++。exe
请阅读使用MinGW编译程序 – 新用户指南 。 要使gcc
生成汇编代码,请使用-S
选项:
-S Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified. By default, the assembler file name for a source file is made by replacing the suffix .c, .i, etc., with .s. Input files that don't require compilation are ignored.
祝你好运!
如果使用mingw作为gcc编译器安装了代码块,请按照下列步骤操作