当前位置: 动力学知识库 > 问答 > 编程问答 >

memory - MIPS, using a constant as the base address of instruction sw

问题描述:

In MIPS, what would the following block of codes do???

addiu $t0, $0, 5

sw $t1, 0($t0) # assume that $t1 is some constant

Since $t0 register is not a memory address(or is it? 0x00000005), I wonder where $t1 get stored to...

网友答案:

This code would store $t1 at the address 0x5.

Or at least that's the intention. If you tried to run it, however, you'd find that the application would crash because the address 0x5 is not word-aligned.

分享给朋友:
您可能感兴趣的文章:
随机阅读: