Description
Preamble
This first lab is very straightforward. It is intended to introduce you to the ARCTools
environment and get you started writing assembly.
Lab Description
First thing’s first, you can download ARCTools from D2L under Content->ARCTools. You can
also get it from the source at the following link:
https://iiusatech.com/murdocca/CAO/
There’s nothing to install, just download the simulator and execute the JAR file. If you have
Java installed, you should be able to simply double-click ARCToolsv2.1.2.jar.
0) Start by duplicating the simple program we saw in class this week:
.begin
.org 2048
prog1: ld [x], %r1
ld [y], %r2
addcc %r1, %r2, %r3
st %r3, [z]
x: 15
y: 9
z: 0
.end
Save this file as Lab1.asm. Assemble, and load it into the simulator. Step through the
program one instruction at a time as we saw in class, and make sure everything is
working as expected.
1) Modify Lab1.asm by removing labels y and z. Do not remove the values 9 and 0! The
new snippet of code should look like this:
x: 15
9
0
Adjust your program to perform the same addition operation as before, but now you
can no longer use labels y and z to access locations in memory.
2) Next, add the following line to your Lab1.asm:
.org 2068
x: 15
9
0
Does your solution from 1) still work? If so, good. If not, you’ll have to figure out a
solution that doesn’t involve hard-coding memory locations.
3) Further modify Lab1.asm as follows:
.org 2200
x: -1
2
-3
4
-5
Change the behavior of your program so that instead of adding two numbers, it will add
all five numbers shown above.
I. The result of this addition should be stored at memory location 2240
II. When performing this addition, use no more than two registers (%r1, %r2).
Submission
Labs are to be submitted individually! Submit your Lab1.asm file (from question 3) on D2L
under Lab #1.