Visual C++ を使用してコードの背後にあるアセンブリを表示するにはどうすればよいでしょうか? 質問する

Visual C++ を使用してコードの背後にあるアセンブリを表示するにはどうすればよいでしょうか? 質問する

2 行のコードの効率に関する別の質問を読んでいたのですが、質問者はコードの背後にあるアセンブリを見て、2 行ともアセンブリ内で同一だったと述べています。余談はさておき、プログラムがコンパイルされたときに作成されるアセンブリ コードを表示するにはどうすればよいでしょうか。

I'm using Microsoft's Visual C++, but I would also like to know if it's possible to view the assembly behind code written in Visual Basic.

So, how do I view the assembly code behind a program written in higher level languages like C++ and Visual Basic?

ベストアンサー1

There are several approaches:

  1. You can normally see assembly code while debugging C++ in visual studio (and eclipse too). For this in Visual Studio put a breakpoint on code in question and when debugger hits it rigth click and find "Go To Assembly" ( or press CTRL+ALT+D )

  2. Second approach is to generate assembly listings while compiling. For this go to project settings -> C/C++ -> Output Files -> ASM List Location and fill in file name. Also select "Assembly Output" to "Assembly With Source Code".

  3. Compile the program and use any third-party debugger. You can use OllyDbg or WinDbg for this. Also you can use IDA (interactive disassembler). But this is hardcore way of doing it.

おすすめ記事