Instructions Review studied in the course until now. Exercises about these instructions.
Instruction | Example | Use | |
and, andi | and $t0, $t1, $t2 | Verify if a bit is set and unset a bit | |
or, ori | or $t0, $t1, $t2 | Set a bit | |
nor | nor $t0, $t1, $t2 | Detect zeros in both operands and invert bits | |
xor | xor $t0, $t1, $t2 | Detect positions with differents bits and invert bits | |
sll, sllv | sll $t0, $t1, shif | multiplication, left shift | |
srl, srlv | srl $t0, $t1, shif | division, right shift | |
add, sub | add $t0, $t1, $t2 | addition and subtration | |
slt, slti, sltu, sltiu, sge, sgt, etc | slt $t0, $t1, $t2 | comparation | |
mult, multu | mult $t0, $t1 | multiplication | |
div, divu | div $t0, $t1 | division | |
mflo | mflo $t0 | Access the low part of multiplication and division special register | |
mfhi | mfhi $t0 | Access the high part of multiplication and division special register | |
lw, li, la | lw $t0, 0($t1) | load a word, a immediate value or a address |