Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

V. Run the given program Observe the registers/Memory locations values after eac

ID: 3687648 • Letter: V

Question

V. Run the given program

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 Sa0, arrayi lw $a1, count : # in the jal statement Jal sort #jump to "sort." J print ump to "print:" #start subrouten sort: sw $ra,-4($sp) #load the return address in to the stack pointer move $16, $a1 #outter counter outter: sub $16, $16, 1 #sub the outter counter move $17, $a0 #save the address for "array" into $17 move $5, $al #inner counter inner: sub $t5,St5,1 #sub1 from inner counter lw $s0,($t7) #load the two variables lw $s1 ,4(W7) #to be tested # if $s0

Explanation / Answer

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?

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