Experiment No. 02: Program
Experiment No. 02: Program
02
Objective: To generate the machine codes of a sample program, execute it and verify the
results.
Program:
In this experiment, we shall execute a simple assembly language program. This program
consists of one addition, one subtraction, one increment and decrement instructions. At first
we will generate the machine code and then observe different registers of 8086 to verify
results, after execution of each instruction. Here is our program:
CODE SEGMENT
ASSUME CS:CODE, DS:CODE
MOV AX, 805EH
MOV DX, 0540H
ADD AX, DX
MOV BX, 0050H
SUB AX, BX
INC DX
DEC BX
HLT
CODE ENDS
END
Experiment Procedures:
1. Generate the machine code of the above assembly language programming using
emu8086 emulator.
2. Write the machine codes in the appropriate memory address according to the following
table:
5. Execute this program in single step. Observe the register contents after execution
of each instruction and note down in the data table. Perform theoretical calculations and
verify results.
Report:
1. Discuss the effect of each instruction/ mnemonics that is used in this program.