Detailed steps to use Visual Studio 2019-- assembler debugging 32-bit code

Statement: This 32-bit MASM, code 16, 64 different

---------------------------------------------------------------------------------------------------------------------------

Encounter problems:

1、LINK 1104:

The Internet for a long time, does not solve the problem.

Solution:

Error message after clicking visual studio compiler: LINK 1104, see the official documentation

One of the reasons: The path is too long! (= =, Yes, is this)

I encountered are: to create a project in the path, the first document prepared by the normal operation, the compiler error after modifying the file name or create a new file: LINK 1104

My path is: D: \ project \ Git \ Assembly \ Assembly Language For x86 Processors \ chapter1

Modify the path: D: \ project \ Git \

no problem!

---------------------------------------------------------------------------------------------------------------------------------

1, download the official installer, install Community Edition

  2. Select: desktop development using C ++ (or choice: use game development in C ++)

    Choose an installation location, a total of about 8G, occupying more than my C drive 2. G (My OCD yelling)

 3, clone or code checked out

  log in

 

  and then, if there is no need to create a remote database, do not create it does not matter

 3, install extensions

  Incidentally, the installation code and then compiled highlighting

  

  4, first create a compilation project: AddTwo.asm (This is not what I want Helloworld!)

OK, on ​​the map

  Double-click or click "Next"

   The key to the generation --- Custom:

 Tick ​​masm (.targets, .props)

  

 来创建.asm文件,或者右键“源文件”--“添加”--“新建项”

   画重点:不要用“Add New File”扩展

 

  

  用插件快速创建的文件报错:

 then,回到正道:(为什么不用:ctrl+shift+A创建)

    Irvine 大佬的代码(学汇编可以看Assembly Language for x86 Processors的中文看版:《汇编语言 基于x86处理器》):

; AddTwo.asm - adds two 32-bit integers.
; Chapter 3 example

.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword

.code
main proc
    mov    eax,5                
    add    eax,6                

    invoke ExitProcess,0
main endp
end main

 OK!ctrl+F5,运行,走你!

 nice!

F5调试:

先打个断点

  来深入了解寄存器吧!

 如果没有寄存器窗口

 

 开启汇编二进制之旅!

wait! 还有一个 列表文件

  

  没有.lst后缀的列表文件

配置:

1、右键项目,属性

  2、配置

 3、重新运行(如果出现LNK 1104的错误,并且确定路径没问题,可以多尝试几次重新创建项目)

查看项目目录下:

 

  有了!它可以帮助更好的理解汇编代码。

 

Guess you like

Origin www.cnblogs.com/slothrbk/p/11706132.html