简体   繁体   English

Visual Studio C ++:看到ASM代码?

[英]Visual Studio C++: Seeing the ASM code?

I'd like to see all the asm produced by Visual Studio C++ to learn a bit about ASM, compilers, etc. I know with GCC, you can do it with the -S argument, but not in VS. 我想看看Visual Studio C ++生成的所有asm,以了解ASM,编译器等等。我知道GCC,你可以使用-S参数,但不能在VS中。 How do I go about doing this? 我该怎么做呢?

The easiest way to do this is to start your program in the integrated debugger, then turn on the assembly language view. 最简单的方法是在集成调试器中启动程序,然后打开汇编语言视图。 This shows the assembly language interleaved with your original source code. 这显示汇编语言与原始源代码交错。

Back when I used VS, this was Alt+F7 or something but it's probably changed. 当我使用VS时,这是Alt + F7或其他东西,但它可能已经改变了。 The advantage of doing this (over using -S equivalent) is you can focus on exactly which line(s) of code you're interested in. 这样做的好处(过度使用-S等价物)是您可以专注于您感兴趣的代码行。

Right-click on your project and then Properties -> C/C++ -> Output files -> Assembler Output and set it to something else than No Listing. 右键单击您的项目,然后单击属性 - > C / C ++ - >输出文件 - >汇编输出,并将其设置为除无列表之外的其他内容。 Equivalently, you can add one of the /FA switches to the compiler's command line. 同样,您可以将其中一个/ FA开关添加到编译器的命令行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM