【发布时间】:2010-12-21 12:24:47
【问题描述】:
我想使用 Microsoft VC++ 编译器从 C++ 源代码生成汇编代码。我想在命令行本身中执行此操作。不是来自 IDE。
什么是命令/选项?
【问题讨论】:
标签: visual-studio visual-c++ assembly
我想使用 Microsoft VC++ 编译器从 C++ 源代码生成汇编代码。我想在命令行本身中执行此操作。不是来自 IDE。
什么是命令/选项?
【问题讨论】:
标签: visual-studio visual-c++ assembly
我相信这就是/FA switch 的用途。
【讨论】:
/c(编译但不是链接),如果您真的不想要.obj 文件,那么您可以使用/Fonul 将其重定向到nul(但是我认为它仍然会花时间构建它)。
在http://msdn.microsoft.com/en-us/library/367y26c6.aspx
你可以使用“/FA /Fa”选项你可以使用..
那里的文件,
CL /FAcs HELLO.CPP
/FA Assembly code; .asm
/FAc Machine and assembly code; .cod
/FAs Source and assembly code; .asm
If /FAcs is specified, the file extension will be .cod
/FAu Causes the output file to be created in UTF-8 format,
with a byte order marker.
By default, the file encoding is ANSI,
but use /FAu if you want a listing file that displays correctly on any system,
or if you are using Unicode source code files as input to the compiler.
If /FAsu is specified, and if a source code file uses Unicode encoding other than UTF-8,
then the code lines in the .asm file may not display correctly.
【讨论】: