Eex3336 Lab2
Eex3336 Lab2
LAB 2:- Study the fetch-execute cycle for a given assembly program
Please refer to the Course Guide for the topics related to the lab practical.
Practical consists of different lab experiments. You have to complete those experiments in four
lab sessions. The experiments that you have to do are in this sheet. After completing the session,
you have to submit a lab report within one week time or before the date given by your instructor.
The main objective of the lab practical of this course is to analyse the Fetch and Execution cycle
of a processor. Though there are different sections to be covered, the instructor may select the
experiments you need to complete.
Experiment 1:
Write the programme given below to load a value to accumulator. Use the Accumulator
architecture of the SEPSim simulator and perform the experiments listed below.
Load value 10 to accumulator using below instruction.
LOADacc #10
Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor. Note down the values of registers: PC, IR, MAR,
MDR, and Accumulator in a separate sheet for the following modes of execution.
Write the programme given below to load a value to memory location 2016.
LOADacc #10
STOREacc 0x20
1. Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor.
2. Observe the immediate and direct addressing mode operation.
3. Note down the values of registers: PC, IR, MAR, MDR, and Accumulator in a
separate sheet for the following modes of execution.
a. Instruction level. Write the values after each execution of an instruction.
b. Clock level. Write the values at the each clock.
Experiment 3:
Write a program to load a value saved in a memory location by using direct addressing
mode to perform the similar tasks as in Experiment 1.
• Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor.
Experiment 4:
• Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor.
Challenge: Perform arithmetic operations when both values are saved in memory
locations.
Experiment 5:
Perform conditional jump and unconditional jump operations for the following situations.
▪ Unconditional jump
JUMP 3
The above instruction skips 3 memory locations, i.e. one instruction forward
from the current instruction location.
▪ Conditional jump
if A-10=0 then
In order to implement the above condition, you must first do the arithmetic
operation, i.e. A-10. Thereafter use a conditional jump instruction according to
the set Flag. In this case you have to check whether the result is zero. So you can
use the following instruction.
JZ 3
Accordingly, it skip 3 memory locations (one instruction) forward from the
current instruction location if the result of A-10 is zero. Otherwise program
continues to the next instruction.
• Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor.
B=10
if A-10=0 then
B=B+5
Else
B=B+10
End if;
Experiment 6: