Recitation 13 must be submitted
following directions at: submissions on or before
|
Outline: In this laboratory you will explore exception handling in MIPS. Note: It may help you with this recitation to look over and work on the Take-Home Quiz, which is due in class, Monday, 29 November 2004, for full credit.
spim -file instructions.sThe program should generate six exceptions labeled with [Bad data address] (Exception 7) because the program assumes that the data segment starts at 0 and xspim assumes that it starts at 0x10010000.
xspim -file instructions.s
cat instructions.s exceptions.s > instr_excep.s
xspim -notrap -file instr_excep.s
spim -notrap -file instr_excep.sThe program should run the same way it did before, except with the altered exception 7 message.
When you run the program you should only get two Exception 7 occurrences at the instructions:
lw $t4, 84($t1) #Constant 4 stored in $t4 .... sw $t3, 0($t1) #sum is stored
Your altered exception handler should handle these exceptions so that the correct calculation is performed and a 36 is printed at the end.
Contents of submission
for Recitation 13: Last Name, First Name; Course Number; Recitation Number (13).
Special Note: In class I acted as if you could use spim on the Sun machines if you wanted to (the old version), but I've changed my mind. You must use the spim on the Linux machines, or on your own machine unless you have an old version. The code for exceptions.s will not run on the Sun machines. |