COMP 231 - Assignment 3 |
Due in class, Thurs. March 29 |
In this assignment you are to write a MIPS assembly program to
maintain a sorted list of integers in the range 0...9. Here are
the commands that your program should be able to handle:
-
Insert x - inserts x into the list.
-
Delete x - deletes x from the list. If there are multiple copies of x
then only one is deleted. If x is not in the list, the list remains
unchanged.
-
Size - prints the size of the list. (Prints 0 if the list is empty.)
-
Print - prints the list in sorted order from smallest to largest.
-
Quit - exits the program.
The commands are to be coded using 2 decimal digits as follows:
-
Insert x - 1x, where x is between 0 and 9
-
Delete x - 2x, where x is between 0 and 9
-
Size - 30
-
Print - 40
-
Quit - 50
So for example a log of a session with your program might look like:
Command: 11
Command: 13
Command: 11
Command: 30
3
Command: 40
1,1,3
Command: 21
Command: 30
2
Command: 40
1,3
Command: 50
Good-bye!
To be handed in:
(1) A complete listing of your fully documented code. Almost every line
of code should have a comment. (2) The log
of one session which fully tests your code. Make sure your session
tests all features of your program. (3) Email me your dot s file.
Bonus:
Modify your program so that is accepts arbitrary signed integers and
allows the user to use the words "Insert", "Delete", etc. to input their
requests.
|
Report problems to dkrizanc at wesleyan dot edu
 |