← IGCSE Computer Science Paper 1

What happens as a result of an interrupt

What the ISR does depends on the event: it reads a key press, updates the pointer, shows an error or stops a faulty program. Then the CPU resumes the task it was running.

Understanding What happens as a result of an interrupt in IGCSE Computer Science Paper 1

What it does: A divide by zero is a software interrupt. The ISR deals with it by showing an error message or stopping the program that caused it. The result of every interrupt ends the same way: the saved state is restored and the interrupted task carries on. The keyboard interrupt makes the ISR read the key press and pass the character to the program. Then the CPU carries on. The mouse move interrupt is handled by an ISR that updates the pointer position. Nothing is deleted. Handling a key press does not stop other programs. The CPU returns to the task it was running.

Common mistakes: A key press is read from the keyboard, not the monitor. The monitor is an output device, so it cannot supply the character. The line should be ISR: READ key FROM keyboard. Moving the mouse does not need the computer to shut down. The ISR just updates the pointer position, so the line should be ISR: UPDATE pointer position.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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.

Learning
Duo
A user presses a key while a word processor is open. What does the ISR do?
It shuts down the computer and restarts itIt reads the character and passes it to the program
Matches
divide by zero interrupt -> ISR reads a key press
↓
The ISR action is wrong for the event. A divide by zero is dealt with by showing an error message or stopping the faulty program, not by reading a key press.
Applying
Meanings
Term
interrupt outcome
Meaning
What the ISR does depends on the event: it reads a key press, updates the pointer, shows an error or stops a faulty program. Then the CPU resumes the task it was running.
Practice
PROCEDURE ISR(event)
Testing
Gaps
character ← ()
Check Answer
Spots
1INTERRUPT key_press
2ISR: READ key FROM monitor

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Golden Phoenix' badge — Savannah Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A user presses a key while a word processor is open. What does the ISR do?
A. It reads the character and passes it to the program ✓
B. It shuts down the computer and restarts it
The keyboard interrupt makes the ISR read the key press and pass the character to the program. Then the CPU carries on.
2. A user moves the mouse. What is the result of the interrupt?
A. The current program is deleted from memory
B. The pointer position on the screen is updated ✓
The mouse move interrupt is handled by an ISR that updates the pointer position. Nothing is deleted.
3. A program tries to divide a number by zero. What can the ISR do?
A. Return the answer 0 and hide the problem
B. Show an error message or stop the faulty program ✓
Division by zero is a software interrupt. The ISR shows an error message or stops the program, because there is no valid answer.
4. Two processes try to use the same area of memory at once (a memory conflict). What can happen?
A. One process is stopped or made to wait ✓
B. Both processes overwrite the memory at the same time
The ISR deals with the conflict by stopping one process or making it wait, so the memory is protected.
5. Once the ISR has finished handling an interrupt, what does the CPU do next?
A. Returns to the task it was interrupted from and carries on ✓
B. Starts the interrupted program again from the beginning
The saved state is restored, so the CPU resumes the interrupted task where it left off.

Match the Pairs

key press interrupt -> ISR reads the character → The ISR reads the key that was pressed and passes the character to the program that is waiting for it
mouse move interrupt -> ISR updates pointer → The ISR works out the new position and the pointer on the screen is moved to it
Dividing by zero causes an interrupt, and the ISR shows an error message or stops the faulty program → IF divisor = 0 THEN ISR shows error / stops program
When the ISR has finished, the CPU goes back to the task it was running before the interrupt → ISR finished -> restore state -> resume task
divide by zero interrupt -> ISR reads a key press → The ISR action is wrong for the event. A divide by zero is dealt with by showing an error message or stopping the faulty program, not by reading a key press.
ISR finished -> CPU stops and never runs the task again → After the ISR the CPU should return to the interrupted task and carry on. It does not stop for good.

Key Term

interrupt outcome
What the ISR does depends on the event: it reads a key press, updates the pointer, shows an error or stops a faulty program. Then the CPU resumes the task it was running.

Fill in the Blanks

1. IF event = "key press" THEN character ← readKey() passToProgram(character)
Hint: Type the function name that reads the character from the key that was pressed.
2. IF event = "mouse move" THEN updatePointer(newX, newY) ENDIF
Hint: Type the function name that changes where the pointer is shown on screen.
3. IF event = "divide by zero" THEN showError("Cannot divide by zero") stopProgram()
Hint: Type the function name that tells the user something went wrong.
4. IF event = "memory conflict" THEN stopProcess(faultyProcess) ENDIF
Hint: Type the function name that halts the process causing the memory conflict.
5. restoreState() resume(interruptedTask)
Hint: Type the function name that lets the CPU carry on with the task it was running before the interrupt.

Spot the Error

Question 1
A INTERRUPT key_press
B ISR: READ key FROM monitor
C PASS key TO program
D RESUME previous task
Line B — A key press is read from the keyboard, not the monitor. The monitor is an output device, so it cannot supply the character. The line should be ISR: READ key FROM keyboard.
Question 2
A INTERRUPT mouse_move
B ISR: SHUT DOWN the computer
C REDRAW pointer on screen
D RESUME previous task
Line B — Moving the mouse does not need the computer to shut down. The ISR just updates the pointer position, so the line should be ISR: UPDATE pointer position.
Question 3
A INTERRUPT mouse_move
B ISR: SHOW error message
C STOP faulty program
D CPU RESUMES other tasks
Line A — The ISR here shows an error message and stops the faulty program. That outcome belongs to a divide by zero interrupt, not a mouse move. The line should be INTERRUPT divide_by_zero.
Question 4
A INTERRUPT memory_conflict
B ISR: FIND clashing process
C SPEED UP that process
D RESUME the interrupted task
Line C — With a memory conflict, the clashing process is stopped or made to wait so it stops interfering. Speeding it up would make the clash worse. The line should be STOP or WAIT that process.
Question 5
A INTERRUPT key_press
B SAVE state of CPU
C ISR: READ key
D PASS key TO printer
E RESUME interrupted task
Line D — The character that was read is passed to the program the user is typing into, not to a printer. The line should be PASS key TO program.

Student with a class code? Join your class →