Observe the registers/Memory locations values after each Step Run. Record the fi
ID: 3803633 • Letter: O
Question
Observe the registers/Memory locations values after each Step Run. Record the final values.
Use $t0, $t1, and $t2 to hold the numbers after the ascending sort. What are the final values of $t0, $t1, and $t2?
text globl start Start: la $a0, array i lw $al, count: in the jal statement jal sort #jump to "sort: j print #jump to "print Start Subrouten sort: sw $ra, -4($sp) #load the return address in to the stack pointer move $t6, $al Houtter counter outter: sub $t6, $t6, 1 #sub the outter counter move $17, $a0 #save the address for "array" into $17 move $15, $al #inner counter inner: sub $t5, St5, 1 #sub 1 from inner counter lw $s0,($17) #load the two variables lw $s1,4($17) tito be tested ble $50, $s1, next if $s0Explanation / Answer
Use $t0, $t1, and $t2 to hold the numbers after the ascending sort. What are the final values of $t0, $t1, and $t2?
The above porgram by observing step by step i will explain you
step 1:
Firstly we are taking the array elements three i.e 3,2,1 and count 3
step2:
the array elemts are stored in $a0=3,2,1
the count is $a1=3
step3:
For the sorting of this array elements in the litteration process by taking two numbers that values are sotred $s0,$t7 and after checking the if condition by sorting elements so the above conditions continous going after all elements are form in the ascending order
step4:
The finally the values are stored in $t0,$tt1 and $t2
$t0=1,$t1=2 and $t2=3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.