Check the queue first
An interrupt is a signal that asks the processor to pause the current process. Each interrupt is given a priority and placed in the interrupt queue.
The processor finishes the current cycle, then checks the interrupt queue for a higher priority. A program runs at priority 2, and the printer interrupt has priority 1. The keyboard interrupt has priority 3, and the key is A.
If the priority is higher than the program, the processor stores the registers on the stack and calls the ISR (interrupt service routine).
Which interrupt should the processor handle first if both are waiting: priority 1 or priority 3?
Program priority 2, running Printer source, priority 1 Keyboard source, priority 3, key A Queue interrupt queue Processor checks each priority Stack stores the registers ISR interrupt service routine
The stack is where the processor stores the registers of the current process. The processor retrieves those registers after the ISR if no higher-priority interrupt is waiting.
Run the simulation
Watch the printer and the keyboard, then the queue, the stack, and the ISR.
Put the steps in order
Click steps from the pool to build the eight-step sequence. Click a chosen step to remove it.
Three ideas
Priority, the queue, the stack, and the ISR.
Into the queue
An interrupt is given a priority and placed in the interrupt queue. The processor finishes the current FE cycle, then checks the queue for a higher priority.
Lower or higher
If the interrupt has lower priority, the processor runs the next FDE cycle for the program. If the priority is higher, the processor stores the current registers on the stack.
Handle, then continue
The processor checks the source, calls the appropriate ISR, and the ISR handles the interrupt. If another higher-priority interrupt is waiting, the processor repeats the check. Otherwise it retrieves the registers from the stack and continues the program.