CSC252 Assignment 3
Wed Feb 14 14:50:25 EST 1996
In assignment 1 you wrote a simple sorting program split in separate files. For this assignment you will rewrite part of that program in MIPS assembly language. In particular I want you to rewrite the sorting routine in assembly. You will be using MIPS assembly so you will no longer be able to run your program natively on the Suns. Instead I have installed a simulator called MINT (which we will use in future assignments as well) that interprets MIPS executables. I have also installed a new compiler called mips-gcc that generates MIPS executables. Use the new compiler to compile your program and then use the following command to run it.
mint program_name arg1 arg2 ....
The simulator will print the program output and the will also print some statistics about the simulation run itself. You need not care about the statistics for now. A sample output for a program that computes the greatest common divisor looks like this:
mint a.out 7 5 7 5 1 Command line: mint a.out 7 5 Started: Wed Feb 14 14:46:24 1996 Finished: Wed Feb 14 14:46:25 1996 Elapsed time for simulation: 0:01 on coke.csug.rochester.edu CPU time: user: 0:00.21, system: 0:00.14 total: 0:00.35 (0.35 sec) Space used by malloc: 1388K Elapsed simulated cycles: 5482, cpu cycles: 5482 Processors used = 1, average cpu_time/proc = 5482.0
The first line of the output is what the program printed; in this case the two input numbers and their greatest common divisor. The remaining stuff is simulator statistics. You will find both the simulator and the MIPS compiler in /u/kthanasi/bin The assignment is due Monday, February 26. Turn in the source-code for your assembly routine and the location of your code so we can test it. Start early and report all problems with the compiler and the simulator to me. Good luck!