This MIPS/SPIM programLinks to an external site. includes a subroutine called myadd that performs x[0]=(x[1]+x[2]);. In the space below, write a replacement for the myadd subroutine named mymax that will make x[0] have a value which is the maximum, x[0]=max(x[1],x[2]). Hint: the slt instruction will help. You should test your routine using SPIMLinks to an external site.
This MIPS/SPIM programLinks to an external site. includes a subroutine called myadd that performs x[0]=(x[1]+x[2]);. In the space below, write a replacement for the myadd subroutine named mymax that will make x[0] have a value which is the maximum, x[0]=max(x[1],x[2]). Hint: the slt instruction will help. You should test your routine using SPIMLinks to an external site. before you submit it, which will require merging it with a test framework like the one used in this MIPS/SPIM programLinks to an external site. -- but only submit the mymax routine here. Remember that you can and should comment your code, especially if there are any known bugs. Half off for documented bugs. :-)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps