Information Technology Reference
In-Depth Information
ting text to the screen and reading the current date and time.
Hardware interrupts allow external devices to gain the attention of the processor.
Depending on the type of interrupt the processor leaves the current program and goes to a
special program called an interrupt service routine (ISR). This program communicates with
the device and processes any data. After it has completed its task then program execution
returns to the program that was running before the interrupt occurred. Examples of interrupts
include the processing of keys from a keyboard and data from a sound card.
As previously mentioned, a device informs the processor that it wants to interrupt it by
setting an interrupt line on the PC. Then, depending on the device that caused the interrupt, a
call to an ISR is made. Each PIC allows access to eight interrupt request lines. Most PCs use
two PICs which gives access to 16 interrupt lines.
Processor
Processor
External
device
External
device
Interrupt-driven:
external devices
interrupt the processor
when they wish to communicate
Polling:
processor polls
devices to see if they
wish to communicate
Figure 2.8 Polling or interrupt-driven communications
Serial port (IRQ3/4)
Processor
Interrupt
lines
Software
interrupt
Interrupt
controller
Floppy (IRQ6)
Interrupt
controller
INT
Printer (IRQ7)
Interrupt
service
routines
Modem (IRQ4)
Mouse (IRQ12)
Keyboard (IRQ1)
Figure 2.9 Interrupt handling
Search WWH ::




Custom Search