Intel 8259 Programmable Interrupt Controller
The Intel 8259 Programmable Interrupt Controller (PIC) is essential for the operation of much of the hardware of the IBM PC. The PIC can be thought of an expansion unit to the 8088’s single INTR line, allowing 8 separate interrupt sources to be handled in a prioritized manner.
The PIC is a surprisingly challenging chip to emulate correctly, partially due to some ambiguities in its documentation.
IBM PC Interrupt Configuration
| IRQ | Purpose | Device |
|---|---|---|
| IRQ 0 | System Timer | 8253 Timer 0 |
| IRQ 1 | Keyboard | Keyboard Controller |
| IRQ 2 | Cascade (PC/AT) | Second 8259 (AT only) |
| IRQ 3 | Serial Port 2 | COM2 (if present) |
| IRQ 4 | Serial Port 1 | COM1 |
| IRQ 5 | Parallel Port 2 | LPT2 (if present) |
| IRQ 6 | Floppy Disk | Floppy Disk Controller |
| IRQ 7 | Parallel Port 1 | LPT1 |
Hardware Interface
I/O Ports
- 0x20: Command/Status Register
- 0x21: Data/Mask Register