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

CPSC1050 Lab 3

This document provides instructions for Lab 3, which focuses on analyzing the fetch-execute cycle of computers using a "Super Simple CPU" applet. Students are asked to complete exercises in a PDF manual, then trace two programs using the applet and record the values of registers and memory locations after each instruction in a table. The lab aims to help students analyze machine language and assembly language programs.

Uploaded by

Danny Jirdan
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)
83 views

CPSC1050 Lab 3

This document provides instructions for Lab 3, which focuses on analyzing the fetch-execute cycle of computers using a "Super Simple CPU" applet. Students are asked to complete exercises in a PDF manual, then trace two programs using the applet and record the values of registers and memory locations after each instruction in a table. The lab aims to help students analyze machine language and assembly language programs.

Uploaded by

Danny Jirdan
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/ 2

CPSC 1050: Lab 3

Lab 3: Super Simple CPU


Learning Objectives

At the end of this lab, you should be able to:


• analyze the fetch-execute cycle of computers
• analyze machine language programs
• analyze assembly language programs

Lab Instructions

1. Open "Lab 7 Computer Cycling" (Lab7_Manual.pdf) and the related Applet (Super
Simple CPU).
2. Review the Activity part of the lab and learn how Super Simple CPU works.
3. Write your complete work to answer the following Lab Questions in a text editor (e.g.,
Microsoft Word). If there is a screenshot, it must be copied to your document.

Lab Questions

1. Lab 7 Computer Cycling (Lab7_Manual.pdf)


a. [3 points] Exercise 1
b. [9 points] Repeat Exercise 1 for examples 2, 3, and 4
c. [2 points] Exercise 2
d. [4 points] Exercise 3
e. [2 points] Exercise 4
2. [4 points] Given the following "Super Simple CPU" program trace the code, write the
values of Accumulator, Memory (ONE), and Memory (TWO) in a table (shown below),
and record their changes after each instruction.

LDI 6 ; Load 6 into accumulator


SUB ONE ; Subtract the value in memory location ONE from
accumulator
ADD TWO ; Add the value in memory location TWO to
accumulator
STO ONE ; Store accumulator in memory location ONE
STP ; Stop the program
ONE DAT 1 ; A data value, the number 1
TWO DAT 2 ; A data value, the number 2

Assembly instruction Accumulator ONE TWO


LDI 6 6 1 2

1
CPSC 1050: Lab 3

3. Given the following "Super Simple CPU" program trace the code, write the values of
Accumulator, Memory (X), Memory (Y), and Memory (Z) in a table (shown below), and
record their changes after each instruction.

LOD X ; Load X into accumulator


ADD X ; Add the value in memory location X to
accumulator
ADD X ; Add the value in memory location X to
accumulator
SUB Y ; Subtract the value in memory location Y
from accumulator
STO Z ; Store accumulator in memory location Z
STP ; Stop the program
X DAT 3 ; A data value, the number 3
Y DAT 5 ; A data value, the number 5
Z DAY 0 ; A data value, the number 0

Assembly instruction Accumulator X Y Z


LOD X 3 3 5 0

Lab Submission

You must only submit one pdf file. Save your file as yourName_Lab3.pdf and submit to
Brightspace.

You might also like