Laboratory Assignment 3 - Introduction to Computer Organization | CPSC 2105, Assignments of Computer Architecture and Organization

Material Type: Assignment; Class: Computer Organization; Subject: Computer Science; University: Columbus State University; Term: Summer 2005;

Typology: Assignments

Pre 2010

Uploaded on 08/04/2009

koofers-user-f3s
koofers-user-f3s 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPSC 2105 Introduction to Computer Organization
Lab Assignment 3 Due Thursday, July 28, 2005
The purpose of this lab is for the student to run the MARIE simulation of a simple program.
The simulator to be used is found in the lab in room 450 of CCT.
The assignment is to assemble and load the following MARIE assembly language program.
Please note that the entire program can be downloaded from an existing file, so that no
student input is required.
/ Example 4.3
ORG 100
Load X / Load the first number to be doubled.
Store Temp / Use Temp as a parameter to pass value to Subr.
JnS Subr / Store the return address, and jump to the procedure.
Store X / Store the first number, doubled
Load Y / Load the second number to be doubled.
Store Temp
JnS Subr / Store the return address and jump to the procedure.
Loop, Store Y / Store the second number doubled.
Halt / End program.
X, DEC 20
Y, DEC 48
Temp, DEC 0
Subr, HEX 0 / Store return address here.
Clear / Clear AC as it was modified by JnS.
Load Temp / Actual subroutine to double numbers.
Add Temp / AC now holds double the value of Temp.
JumpI Subr / Return to calling code.
END
Assemble, load, and execute the program. Note the contents of memory, viewed in the
hexadecimal dump window, and the contents of the system registers.

Partial preview of the text

Download Laboratory Assignment 3 - Introduction to Computer Organization | CPSC 2105 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CPSC 2105 Introduction to Computer Organization

Lab Assignment 3 Due Thursday, July 28, 2005

The purpose of this lab is for the student to run the MARIE simulation of a simple program.

The simulator to be used is found in the lab in room 450 of CCT.

The assignment is to assemble and load the following MARIE assembly language program.

Please note that the entire program can be downloaded from an existing file, so that no

student input is required.

/ Example 4. ORG 100 Load X / Load the first number to be doubled. Store Temp / Use Temp as a parameter to pass value to Subr. JnS Subr / Store the return address, and jump to the procedure. Store X / Store the first number, doubled Load Y / Load the second number to be doubled. Store Temp JnS Subr / Store the return address and jump to the procedure. Loop, Store Y / Store the second number doubled. Halt / End program. X, DEC 20 Y, DEC 48 Temp, DEC 0 Subr, HEX 0 / Store return address here. Clear / Clear AC as it was modified by JnS. Load Temp / Actual subroutine to double numbers. Add Temp / AC now holds double the value of Temp. JumpI Subr / Return to calling code. END

Assemble, load, and execute the program. Note the contents of memory, viewed in the

hexadecimal dump window, and the contents of the system registers.