Question: Name: MIPS Programming Assignment 6 (Analyzing MIPS Assembly Code) 1. Given the following segment of MIPS2. Given the following segment of MIPS Assembly code. Before
Name: MIPS Programming Assignment 6 (Analyzing MIPS Assembly Code) 1. Given the following segment of MIPS2. Given the following segment of MIPS Assembly code. Before running the code. Sts-4, St 1=1, St2-2, and Sso-3. What are the values of St1, S12, and Ss0 after running the code? Assembly code. Before running the code, Sal 1 and Sa2-7 What are the values of Sal and Sa2 after running the code? while: bge Sal, Sa2, done bgez St8, else addi Ss0, $t8,-5 addi St1, St1, 2 b next addi Sal, Sal, 1 addi Sa2, Sa2,-1 b while else: move Ss0, St8 done: addi $t2, S12, 3 next: 3. Given the following MIPS Assembly program. What are the values of registers Stl and St2 after running the program? What is the value at memory location unitX after running the program? 4. Given the following MIPS Assembly program. What are the values of registers $13 and St4 after running the program? What is the value at memory location unitX after running the program? word 28 num: initA: word-20 30-40 50 0-60 80 unitX: word? initA: word-20 30-40 500-60 80 unitX: word? .text la St0, initA lw Stl, num(S0) add $12, StO, St li St3, 0 addi $12, $t2, -4 .text la StO, initA li Stl, 0 loop: lw S12,0(St0) beqz $12, done add St1, St1, S12 addi $t0, St0, 4 b loop loop: blt S12, StO, done lw St4, 0($12) add $t3, S13, $t4 addi $t2, $12,-4 b loop done: sw St1, unitX(S0) done: sw St3, unitX(SO)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
