Instruction - Exception

> Computer System > Instruction (Machine Language)

1 - About

An exception is an event that occurs when:

  • when an instruction causes an error. (Example: an attempt to divide by zero generates an exception)

Some types of exceptions may provide error codes. An error code reports additional information about the error.


3 - Notation

An example of the notation used to show an exception and error code is shown below:

#PF(fault code)


  • PF refers to page-fault exception
  • fault code is an error code naming a type of fault (Default to zero)

4 - Handler

When a call is made to an exception handler procedure, the processor automatically saves the state of the EFLAGS register on the procedure stack. When an exception is handled with a task switch, the state of the EFLAGS register is saved in the TSS for the task being suspended.

5 - Documentation / Reference