1
votes

I am new to mips. I have the following instruction:

addi $s3, $0, '\n'

$s3 is now equal to 0x0000000a

Now I want to set $s4 to be 0x1001000a

I am trying this:

lui     $s4, 0x1001
ori     $s4, $s4, $s3

But I am getting an error on the ori statement. Any help would be appreciated. Thanks.

1

1 Answers

1
votes

The i in ori means "immediate" - this form of the instruction expects an immediate (literal constant) for the third argument.

In your case you have a register for the third argument, so you just want or:

lui     $s4, 0x1001
or      $s4, $s4, $s3

See this handy MIPS instruction set reference.