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 [Link] 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 "[Link]" and save. Note : Give your own Filename.
Step5: Check for errors and warnings. using MASM [Link] , 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, [Link] is created.
Step6: When they are 0 errors and 0 warnings, type the following: LINK [Link] , and
press enter Now [Link] is created.
Step7: Now type: DEBUG [Link] , 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.
[Link]
[Link]
[Link]
Dosbox:
[Link]
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