| |||
| Home > Handling Processor Exceptions > About processor exceptions | |||
During the normal flow of execution through a program, the program counter (PC) increases sequentially through the address space, with branches to nearby labels or branch and links to subroutines.
Processor exceptions occur when this normal flow of execution is diverted, to enable the processor to handle events generated by internal or external sources. Examples of such events are:
externally generated interrupts
an attempt by the processor to execute an undefined instruction
accessing privileged operating system functions.
It is necessary to preserve the previous processor status when handling such exceptions, so that execution of the program that was running when the exception occurred can resume when the appropriate exception routine has completed.