












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the mips instruction set architecture (isa) and its organization as covered in lecture 05 of the computer architecture course (ee440). It includes details on various instruction formats, addressing modes, and mips register usage.
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













Category Instr Op Code Example Meaning Arithmetic (R & I format) add 0 and 32 add $s1, $s2, $s3 $s1 = $s2 + $s subtract 0 and 34 sub $s1, $s2, $s3 $s1 = $s2 - $s add immediate 8 addi $s1, $s2, 6 $s1 = $s2 + 6 or immediate 13 ori $s1, $s2, 6 $s1 = $s2 v 6 Data Transfer (I format) load word 35 lw $s1, 24($s2) $s1 = Memory($s2+24) store word 43 sw $s1, 24($s2) Memory($s2+24) = $s load byte 32 lb $s1, 25($s2) $s1 = Memory($s2+25) store byte 40 sb $s1, 25($s2) Memory($s2+25) = $s load upper imm 15 lui $s1, 6 $s1 = 6 * 2^16 Cond. Branch (I & R format) br on equal 4 beq $s1, $s2, L if ($s1==$s2) go to L br on not equal 5 bne $s1, $s2, L if ($s1 !=$s2) go to L set on less than 0 and 42 slt $s1, $s2, $s3 if ($s2<$s3) $s1=1 else $s1= set on less than immediate 10 slti $s1, $s2, 6 if ($s2<6) $s1=1 else $s1= Uncond. Jump (J & R format) jump 2 j 2500 go to 10000 jump register 0 and 8 jr $t1 go to $t jump and link 3 jal 2500 go to 10000; $ra=PC+
Name Reg. No. Usage Preserved on Call? $zero 0 const. value n.a. $v0 - $v1 2-3 values No $a0 - $a3 4-7 arguments Yes $t0 - $t7 8-15 temporaries No $s0 - $s7 16-23 saved Yes $t8 - $t9 24-25 temporaries No $gp 28 Global pointer Yes $sp 29 Stack pointer Yes $fp 30 Frame Pointer Yes $ra 31 Return address Yes
Memory
Memory
beq $s3,$s4,True # branch i==j sub $s0,$s1,$s2 # f=g-h(false) j Fin # goto Fin True: add $s0,$s1,$s2 # f=g+h (true) Fin:
int leaf_example (int g, int h, int i, int j) { int f; f = (g + h) – (i + j); return f; }