Harvey Mudd College
Computer Science 60
Optional Extra Credit Only (50 points)
Assignment 13
Due Friday, December 17, by midnight

Assembly-Language Programming




The ISC (Incredibly-Simple Computer) is described in the text and in the section 1 lecture notes. Program the ISC using its assembly language ISCAL to read in an array (up to end-of-file), perform quicksort on the array, and write out the array in sorted order.

Java code for quicksort is in /cs/cs60/examples/java/Sort/quicksort.java.

The following ISC files, in /cs/cs60/isc, may be of interest:

part.isc
Code to read in an array and print it out with an intervening call to subroutine 'part' which performs the partition phase of quicksort.

rfac.isc
A recursive factorial program, using a stack. This shows how a stack can be implemented on the ISC.
Your quicksort can be built by modifying subroutine 'part' in part.isc. After partitioning the array, quicksort makes two recursive calls to itself. What you have to do is add the code for making these recursive calls.

Note that quicksort does not need to return a value; rather it modifies its argument array in place. It is recommended that the array be represented by pointers to the bottom and top locations in the array. This is the way that 'part' is set up. Subroutine 'part' also returns the pivot element as a value. This is not needed for quicksort.

Note

Due to the late hour of this assignment, we will not be critiquing code style. Your score is all-or-nothing, based on whether your quicksort runs on arbitrary arrays of elements up to a reasonable size (say 1000 elements).

Reading

Chapter 13 of the text.

Submission

Submit your ISCAL file for the complete program.