# MIPS: Summary After Loops

### 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
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)

### 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
sltu (set on less than) sltu \$rd, \$rs, \$rt set \$rd to 1 if \$rs < \$rt (unsigned)

### Jump Instructions (so far)

Name Syntax Meaning
j j label j to the address associated with label

### Registers (so far)

0`\$zero` constant 0
...
8
.
.
.
15
`\$t0`
.
.
.
`\$t7`
temporary (not preserved across function call)
.
.
.
temporary (not preserved across function call)
16
.
.
.
23
`\$s0`
.
.
.
`\$s7`
saved temporary (preserved across function call)
.
.
.
saved temporary (preserved across function call)
24
25
`\$t8`
`\$t9`
temporary (not preserved across function call)
temporary (not preserved across function call)
...