[MIPS]
Assume there is the stored value 0x12345678 in $s0
.
Let's assume I want to put now another value into $s0
(say for example 0x87654321), then I have to put the value in two steps (at least I have learned it this way) with the lui
operation and the ori
.
lui $s0, 0x8765
ori $s0, $s0, 0x4321
I know this works if $s0
is 0
at the beginning, but I'm actually not sure if the lui
operation sets the second half to 0's or if it just replaces the first half with my new input 0x8765.
So, my question is:
Does it work even if there's a stored value in $s0
or do I have to set the value of $s0
to 0
and then set the upper half and lower half ?