|
CS 2731, Spring 2004 |
Recitation 10 must be submitted
following directions at: submissions on or before
|
Outline: In this laboratory you will explore exception handling in MIPS.
spim -file instructions.sThe program should generate six Bad Data/Stack Address Exceptions (Exception 7) because the program assumes that the data segment starts at 0 and xspim assumes that it starts at 0x10000000.
xspim -file instructions.s
cat instructions.s trap.handler > instr_trap.sRun xspim using the following command line. (Don't forget the -notrap option, or Spim will load both the default handler and the one you concatenated at the end.)
xspim -notrap -file instr_trap.sYou can also try out spim:
spim -notrap -file instr_trap.sThe program should run the same way it did before.
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 storedYour program should handle these exceptions so that the correct calculation is performed and a 36 is printed at the end.
Contents of submission
for Recitation 10: Last Name, First Name; Course Number; Recitation Number (9).
|