Beruflich Dokumente
Kultur Dokumente
MIPS assembler
Spring 2004
Jouni Riihimäki
Jouni.riihimaki@tut.fi
example of use:
add $t5 $t5 32
this command adds 32 to register t5
example of use:
and $v1 $v1 $zero
clear register v1 (zero always 0)
example of use:
li $v0 4
load register v0 with 4
example of use:
seq $v1 $v1 $v0
set v1 to 1 if v1 equals v0, otherwise set v1 to 0
example of use:
beq $v1 $v0 next_label
if v1 equals v0 branch to next_label
example of use:
jr$ra
jump to instruction whose address is in register ra
example of use:
lw $t4 ($t0)
load word from address given in register t0 to t4
example of use:
move $t0 $a0
move value from register a0 to to
Exception instructions
e.g. syscall