Information Technology Reference
In-Depth Information
Table 2.5 Interrupt handling (codes followed by 'h' are in hexadecimal)
Interrupt
Name
Generated by
00 (00h)
Divide error
processor
01 (00h)
Single step
processor
02 (02h)
Non-maskable interrupt
external equipment
03 (03h)
Breakpoint
processor
04 (04h)
Overflow
processor
05 (05h)
Print screen
Shift-Print screen key stroke
06 (06h)
Reserved
processor
07 (07h)
Reserved
processor
08 (08h)
System timer
hardware via IRQ0
09 (09h)
Keyboard
hardware via IRQ1
10 (0Ah)
Reserved
hardware via IRQ2
11 (0Bh)
Serial communications (COM2)
hardware via IRQ3
12 (0Ch)
Serial communications (COM1)
hardware via IRQ4
13 (0Dh)
Reserved
hardware via IRQ5
14 (0Eh)
Floppy disk controller
hardware via IRQ6
15 (0Fh)
Parallel printer
hardware via IRQ7
16 (10h)
BIOS - Video access
software
17 (11h)
BIOS - Equipment check
software
18 (12h)
BIOS - Memory size
software
19 (13h)
BIOS - Disk operations
software
20 (14h)
BIOS - Serial communications
software
22 (16h)
BIOS - Keyboard
software
23 (17h)
BIOS - Printer
software
25 (19h)
BIOS - Reboot
software
26 (1Ah)
BIOS - Time of day
software
28 (1Ch)
BIOS - Ticker timer
software
33 (21h)
DOS - DOS services
software
39 (27h)
DOS - Terminate and stay resident
software
2.2.2 Hardware interrupts
Computer systems either use polling or interrupt-driven software to service external equip-
ment. With polling the computer continually monitors a status line and waits for it to become
active, whereas an interrupt-driven device sends an interrupt request to the computer, which
is then serviced by an interrupt service routine (ISR). Interrupt-driven devices are normally
better in that the computer is thus free to do other things, whereas polling slows the system
down as it must continually monitor the external device. Polling can also cause problems in
that a device may be ready to send data and the computer is not watching the status line at
that point. Figure 2.8 illustrates polling and interrupt-driven devices.
The generation of an interrupt can occur by hardware or software, as illustrated in Figure
2.9. If a device wishes to interrupt the processor, it informs the programmable interrupt con-
troller (PIC). The PIC then decides whether it should interrupt the processor. If there is a
processor interrupt then the processor reads the PIC to determine which device caused the
interrupt. Then, depending on the device that caused the interrupt, a call to an ISR is made.
The ISR then communicates with the device and processes any data. When it has finished the
program execution returns to the original program.
A software interrupt causes the program to interrupt its execution and goes to an interrupt
service routine. Typical software interrupts include reading a key from the keyboard, output-
Search WWH ::




Custom Search