
This preview has intentionally blurred sections.
Sign up to view the full version.

Unformatted text preview: 3 register operands addi $s1, $s2, 20 s1 = s2 + 20 Used to add constants data transfer lw $s1, 20($s2) s1 = Mem[s2 + 20] Word from memory to register sw $s1, 20($s2) Mem[s2 + 20] = s1 Word from register to memory lui $s1, 20 s1 = 20 * 2^16 Loads const into upper 16 bits logical and $s1, $s2, $s3 s1 = s2 & s3 Bit-by-bit AND or $s1, $s2, $s3 s1 = s2 | s3 Bit-by-bit OR nor $s1, $s2, $s3 s1 ~= (s2 | s3) Bit-by-bit NOR sll $s1, $s2, 10 s1 = s2 << 10 Shift left by constant srl $s1, $s2, 10 s1 = s2 >> 10 Shift right by constant conditional beq $s1, $s2, 25 if = go PC+4+100 PC relative branch branch bne $s1, $s2, 25 if ~ go PC+4+100 PC relative branch slt $s1, $s2, $s3 s1 = 1 if true : 0 Compare less than for beq, bne unconditional j 25 go to 100 Jump to target jump jr $ra go to return addr Procedure return jal 25 ra=PC+4; go to 100 For procedure call...
View
Full Document
- Spring '09
- SPRINTSTON
- Subroutine, Control flow, MIPS architecture, lui
-
Click to edit the document details