Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "move" and "li" in MIPS assembly language

Tags:

c

assembly

mips

People also ask

What does move instruction do in MIPS?

The move pseudo instruction moves the contents of the second register operand into the first register operand. where the immediate (“disp”) is the number of bytes between the first data location (always 0x 1001 0000) and the address of the first byte in the string.

What does Li mean in MIPS?

Load Immediate (li) The li pseudo instruction loads an immediate value into a register.

What does Li mean in assembly code?

li stands for Load Immediate and is a convenient way of loading an immediate up to 32 bits in size. Instructions like addi and ori can only encode 16-bit immediates, so the assembler may translate li into multiple instructions.

What is move in assembly language?

mov — Move (Opcodes: 88, 89, 8A, 8B, 8C, 8E, ...) The mov instruction copies the data item referred to by its second operand (i.e. register contents, memory contents, or a constant value) into the location referred to by its first operand (i.e. a register or memory).


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

There's no register that generates a value other than zero, though, so you'd have to use li if you wanted some other number, like:

li $s0, 12345678