OCR A-Level Computing New Syllabus/Unit 1.2.1 Systems Software

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Interrupt handling

Vital that the CPU can be interrupted when necessary, interrupts can be sent to the CPU by software hardware devices or the CPUs internal clock.

Interrupt examples: I/O device sends an interrupt signal, the printer runs out of paper, an error occurs in a program, a scheduled interrupt from the internal clock, power failure

Using the stack, when interrupt detected, the processor stops fetching inst and instead pushes the current contents of its registers onto a stack. CPU uses interrupt service routine to process the interrupt. When processing finished, can be popped from the stack and reloaded into the CPU. Interrupt priority, have different priorities. Higher priority interrupt occurs whilst an interrupt is being processed, original interrupt’s registers will be pushed onto the stack as well. LIFO.