Common MIPS Instructions
User Manual:
Open the PDF directly: View PDF .
Page Count: 2
Download | |
Open PDF In Browser | View PDF |
Common MIPS instructions. Notes:op, funct, rd, rs, rt, imm, address, shamt refer to fields in the instruction format. The program counter PC is assumed to point to the next instruction (usually 4 + the address of the current instruction). M is the byte-addressed main memory. Instr. format op op/funct add $rd, $rs, $rt R 0/32 $rd = $rs + $rt Add contents of two registers sub $rd, $rs, $rt R 0/34 $rd = $rs - $rt Subtract contents of two registers addi $rt, $rs, imm I 8 $rt = $rs + imm Add signed constant addu $rd, $rs, $rt R 0/33 $rd = $rs + $rt Unsigned, no overflow subu $rd, $rs, $rt R 0/35 $rd = $rs - $rt Unsigned, no overflow addiu $rt, $rs, imm I 9 $rt = $rs + imm Unsigned, no overflow mfc0 $rt, $rd R 16 $rt = $rd rd = coprocessor register (e.g. epc, cause, status) mult $rs, $rt R 0/24 Hi, Lo = $rs * $rt 64 bit signed product in Hi and Lo multu $rs, $rt R 0/25 Hi, Lo = $rs * $rt 64 bit unsigned product in Hi and Lo div $rs, $rt R 0/26 Lo = $rs / $rt, Hi = $rs mod $rt divu $rs, $rt R 0/27 Lo = $rs / $rt, Hi = $rs mod $rt (unsigned) mfhi $rd R 0/16 $rd = Hi Get value of Hi mflo $rd R 0/18 $rd = Lo Get value of Lo and $rd, $rs, $rt R 0/36 $rd = $rs & $rt Logical AND or $rd, $rs, $rt R 0/37 $rd = $rs | $rt Logical OR andi $rt, $rs, imm I 12 $rt = $rs & imm Logical AND, unsigned constant ori $rt, $rs, imm I 13 $rt = $rs | imm Logical OR, unsigned constant sll $rd, $rs, shamt R 0/0 $rd = $rs << shamt Shift left logical (shift in zeros) srl $rd, $rs, shamt R 0/2 $rd = $rs >> shamt Shift right logical (shift in zeros) lw $rt, imm($rs) I 35 $rt = M[$rs + imm] Load word from memory sw $rt, imm($rs) I 43 M[$rs + imm] = $rt Store word in memory lbu $rt, imm($rs) I 37 $rt = M[$rs + imm] Load a single byte, set bits 8-31 of $rt to zero sb $rt, imm($rs) I 41 M[$rs + imm] = $rt Store byte (bits 0-7 of $rt) in memory lui $rt, imm I 15 $rt = imm * 216 Load constant in bits 16-31 of register $rt beq $rs, $rt, imm I 4 if($rs==$rt) PC = PC + imm (PC always points to next instruction) bne $rs, $rt, imm I 5 if($rs!=$rt) PC = PC + imm (PC always points to next instruction) slt $rd, $rs, $rt R 0/42 if($rs<$rt) $rd = 1; else $rd = 0 slti $rt, $rs, imm I 10 if($rs
Source Exif Data:File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No Page Count : 2 Producer : Mac OS X 10.11.6 Quartz PDFContext Create Date : 2018:06:21 15:26:08Z Modify Date : 2018:06:21 15:26:08ZEXIF Metadata provided by EXIF.tools