WINDOWS10 Building Assembly language development environment (using DOSBox and MASM32)

Source: Internet
Author: User

------------------------------------Copyright Information------------------------------------

This article links: http://blog.csdn.net/doniexun/article/details/45268365

This article author: windness copyright Note: This article for the author through the retrieval of online resources and according to personal development experience, all the references have been marked at the end of the text, reproduced please be sure to retain this copyright information!

------------------------------------Copyright Information------------------------------------


The best way to learn a language is to learn it in practice. For many beginners, the first thing to face is how to build the development platform/environment problems. Because of the particularity of assembly language, many beginners will worry that their operation directly on the register will lead to a system crash or system hardware damage, coupled with today's high-level programming language, the real need to write the situation of assembly language is not so much, So a lot of beginners assembly language students are still stuck in the state of the armchair.

I have been learning assembly language for the first time five years ago, but have not personally practiced, and recently work on the use of disassembly binaries, so plan to re-pick up the language you have learned in order to successfully complete the project at hand. The following is an assembly language development environment record based on Dosbox+masm32.


1 Tool Preparation

1) Download DOSBox

Tool Description: DOSBox is a DOS simulation program, because it uses the SDL library, so it can be easily ported to other platforms. Currently, DOSBox is supported in systems such as Windows, Linux, Mac OS X, BeOS, PalmOS, Android, WebOS, OS/2, and more. Many DOS games can be run directly on the platform.

Tools Website: http://www.dosbox.com/

Project home: http://sourceforge.net/projects/dosbox/

Download Link: http://sourceforge.net/projects/dosbox/files/dosbox/0.74/DOSBox0.74-win32-installer.exe/download (32-bit)

2) Download MASM32

Description:MASM32 is a software package compiled and compiled by Steve Hutchesson , a foreign MASM enthusiast, and is currently the highest version of 11R. MASM32 does not refer to Microsoft's MASM macro assembler, but rather contains a compilation development kit that is built with different versions of the tools. Its assembler compiler is a Ml.exe in MASM6.0 and above, and the resource compiler is a RC.EXE,32 bit linker in Microsoft Visual Studio that is Microsoft visual The Link.exe in studio includes other tools such as Lib.exe and DumpPe.exe.

Tools Website: http://www.masm32.com/

Download Link: http://www.masm32.com/downloads

Note: It is also possible to directly download the MASM tool compression package provided by the reference 3 author, which contains the necessary compilations, links, and Debugging tools (Baidu Web disk download).


2 Installation Tools

1) Install DOSBox

Install the downloaded Dosbox0.74-win32-installer.exe and complete the installation directly from next.

2) configuration DOSBox

Create a directory that holds assembly tools (such as MASM, Link, DEBUG, etc.) and assembly files (*.asm), such as: E:\DEBUG.

Open the installation root directory for DOSBox (default installation path: C:\Program files\dosbox-0.74), double-click File DOSBox 0.74 Options.bat, after running the batch file, the system will open the configuration file dosbox-0.74.conf with the text document Notepad.

Position the cursor to the [AUTOEXEC] node of the dosbox-0.74.conf file (typically at the end of the file) and add the following to the file:

Mount C D:\DEBUG                  # mount directory D:\DEBUG as DOSBox c:set path= $PATH $;D: \debug<span style= "White-space:pre" ></ Span>  # writes D:\DEBUG to the environment variable in path

3) Install MASM32

Unzip and install the downloaded Masm32v11r.zip, and install it by default.

After installation, you need to DEBUG.EXE, EDIT the assembly tool. EXE, LINK. EXE, MASM. EXE and other tools are copied to the E:\DEBUG folder.


3 Sample Programs

Run DOSBox, enter the command under command c:\>:edit file name. ASM, start EDIT.EXE Enter the code edit state, and enter the following sample program:

Code segmentassume Cs:codestart:mov Ax,5hmov bx,6hadd ax,bxmov ah,4chint 21hcode endsend start
After saving the file, return to the DOSBox command line and enter the command:MASMfile name. ASM, generate the target filefile name. OBJ(The target file name can be modified during the build process, and the direct carriage will keep the default target file name).

Input command:LINK file name. OBJ, the link is delivered as an executable file name. EXE.

Input command:DEBUG file name. EXE, you can debug the program.

4 references

1) MASM Baidu Encyclopedia: http://baike.baidu.com/view/1754206.htm

2) DOSBox Baidu Encyclopedia: http://baike.baidu.com/view/716885.htm

3) Write assembly language under Win8 with DOSBox: http://www.tuicool.com/articles/v2A3mm




WINDOWS10 Building Assembly language development environment (using DOSBox and MASM32)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.