Unsigned Instructions
MIPS provides a set of operations to perform unsigned arithmetic:
- addu $8, $9, $10 # add unsigned
- subu $8, $9, $10 # find difference
- addiu $8, $9, 10 # add unsigned immediate
- multu $8, $9, $10 # multiply unsigned
- divu $8, $9, $10 # divide unsigned
- lbu $8, 0($9) # load byte unsigned
- lhu $8, 0($9) # load halfword unsigened
- Notice that the “u” modifier follows the opcode
The most common application of unsigned
arithmetic is for address calculations