0% found this document useful (0 votes)
136 views2 pages

Familiarization of Masm

This document provides information on familiarizing oneself with the Microsoft Macro Assembler (MASM). It discusses that MASM uses Intel syntax and has versions for 16-bit, 32-bit, and 64-bit assembly. The document then outlines steps to install MASM via DOSBox, create an assembly file, run and debug the file. It also provides an alternate method and discusses the INT 21H interrupt for common DOS functions.

Uploaded by

Pewdiepie Felix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views2 pages

Familiarization of Masm

This document provides information on familiarizing oneself with the Microsoft Macro Assembler (MASM). It discusses that MASM uses Intel syntax and has versions for 16-bit, 32-bit, and 64-bit assembly. The document then outlines steps to install MASM via DOSBox, create an assembly file, run and debug the file. It also provides an alternate method and discusses the INT 21H interrupt for common DOS functions.

Uploaded by

Pewdiepie Felix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

FAMILIARIZATION OF MASM

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax
for MS-DOS and Microsoft Windows. Beginning with MASM 8.0, there are two versions
of the assembler: One for 16-bit & 32-bit assembly sources, and another (ML64) for 64-
bit sources only. MASM is maintained by Microsoft, but since version 6.12 it has not
been sold as a separate product. It is instead supplied with various Microsoft SDKs and
C compilers. Recent versions of MASM are included with Microsoft Visual Studio.

Steps to install and use MASM assembler


Setup DOSBox on your OS
2. Download 8086.rar
3. Setup 8086.rar
Open the zip file that you downloaded in step 2.
Copy the 8086 folders in drive C:
4.Create Assembly file (.asm)

i. Take notepad
ii. Type an 8086 program
iii. Save the file as <filename>.asm and save in All files at 8086 folder 
5. Run Assembly file (.asm) in Windows
6. Open DOSBox by clicking on it.
Enter the following command in DOSBox
Z:> mount c c:\8086

Then, execute the following command to navigate into drive CZ:> c:


If you want to write a new assembly file, execute the following command C:> edit
file_name.asm
If you already have the Assembly file, do the following steps

Copy your Assembly file to the “C:/8086” folder (remember the name)
Then execute the following to run that fileC:> masm your_file_here.asm
C:> link your_file_here.obj
C:> your_file_here.exe
9. To debug :
debug <filename>.exe
10. To quit
-q

Alternate way to run the program : follow steps 1- 4 ii


5. Then save file in MASM 615/BIN folder (available from the file server)
6. Run Assembly file (.asm) in Windows
i. masm <filename>.asm
This will create a .obj file
ii. ml <filename.asm>          
This will create an .exe file
iii. Copy it to \8086\<filename.exe>
7. Open DOSBox by clicking on it.
Enter the following command in DOSBox

Z:> mount c c:\8086


Then, execute the following command to navigate into drive C
Z:> c:

8. <filename>.exe
9. To debug :
debug <filename>.exe
10. To quit
-q

INT 21H
Int 21h is a dos interrupt. It is one of the most commonly used interrupt while writing code in 8086
assembly language. To use the dos interrupt 21h load ah with the desired sub-function. load
other required parameters in other registers. and make a call to int 21h.
Some common int 21h functions:

Function
Description
Number
AH=01h READ CHARACTER FROM STANDARD INPUT, WITH ECHO
AH=02h WRITE CHARACTER TO STANDARD OUTPUT
AH=05h WRITE CHARACTER TO PRINTER
AH=06h DIRECT CONSOLE OUTPUT
AH=07h DIRECT CHARACTER INPUT, WITHOUT ECHO
AH=08h CHARACTER INPUT WITHOUT ECHO
AH=09h WRITE STRING TO STANDARD OUTPUT
AH=0Ah BUFFERED INPUT
AH=0Bh GET STDIN STATUS
AH=0Ch FLUSH BUFFER AND READ STANDARD INPUT
AH=0Dh DISK RESET
AH=0Eh SELECT DEFAULT DRIVE
AH=19h GET CURRENT DEFAULT DRIVE
AH=25h SET INTERRUPT VECTOR
 

You might also like