! difficulty ratingCheck section A.10 for interesting assembler services
More Hints
|
! ! !
SPIM Exercise 5.1Load and run this version of procedure sort from your textbook. Step through the program and note registers PC, $ra, and $sp. Watch the stack. Check the pseudoinstruction expansions against the code in your textbook. ! ! ! !
SPIM Exercise 5.2Write a procedure to implement selection sort. Call the procedure "sel_sort". Procedure inputs: list of 32-bit signed integers (pass address), and list size (n). Use procedures swap and smallest from SPIM Exercises 3.2 and 3.4, respectively. Use the sample list from 3.4 (without the end mark "-1") and the list from 5.1 to test your code. ! ! ! ! !
SPIM Exercise 5.3 Hide 5.3 hintWrite a procedure to implement insertion sort (see hints to the left). Call the procedure "ins_sort".
Look at this C code (source) and the following figure. Use the assembly source file from 5.1 as a template for your solution. |