Input-Output Programming using Interrupt
Program Interrupt is an alternative method to programmed control for managing input-output (I/O) communication, specifically designed to improve efficiency in computer systems.
The CPU constantly checks a flag bit to determine if an I/O device is ready. This continuous checking wastes valuable processing time since I/O devices are significantly slower than the CPU.
The CPU continues executing other tasks and is only interrupted when the I/O device is ready. This maximizes CPU utilization and system efficiency.
Enable interrupts using ION instruction
CPU executes main program
Device sets flag (FGI/FGO)
CPU stops current task
Handle I/O operation
A special flip-flop that controls whether the computer can be interrupted:
When IEN = 0, all interrupt requests are ignored, giving the programmer full control over when interrupts can occur.
Special flags that indicate device status:
These flags work in conjunction with IEN to determine when an interrupt should occur.
An interrupt occurs when:
If IEN = 0, no interrupts can occur regardless of device flags, ensuring the main program has complete control when needed.
CPU can perform other useful computations instead of constantly checking I/O flags, leading to better overall system performance.
Maximum utilization of CPU cycles by eliminating idle waiting time during slow I/O operations.
Responds immediately to I/O events without wasting time on unnecessary polling operations.