



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
The basics of mips instructions, focusing on operations and operands. It covers various types of mips operations, such as arithmetic, logical, shift, compare, load/stores, and branch/jump operations. Additionally, it discusses mips operands, including general-purpose registers, fixed registers, memory locations, and immediate values. The document also includes examples and exercises to help students understand the concepts.
Typology: Lab Reports
1 / 5
This page cannot be seen from the preview
Don't miss anything!




1
2
Operands
3
4
Answer is E. Note: Registers numbers and names: 0: $0, 8: $t0, 9:$t1, …,16: $s0, 17: $s1, …, Note: Opcodes and function fields add: opcode = 0, function field = 32 subu: opcode = 0, function field = 35 addi: opcode = 8 lw: opcode = 35
9
.data # sample0.asm .word c: 3 k: 5 .text la $t0,c # address of c la $t1,k # address of k lw $s0,0($t0) # load the contents of c lw $s1,0($t1) # load the contents of k slt $s3,$s0,$s1 # if $s0 < $s1 then $s3 = 1; else $s3 = 0 beq $s3,$0,notless #if $s3 == 0: go to notless; o/w just go to the next instruction sw $s0,0($t1) #store contents of c into k sw $s1,0($t0) #store the contents of k into c notless:
If c < k then we swapped their values. If not, we just left them alone.