Question

I have a register called $offset which I can control. I would like to know how can I rewrite the lw command such that instead of the word off in

lw $a off($b) 

I have to the content of the $offset register.

Was it helpful?

Solution

MIPS assembly doesn't support this.

What you will need to do instead is:

add $c $b $offset
lw  $a 0($c)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top