error: “store address not aligned on word boundary”

Are you sure that the error is happening on that line? I think the error is actually happening here:

sw  $t3, 0($t0)

The problem is that you’re trying to store a word (because you’re using sw) to an address that’s not word-aligned. 0xFFFF0011 is not word-aligned. The reason why 0xFFFF0010 works is because it is word-aligned.

A word is 4 bytes long, so the valid word-aligned addresses are 0xFFFF0010, 0xFFFF0014, 0xFFFF0018, etc. Anything in between isn’t word-aligned.

You should be able to fix this by changing it from sw to sb:

sb  $t3, 0($t0)

This works because storing a byte does not require a word-aligned address.

Edit: To clarify, a word-aligned address is one that’s divisible by 4.

Leave a Comment