고지웅
고지웅

Reputation: 123

Understanding LW in MIPS

What is the value in $t2?

LUI $t1, 0
ORI $t1, $t1, 16
LW  $t2, 8($t1)

Firstly, I think that the equation is rs = offset + base address, 8 + 16 = 24.

However, my professor said it is wrong.

I think I do not fully understand LW. Could you help me to solve the problem and extra concept of LW?

Upvotes: 0

Views: 470

Answers (1)

user3840593
user3840593

Reputation:

$t1 = 0x10
$t2 = (0x18)

That is, the value stored at 0x18 will be loaded into $t2.

LW means Load Word. It loads a word into a register from the specified address. 0x18 is the address, not the value that will be stored into $t2.

Upvotes: 1

Related Questions