c – Difference between move and li in MIPS assembly language

c – Difference between move and li in MIPS assembly language

The move instruction copies a value from one register to another. The li instruction loads a specific numeric value into that register.

For the specific case of zero, you can use either the constant zero or the zero register to get that:

move $s0, $zero
li   $s0, 0

Theres no register that generates a value other than zero, though, so youd have to use li if you wanted some other number, like:

li $s0, 12345678

c – Difference between move and li in MIPS assembly language

Leave a Reply

Your email address will not be published.