I'm just beginning MIPS programming, and don't understand how to properly offset when storing a word into memory. Here's part of my code:
add $t3 $t0 $t2 #register t3 now contains word 23
sw $t3 100($t0)#store result in memory
When I run it, I receive an exception at the memory address of the instruction sw
. Then, I receive a message unaligned address in store 0x00000073
My assumption is that I'm storing it in an invalid memory address. I've checked the official MIPS documentation, but I still don't understand how to properly offset the memory. What constant should I use? And which register?
Thanks in advance.
User contributions licensed under CC BY-SA 3.0