Interrupts Flashcards
what is an interrupt
a signal to the CPU indicating that an event needs immediate attentoin, pausing the current program flow
interupts can be either [1] or [2]
1 = hardware
2 = software
what is an interupt service routine (ISR)
a small dedicated program that the CPU runs in response to an interrupt. after it is finished the control returns to the interruprted program
at what point in the Fetch–Execute cycle are interrupts checked?
At the end of each cycle, before the next fetch phase begins.
Outline the four main steps the CPU takes when handling an interrupt.
- Save the volatile environment (PC, registers)
- Jump to the ISR
- Execute the ISR
- Restore the saved state and resume the original program
What is meant by the “volatile environment” and why must it be saved
The current contents of registers, the program counter (and sometimes stack pointer) that will change during the ISR; saving it lets the CPU restore and continue the original task correctly. |