开发者

How does lw in mips actually work?

开发者 https://www.devze.com 2023-01-26 21:51 出处:网络
Is this statement a valid one? lw $t0, 21($s0) $s0 contains the decimal 2022. In my开发者_运维百科 opinion this is invalid, because based on what I know, The address specified by the offset + the

Is this statement a valid one?

lw $t0, 21($s0)

$s0 contains the decimal 2022.

In my开发者_运维百科 opinion this is invalid, because based on what I know, The address specified by the offset + the register should always be a multiple of 4. Is this correct or not?

An extension to this question based on the answer provided, The exception will arise just on looking at the address at $s0 or after the computation of the address 21+$s0 ?


The execution of that instruction when $s0 contains the decimal 2022 will raise an exception, due to the effective address (2041=2022+21) is not aligned properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消