Procedure For Masm Debuger

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Procedure for doing debug program:

Step1: Open the dosbox icon placed in the desktop

Step 2: type the following mount c c:\8086 and press enter then dos box will be mounted to the local
directory.

Step 3: type c: and press enter You will be getting the screen as: c:\

Step4: Now Type debug ,and press enter Now you are going to get hyphen symbol

Step5: Type a ,and press enter Type your program as shown in the attachment.

Step6: Type R IP ,and press enter The instruction pointer should point to the starting address of the
program. If not , type the starting address of the program.For Example, 0100

Step7: We need to do single step execution.

For single step execution: type t as shown in the attachment. Till in the end of the program we need to
repeat.

Download all these files in a folder. Name the folder as 8086. Copy the 8086 folder in c drive. After
copying, close the window.

Procedure for doing masm program:


Step1: Open the dosbox icon placed in the desktop
Step 2: type the following mount c c:\8086 and press enter then dos box will be mounted to
the local directory.
Step 3: type c: and press enter You will be getting the screen as: c:\
Step4: Now Type Edit A new window is opened now. Type the program in the window. Save
it as "Filename.ASM" and save. Note : Give your own Filename.
Step5: Check for errors and warnings. using MASM Filename.ASM , and press enter If errors
and warnings correct them by going to the edit . Repeat this process until there are 0 errors
and 0 warnings. When you get 0 errors and 0 warnings, Filename.obj is created.
Step6: When they are 0 errors and 0 warnings, type the following: LINK Filename.obj , and
press enter Now Filename.exe is created.
Step7: Now type: DEBUG Filename.exe , and press enter Now you are going to get hyphen
symbol –
Step 8: type t (Single Step Execution) Till the completion of the program you need to repeat.
https://www.youtube.com/watch?v=0BSbzjHej-E

https://drive.google.com/file/d/0B001eXddyriFbFBhclB5QmVvaVE/view

https://drive.google.com/file/d/1kVNLtKqjkgpPk3nf1keHvnHaGaTxiFrO/view

Dosbox:

https://www.dosbox.com/

Addition

.MODEL SMALL

.STACK

.DATA

IN1 DB 45H

IN2 DB 23H

RES DB 01H DUP(?)

.CODE

MOV AX,@DATA

MOV DS,AX

MOV AL,IN1

MOV BL,IN2

ADD AL,BL

MOV RES,AL

INT 21H

END

Subtraction

.MODEL SMALL

.STACK

.DATA
IN1 DB 25H

IN2 DB 15H

RES DB 01H DUP(?)

.CODE

MOV AX,@DATA

MOV DS,AX

MOV AL,IN1

MOV BL,IN2

SUB AL,BL

MOV RES,AL

INT 21H

END

Multiplication

.MODEL SMALL

.STACK

.DATA

IN1 DB 05H

IN2 DB 04H

RES DW 01H DUP(?)

.CODE

MOV AX,@DATA

MOV DS,AX

MOV AL,IN1

MOV BL,IN2

MOV AH,00H

MUL BL

MOV RES,AX
INT 21H

END

Division

.MODEL SMALL

.STACK

.DATA

IN1 DB 20H

IN2 DB 05H

RES DW 01H DUP(?)

.CODE

MOV AX,@DATA

MOV DS,AX

MOV AL,IN1

MOV BL,IN2

MOV AH,00H

DIV BL

MOV RES,AX

INT 21H

END

You might also like