

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
Machine code instructions and explanations for various mips assembly language operations, including loops, branches, and register usage for procedure calls. It also includes problems to solve for understanding the concepts of instruction formats and register values.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


0x400000 add $t1, $t2, $t addi $t1, $t2,0x nop beq $s0, $s1, LOOP (For the problem 1 .1) 1 .1)Write Machine code for the above 4 instructions. (Hexadecimal format) Hint : opcode for add is 0 and func field is 0x20. opcode for addi is 8 and think about rt and rs fields. opcode for beq is 4 register number for $t0 is 8 register number for $s0 is 16 What will be the offset value for LOOP when we are using delayed branch? What will be the offset value for Loop when we are using non delayed branch? ############################################## START: 0x400000 J LINE Nop Nop LINE1 beq $s0,$s1,LINE add $s1,$s2,$s LINE2 nop (For the problem 1 .2) 1 .2)Write Machine code for the above 5 instructions. (Hexadecimal format) Hint : opcode for j is 2. What will be the offset value for LINE1 and LINE2. 1 .3)Compute this branch target address: 0x400000 bne r1, r2, 3 1 .4)compute this branch target address 0x40000c bne r1,r2,- 3