How to use masm and link to compile assembly files under 64-bit windows

Reprinted from: https://blog.csdn.net/my_precious/article/details/49964655


The 32-bit system has a debug program, which can debug assembly language and exe. But the real assembly programming is "edit assembler file (.asm) -> compile to generate obj file -> link to generate exe file". Below, I will talk about how to use masm to debug under windows, using the link link.

1. Download the corresponding software

 
Download masm.exe and link.exe, and extract (move) them to a custom directory (eg mine is d:\dos directory)

Personal sharing address: http://pan.baidu.com/s/1i5hUFdj

2, masm and link environment

If your system is 32-bit winxp or win7, you can enter the cmd interface and use the following commands to switch to the directory where masm and link are located: 

If your system is a 64-bit system, you cannot run it directly with cmd. At this time, we can use dosbox software. Regarding the use of this software, I have already introduced it in the previous article.

Open the dosbox software, virtualize a drive letter to the directory where masm and link are located, for example, virtualize the c drive into the d:\dos directory on the physical machine, and then jump to the virtual drive letter (folder) 
write picture description here

3. Use masm and link

First, use a text editor and other tools to write the assembly source program (*.asm) and save it in the directory where masm and link are located: 
 
then you can use masm and link: 
 

4. Follow-up

The exe executable file generated after linking can be debugged with debug, which will not be introduced due to space limitations. In addition, if you think it is troublesome to enter the mount command every time you start dosbox, you can modify the configuration file of dosbox. The location of the configuration file can be viewed in the dosbox startup window 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325937844&siteId=291194637