Computer
Organization and Design
(Textbook. Click for information.)

 CS 2733/2731
 Computer Organization II
 Spring 2004

 Take-home Quiz
   Exceptions
 Due Wednesday, 28 April 2004,
   (start of class)


Basis for the Quiz: The quiz is based on the following MIPS assembler program, including a very small exception handler. Execution starts at line 30, which then calls main. In running this code, the -notrap option must be used (and must be place first after spim), that is:

Below is the code (line numbers to the left are not part of the code). Here is the source of the above code without line numbers: quiz_exception.s


Questions: Please submit answers to the following questions on 26 April 2004 at the start of class. I prefer computer-printed answers, but hand-written answers will also be accepted.

  1. What will happen if the above code is run without lines 27 through 32 and without the -notrap option, that is, with % spim -file quiz_exception0.s? This code is given below and in quiz_exception0.s:

  2. Assume now that the entire program is run with the -notrap option. Starting with line 2, describe what is printed when this code segment executes lines 2 through 12. Will Duhh-hhhhh! be printed and if so, why?

  3. What (if anything) is line 26 (jr $k0) doing? What would happen if line 25 (addiu $k0 $k0 4) were omitted?


Revision date: 2004-04-19. (Please use ISO 8601, the International Standard.)