readdec.s: this is a conversion (to use stack-based local
variables and etc.) from a previous project. Test it
individually.
sort.s: implement it so that you can at least read the
input file (probably from redirection) and store numbers in an
array.
printdec.s: this should be the same as in project 3.
sort.s: implement it so that you can print numbers from the
array. Verify that the program reads and writes integers correctly.
pivot.s: get the subroutine pivot to work. You need
to modify sort.s to call pivot. Just make sort.s
call pivot once and make sure the array is pivotted
correctly, and that the index of the pivot is computed
properly.
sort.s: modify the main program again to call quicksort instead of pivot.
quicksort.s: this is the recursive subroutine. Interestingly,
if you have done everything correctly up to this point, this
subroutine is also one of the simplest!
The key is to do incremental programming and debugging. Version control may
be helpful as well. Try to apply the techniques that I discussed in the
class when I demonstrated how to implement readword in project 3.
Copyright © 2009-04-16 by Tak Auyeung