Are these two instructions equivalent, i.e do they both do the exact same thing?
addi $s0,$s0,0 and
add $s0, $s0, $zero
I haven't use a MIPS assembler that accepts
$zero, but yes - they both don't do anything.
Though I've heard that some might prefer one to the other when the other is used more often (a little less heat going through one instruction). I'm not sure how usefull that is in practice though.
What do you mean they don't do anything?
So I just learned that the convention of using
$s0 are specific calling conventions for some tools chains (O32/N32/N64). In this case
$s0 is really
$zero is really
What I mean when I say "they don't do do anything" is that they don't do anything. Is this homework? Read out the instruction to yourself.
add $16, $16, $0. What signed integer value does register
$0 always hold? If you know what
add $d, $s, $t does, then what is the effect when
$s? Now do the same thing for
addi $16, $16, 0. Contrast and compair the state before and after both instructions.