Question: please help!! Sorting numbers is a very common problem; here, you just have 3 numbers to sort. This MIPS/SPIM program includes a subroutine called myadd

 please help!! Sorting numbers is a very common problem; here, you

please help!!

Sorting numbers is a very common problem; here, you just have 3 numbers to sort. This MIPS/SPIM program includes a subroutine called myadd that performs x=(y+z);. In the space below, replace the myadd subroutine with one named mysort that will sort the values of x, y, and z and into increasing order (i.e., make x the smallest and z the largest). You should test your routine using SPIM before you submit it, which will require merging it with a test framework like the one used in this MIPS/SPIM program -- but only submit the mysort routine here. #### # # Addition routine: # x = y + z # .text .globl my add myadd: la $t0, y #t0 = y lw $t0, 0($t0) la $t1, z #t1 = z lw $t1, 0($t1) addu $t2, $t0, $t1 #t2 = y + z la $t0, x #x = 12 sw $t2, 0($t0) jr $ra #return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!