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

LAB REPORT – 02

SUBMITTED TO
Sayeda Suaiba Anwar

SUBMITTED BY
Syed Faiyaz Rahman Samin
ID- 183002012
Department - CSE
 Experiment No- 02
To load the machine codes of a sample program to MDA-8086, execution of
instructions in single step mode and verification of result.

 Objective
The objectives of this experiment are-
1) To the learn the procedure of loading program in RAM of MDA-8086 in
“Machine Code” mode.
2) To load the program to MDA-8086,execute the program in single step mode
and verify the result.

 Instruction/Program
CODE SEGMENT
ASSUME CS: CODE ,DS : CODE
ORG 1000H
MOV AX,805EH
MOV DX,0540H
MOV CL,02H
MOV CH,91H
ADD AX,DX
MOV BX,0050H
SUB AX,BX
INC DL
DEC BX
XCHG CX,BX
HLT
CODE ENDS
 Experiment Procedures
1. Turn on the 8086 microprocessor kit
2. Set the address 0000H: 1000H in MDA-8086 Kit
3. Write the machine code in the appropriate memory address according the
following table-
Seg.Address Offset Address Machine Code Instruction
000H 1000 B8 805E MOV AX,805EH
000H 1003 BA 0540 MOV DX,0540H
000H 1006 B1 02 MOV CL,02H
000H 1008 B5 91 MOV CH,91H
000H 100A 03C2 ADD AX,DX
000H 100C BB 0050 MOV BX,0050H
000H 100F 2B C3 SUB AX,BX
000H 1011 FE C2 INC DL
000H 1013 4B DEC BX
000H 1014 87 CB XCHG CX,BX
000H 1016 F4 HLT
4. Execute the program in the single step using”STP”. Observe the register
contents after execution of each instruction and note down in the data table.
Perform the theorical calculation and verify results.
 Data Table
Instruction AX BX CX DX Set. Flag
MOV AX,805EH 805E 0000 0000 0000 t
MOV DX,0540H 805E 0000 0000 0540 t
MOV CL,02H 805E 0000 0002 0540 t
MOV CH,91H 805E 0000 9102 0540 t
ADD AX,DX 859E 0000 9102 0540 ts
MOV BX,0050H 859E 0050 9102 0540 ts
SUB AX,BX 854E 0050 9102 0540 tsp
INC DL 854E 0050 9102 0541 tp
DEC BX 854E 004F 9102 0541 ta
XCHG CX,BX 854E 9102 004F 0541 ta
HLT

You might also like