CSI 251 LABS
LAB 1
The assignment is to load the value of variable X from a memory location
and save the value in variable Y. Assume the value of X is stored at
memory address 4000, the value of Y is stored at memory address 4004,
and registers x8 and x9 contain the memory addresses 4000 and 4004:
Addresses Variables
4000 X
4004 Y
Registers Data
x8 4000
x9 4004
1. Enter lw x5, 0(x8) as the first line of instruction in the coding
window as shown below.
LAB 2
LAB: Arithmetic expression - add/sub
Given the mapping of registers to variables below, write a program to
implement the following expression:
Z=A+B+C−D
Registers Variables
x8 A
x9 B
x18 C
x19 D
x20 Z
Ex: If the values of x8, x9, x18, and x19 are initialized in the simulator as:
Registers Data
x8 2
x9 4
x18 6
Registers Data
x19 5
the result is stored in x20:
Registers Data
x8 2
x9 4
x18 6
x19 5
x20 7