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

IRQPurposeDevice
IRQ 0System Timer8253 Timer 0
IRQ 1KeyboardKeyboard Controller
IRQ 2Cascade (PC/AT)Second 8259 (AT only)
IRQ 3Serial Port 2COM2 (if present)
IRQ 4Serial Port 1COM1
IRQ 5Parallel Port 2LPT2 (if present)
IRQ 6Floppy DiskFloppy Disk Controller
IRQ 7Parallel Port 1LPT1

Hardware Interface

I/O Ports

  • 0x20: Command/Status Register
  • 0x21: Data/Mask Register