簡單利用 Visual Studio 2005 產生 C/C++ 的 asm

  1. 開啟專案屬性(Project Properities)
    step 1
  2. 選擇 C/C++ -> Output Files -> Assembler Output
    step 2
  3. Output 的類型有四種:  step 3
    • Assembly-Only Listing。產生一個 *.asm 檔。檔案中只有組語,並有 ; Line 2 這類註解告訴我們,下列組語是從那一行轉換出來的。Assembly-Only Listing (FA)
    • Asssembly, Machine Code and Source (/FAcs) 。產生一個 *.cod (C/C++ code listing) 檔案,並有 ; 3 : int c = a + b; 這類註解,標示了原始碼,所以比較適合用在與原始碼的比較。另外也輸出 machine code ,就是那些四個十六進位一組的數字。Assembly, Machine Code and Source (FAcs)
    • Assembly with Machine Code。一樣是 *.cod 的輸出,註解沒有原始碼的嵌入,但有 machine code 。Assembly With Machine Code (FAc)
    • Aseembly with Source Code。因為沒有 machine code 的輸出需求,可以產生 *.asm 檔,版面更精簡了,也蠻適合用在與逐行研究 C/C++ -> assembly code 的比較。Assembly With Source Code (FAs)

P.S. 明眼人也知道這篇是騙文章數的…

沒有留言:

Windows + Visual Studio + VSCode + CMake 的疑難雜症

Environment Windows 10 Visual Studio 2019 CMake 3.27.7 VSCode VSCode CMake Tools 1. CMAKE_BUILD_TYPE 是空的 參考一下 這篇 的處理。 大致上因為 Visual...