Saving the CPU's state before handling an interrupt
Before running the ISR, the CPU stores its register contents, including the program counter, so the interrupted task can later carry on exactly where it stopped.
Understanding Saving the CPU's state before handling an interrupt in IGCSE Computer Science Paper 1
What it does: Restoring the saved values returns the registers and program counter to how they were before the interrupt. The register contents are stored so the interrupted task can carry on later. Deleting them would lose the task's work. Saving the state means no progress is lost. The task resumes from the point it was interrupted. The program counter holds the address of the next instruction, so saving it lets the CPU return to the right place after the ISR.
Common mistakes: The save, ISR and restore steps only happen when an interrupt has been received. The test should be interrupt_flag = TRUE. After the ISR the CPU must restore the saved program counter, not throw it away. Without it, the interrupted task cannot carry on where it stopped.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 409–418) and word search (Modules 390–418).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
save register contentsFill in the Blanks
Spot the Error
Student with a class code? Join your class →