




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































David Galles Department of Computer Science University of San Francisco
Instruction Description lw rt,
offset
(base) Add the constant value
offset
to the register base to get an address. Load the contents of this address into the register rt
rt = M[base +
offset
sw rt,
offset
(base) Add the constant value
offset
to the register base to get an address. Store the contents of rt into this address. M[base +
offset
] = rt add rd, rs, rt Add contents of registers rs and rt, put result in register rd
Instruction Description sub rd, rs, rt Subtract contents of register rt from rs, put result in register rd addi rt, rs,
val
Add the constant value
val
to register rs put result in register rt mult rs, rt Multiply contents of register rs by register rt, put the low order bits in register LO, and the high bits in register HI div rs, rt Divide contents of register rs by register rt, put the quotient in register LO, and the remainder in register HI
Instruction Description slt rd, rs, rt if rs
rt, rd
1, else rd
beq rs, rt,
target
if rs
rt, jump to the label
target
bne rs, rt,
target
if rs
rt, jump to the label
target
blez rs,
target
if rs
0, jump to label
target
bgtz rs,
target
if rs
0, jump to label
target
bltz rs,
target
if rs
0, jump to the label
target
bgez rs,
target
if rs
0, jump to the label
target
Mnemonic
Description Name Name $return $ra Return Register – Holds the return address for the current function $zero $zero Zero Register – This register always has the value 0 $ACC $t Accumulator Register – Used for calculating the value of expressions $t $t General Purpose Register $t $t General Purpose Register $t $t General Purpose Register
Constant(3) Constant(4)