0% found this document useful (0 votes)
41 views

Eex3336 Lab2

Uploaded by

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

Eex3336 Lab2

Uploaded by

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

THE OPEN UNIVERSITY OF SRI LANKA

FACULTY OF ENGINEERING TECHNOLOGY


THE DEPARTMENT OF ELECTRICAL & COMPUTER ENGINEERING
ACADEMIC YEAR: – 2023/24

EEX3336: - Communications and Computer Technology

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.

During this Lab you have to

• Examine the Fetch and execution cycle.


• Examine different addressing modes of a processor.
• Comprehend a given Instruction Set Architecture (ISA) and instruction formats.
• Analyse the operation of different instruction types of the ISA.
• Analyse behaviour of different components of a processor.
• Write basic assembler programmes.
• Analyse the simple assembler program execution on a processor.

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.

a. Instruction level. Write the values after each execution of an instruction.


b. Clock level. Write the values at the each clock.

Challenge: load a different value to accumulator.


Experiment 2:

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.

Challenge: load a different value to a different memory location.

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.

Challenge: save a value to memory location using indirect addressing.

Experiment 4:

Perform arithmetic operations with 2 numbers for the following situations.

1. With 1 known value.


2. One value is saved in a memory location.

• 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.

Challenge: Perform following operations using jump operations.

B=10
if A-10=0 then
B=B+5
Else
B=B+10
End if;

Experiment 6:

Write a Simple Assembler program to solve a problem based on a given scenario.

1. Write assembler program.


2. State comments where necessary.
3. Observe the function of the processor by analysing the behaviour of the components
(mainly registers) of the processor.
4. 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.

You might also like