Abstract
- Each word in MIPS is 4 bytes, and MIPS uses byte addressing, so consecutive words’ addresses differ by . Thus, the offset to the next word is always a multiple of 4
Can I load or store one byte?
Yes, we can use
lb
andsb
. The consecutive byte’s addresses differ by .
Important
Important
Using pointers will often result in less MIPS code when looping through array elements. This is because we can use the memory address directly as the loop termination condition, rather than having to calculate the offset.