Homework #3

1. Given that:
a is in $s0
Array's address is in $s1 (Array is an array of WORDS)
b is in $s6
c's address is in $s3
d is in $s4
Translate the following statements into assemble language.
They ARE NOT cummulative (I.e. assume that the register contents are completly unknown prior to each statement).
BE SURE TO COMMENT THEM!!!  - When a new register is used, note what it's used for.
a=d+b

c=d-c

Array[4]=Array[8]+a

Array[2]=Array[b]-c

Array[c]=Array[a]+b+Array[0]+d

2. Write out the hexadecimal (machine language) representation of the following instructions:
 
ADD $s4,$s1,$s3
LW $s0,4($s2)
SUB $s2, $s3, $s1
OR $s1,$s7, $s3
SW $s1, 4($s3)