This preview shows page 1. Sign up to view the full content.
Unformatted text preview: gister + ... Figure 8.3: Generating the address of an exception handler. The exception number is an index into the exception table. 394 CHAPTER 8. EXCEPTIONAL CONTROL FLOW An exception is akin to a procedure call, but with some important differences. ¯ ¯ ¯ ¯ As with a procedure call, the processor pushes a return address on the stack before branching to the handler. However, depending on the class of exception, the return address is either the current instruction (the instruction that was executing when the event occurred) or the next instruction (the instruction that would have executed after the current instruction had the event not occurred). The processor also pushes some additional processor state onto the stack that will be necessary to restart the interrupted program when the handler returns. For example, an IA32 system pushes the EFLAGS register containing, among other things, the current condition codes, onto the stack. If control is being transferred from a user program to the kernel, all of the...
View Full Document
- Spring '10
- The American