Exceptions
Overview
An exception is an abrupt change in the control flow in response to some change in the processor's state. The change in state is known as an event.
When an event occurs, the processor makes an indirect procedure call (the exception), though a jump table (the exception table), to an operating system subroutine (the exception hander) specifically designed to process this kind of event.
Afterward, one of the following occurs:
- The handler returns control to the current instruction.
- The handler returns control to the instruction that would have executed had the exception not occurred.
- The handler aborts the interrupted program.
Exception Table
Every exception is given a unique nonnegative integer called its exception number. This is used as an index into the exception table in which entry
The starting address of the exception table is contained in a special CPU register called the exception table base register (ETBR).

Exception Classes
There exist four classes of exceptions with the following characteristics:
| Name | Cause | Async/Sync | Return Behavior |
|---|---|---|---|
| Interrupt | Signal from I/O device | Async | Returns to next instruction |
| Trap | Intentional exception | Sync | Returns to next instruction |
| Fault | Potentially recoverable error | Sync | Might return to current instruction |
| Abort | Nonrecoverable error | Sync | Never Returns |
Interrupts
An interrupt is an asynchronous exception, signaled from an I/O device.

Traps
A trap is an intentional exception that occurs as a result of executing an instruction. The most important use of traps is to provide system calls.

Faults
A fault is an exception that occurs from error conditions that a handler might be able to correct.

Aborts
An abort is an exception that occurs from unrecoverable fatal errors. Control is never returned to the user program.
