# COMP 230 MIPS Instructions: Final Summary

### Arithmetic Instructions

Name Syntax Meaning
sub sub \$rd, \$rs, \$rt \$rd = \$rs - \$rt
subu subu \$rd, \$rs, \$rt \$rd = \$rs - \$rt (unsigned)

### Logical Instructions (so far)

Name Syntax Meaning
and (bit-wise AND) and \$rd, \$rs, \$rt \$rd = \$rs bitwise-AND \$rt (\$rs & \$rt)
or (bit-wise OR) or \$rd, \$rs, \$rt \$rd = \$rs bitwise-OR \$rt (\$rs | \$rt)
nor (bit-wise NOR) nor \$rd, \$rs, \$rt \$rd = \$rs bitwise-NOR \$rt
andi (bit-wise AND) andi \$rd, \$rs \$rd = \$rs bitwise-AND constantValue
ori (bit-wise OR) ori \$rd, \$rs \$rd = \$rs bitwise-OR constantValue
sll (shift left logical) sll \$rd, \$rs, shiftAmount shift \$rd by shiftAmount, put in \$rd
srl (shift right logical) srl \$rd, \$rs, shiftAmount shift \$rd by shiftAmount, put in \$rd

### Memory Access Instructions (so far)

Name Syntax Meaning
sw (store word) sw \$rs, offset(\$base) store word from \$rs to address (\$base+offset)
lui (load upper immediate) lui \$rd, value load immed. value into high-order bits of \$rd

### Branch-Related Instructions (so far)

Name Syntax Meaning
beq (branch on equal) beq \$rs, \$rt, label branch to label if \$rs == \$rt
bne (branch on not equal) bne \$rs, \$rt, label branch to label if \$rs != \$rt
slt (set on less than) slt \$rd, \$rs, \$rt set \$rd to 1 if \$rs < \$rt
slti (set on less than) slti \$rd, \$rs, value set \$rd to 1 if \$rs < value
sltu (set on less than) sltu \$rd, \$rs, \$rt set \$rd to 1 if \$rs < \$rt (unsigned)
sltiu (set on less than) sltiu \$rd, \$rs, value set \$rd to 1 if \$rs < value (unsigned)

### Jump Instructions

Name Syntax Meaning