Created 07/03/03; revised 07/03/15

on the Exception Handler

Instructions: For each question, choose the single best answer. Make your choice by clicking on its button. You can change your answers at any time. When the quiz is graded, the correct answers will appear in the box after each question.

1. What is the name for the small collection of services on SPIM that are invoked using a syscall instruction?

A.    wolf trap
B.    exception handler
C.    BIOS
D.    operating system

2. Does the syscall instruction correspond to just one machine language instruction?

A.    No—it is so complicated that it takes several machine instructions.
B.    No—it is special and does not correspond to any machine instructions.
C.    Yes—it is a fundamental operation of the hardware.
D.    Yes—all assembly language statements correspond to one machine instruction.

3. Which of the following fragments correctly writes "Hello" to the monitor?

        lw      $v0,4
        lw      $a0,hello
         . . .
hello:  .asciiz "Hello"
        li      $v0,4
        la      $a0,hello
         . . .
hello:  .asciiz "Hello"
        li      $v0,4
        lw      $a0,hello
         . . .
hello:  .ascii  "Hello"
        li      $v0,4
        li      $a0,"Hello"
         . . .

4. Where is the integer after the "read integer" service returns control?

A.    In the input buffer.
B.    In a register specified by the user.
C.    In register $v0.
D.    In register $a0.

5. What parameters are expected for the "read string" service?

A.    The address of the input buffer.
B.    The length of the input buffer.
C.    The addresses of the input buffer and of the output buffer.
D.    The length of the input buffer and the address of the input buffer.

6. Are the code numbers for the various services determined by the MIPS hardware or by the software of the the exception handler?

A.    This is a hardware feature of the MIPS chip.
B.    This is a hardware feature of the various IO devices attached to the computer.
C.    Software—the user program sets up the service codes before it starts execution.
D.    Software—the exception handler software examines the code and branches to the indicated service.

7. In an actual computer system with a full-scale operating system, what would the exit service do?

A.    Return control to the operating system.
B.    Halt the processor.
C.    Halt the operating system.
D.    Immediately start running another user program.

8. Is "backspace" a character?

A.    No — hitting backspace on a keyboard sends a command to the computer.
B.    No — backspace corresponds to a control signal that affects the monitor.
C.    Yes — the backspace sends the same character as the back arrow key.
D.    Yes — as far as the hardware is concerned, backspace is just another ascii character.

9. What does the "read integer" service do?

A.    It reads two's complement integers directly from the keyboard.
B.    It reads a single digit from the keyboard and returns it in $v0.
C.    It reads the next number on the current line. If there is no next number it goes on to the next line.
D.    It reads in a line of characters from the keyboard and then converts those characters to a two's complement integer.

10. With a full-sized operating system, when a user enters a string of characters in response to a prompt, where are editing characters (like delete and backspace) interpretted?

A.    In the user's program.
B.    An operating system service is running as the user enters and edits text.
C.    The keyboard device driver implements line editing.
D.    The basic IO system is in charge of this.

   The number you got right:       Percent Correct:       Letter Grade:   

Click here

If you have returned here from another page, or have re-loaded this page, you will need to click again on each of your choices for the grading program to work correctly. You may want to press the SHIFT KEY while clicking to clear the old answers.