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

Experiment No. 02: Program

The document describes an experiment to generate machine code from an assembly language program, execute it step-by-step, and verify the results by observing register contents. The program contains instructions for addition, subtraction, increment, and decrement. The procedures are to: 1) Generate machine codes using an emulator. 2) Write codes to memory addresses. 3) Assemble and link the program. 4) Load it into memory. 5) Execute step-by-step, observing registers and verifying results against calculations.

Uploaded by

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

Experiment No. 02: Program

The document describes an experiment to generate machine code from an assembly language program, execute it step-by-step, and verify the results by observing register contents. The program contains instructions for addition, subtraction, increment, and decrement. The procedures are to: 1) Generate machine codes using an emulator. 2) Write codes to memory addresses. 3) Assemble and link the program. 4) Load it into memory. 5) Execute step-by-step, observing registers and verifying results against calculations.

Uploaded by

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

Experiment No.

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.

You might also like