CS470 Spring 2008
Lab Assignment 3
Due March 14, 11 PM
Updated March 12, 2008
Write a bubble sort program for MIPS assembly language with these specifications:
You don't have to use the stack-frames for this assignment. Pass the parameter j using register $a0.
Name the file initial_lastname_l3.asm and submit using RAMCT. Test the program thoroughly before submitting, by trying different arrays. You program should be complete and ready to load in the SPIM simulator. Include appropriate comments. Add your name and S ID at the top.
Note: Since this is your first MIPS assembly language program, you may encounter some questions. Let us discuss these questions in the class on Tuesday.
If your simulator setting uses delayed branches, you may need to have a nop instruction after jr $ra for correct operation.
To see bubble-sort in animation see http://www.ee.unb.ca/petersen/lib/java/bubblesort/ or http://www.cs.ubc.ca/~harrison/Java/sorting-demo.html