8086 Interrupts
8086 Interrupts
8086
Pins and Signals
Microprocessor
Common signals
AD0-AD15 (Bidirectional)
Address/Data bus
2
General flow
Process in
execution
Returns
Main Process requires I/O service
Program
I/O
Interrupt
Interrupt
Service
Routine
Flowchart of basic interrupt
mechanism
Fetch
Instruction
Increment PC
Decode and
Execute instr.
No
Int request line
Restore PC
active
Yes
Interrupt
Store PC service
Routine
What is Interrupt
8086/88 Interrupts
• 256 Interrupts.
From PPI
NMI CPU
Device
Interrupt
Request
Hardware Interrupts
D0-7
IR0
INTR
8086/ 8259
8088 INTA* PIC
NMI IR7
AD0-AD7
D0 –D7 IR0 IR0
INTR INT
INTA INTA
8259
RD RD IR7 IR7
WR WR CAS0
CAS1
A0 CAS2
CS SP/EN +5v
4.7kohm
INT INTA
IR0
In- Interrupt
service Priority Request
Register Resolver Register
(ISR)
(IRR)
IR7
0 1 2
IR0 INT7
INT
8259
PC/XT Hardware
Interrupts
PC AT Hardware
Interrupts
Interrupt Vector Table
Answering an Interrupt
• Save status
– FR, IP, CS
• Hardware interrupts:
– Only 3 pin, but how 256 interrupt?
– INTR (in), NMI (in), and INTA (out)
– INTR can be masked by CLI / STI
– Active high.
» 80x86 finished instruction.
» Push FR, CS, IP
– NMI: INT 02.
• Software interrupts
– INT nn
– Example: INT 21H (DOS functions)
Interrupt and Flags
Predefined Interrupts
ICW1: 13H
ICW2: 08H
ICW3: 09H
Interrupt Sources in PC
Sources of NMI
8259s in AT
IRQ9 Instead of IRQ2
Interrupts (Summary)
Edge Triggered and Interrupt
Sharing