CS305 MPMC - Module-3
CS305 MPMC - Module-3
CS305 MPMC - Module-3
1 06/09/2024
2 06/09/2024
3 06/09/2024
**What is an Interrupt?**
4 06/09/2024
8086 Microprocessor - Interrupts
5 06/09/2024
Interrupt processing flow chart
Main program
Interrupt N
Req
Accept N
Interrupt
Get interrupt
vector
Jump to ISR
Save PC
Load PC
6 ACOE255
Interrupt Cycle of 8086 Microprocessor
The interrupt cycle of the 8086 processor allows it to handle interrupts from external
devices or software in a systematic manner
7 06/09/2024
2) Interrupt Acknowledge (INTA)
The 8086 processor receives the interrupt signal and sends an acknowledgement signal (INTA) to the
Interrupt Controller
The INTA signal informs the Interrupt Controller that the processor is ready to receive interrupt data
The current state of the processor, including the contents of registers, is saved on the stack to ensure
a smooth transition to the interrupt service routine
The processor starts executing the interrupt service routine
5) Interrupt Return
Once the interrupt handler routine is executed, the processor restores the saved state from the stack.
The program execution continues from the point where it was interrupted.
8 06/09/2024
Classification of Interrupts
The interrupts initiated by external hardware by sending an appropriate signal to the interrupt pin
of the processor is called hardware interrupt
The software interrupts are program instructions
The interrupts whose request can be either accepted or rejected by the processor are called
Maskable interrupts.
The interrupts whose request has to be definitely accepted (cannot be rejected) by the processor
are called non-maskable interrupts
9 06/09/2024
Interrupt Vector Table (IVT)
IVT is a structured list containing the addresses of ISR for various interrupts.
10 06/09/2024
8086 Microprocessor - Interrupts
11 06/09/2024
12 06/09/2024
Hardware Interrupts
The 8086 has two hardware interrupt pins- NMI and INTR
13 06/09/2024
14 06/09/2024
15 06/09/2024
16 06/09/2024
Software Interrupts
These are instructions that are inserted within the program to generate
interrupts
There are 256 software interrupts in 8086 microprocessor
The instructions are of the format INT type
INT n ; where type n ranges from 00 to FF
(0 to 255)
17 06/09/2024
8086 µP - Interrupt Types
18 06/09/2024
Predefined (Reserved) Interrupts
1. Type 0 Interrupt – Divide by zero (Divide error interrupt)
Interrupt represents division by zero situation (K/0 = ∞ )
I. Interrupt
Interrupt is a hardware mechanism in which, the device notices the CPU that it requires its
attention. So when CPU gets an interrupt signal through the interrupt-request line, CPU stops the
current process and respond to the interrupt by passing the control to interrupt handler which
services device
II. Polling
The process in which the CPU constantly checks the status of the device- to see if it needs the
CPU's attention is called polling. It is basically a protocol in which the CPU services the I/O
devices.
It is an inefficient method because most of the time much of the CPU’s time is wasted on
unnecessary polls
20 06/09/2024
Difference between Interrupt and Polling
Sl Interrupt Polling
No.
1 In interrupt, the device notices the Whereas, in polling, CPU steadily
CPU that it requires its attention. checks whether the device needs
attention.
2 its a hardware mechanism. n this protocol, the CPU services the
device.
3 An interrupt handler services/works While in polling, the device is serviced
with the device. by CPU.
4 Interrupt-request line indicates that The command-ready bit indicates that
the device needs to be serviced. the device needs to be serviced.
5 Interrupts save the CPU cycles. Polling wastes many of the CPU
cycles.
6 Interrupts can occur at any point in CPU polls the devices at regular
time. intervals of time.
7 It becomes inefficient if devices Polling becomes inefficient when the
frequently interrupt the CPU. CPU rarely finds a device that is ready
21
to be serviced. 06/09/2024
Peripheral Devices
1) 8259 – Programmable Interrupt Controller
2) 8255 – Programmable Peripheral Interface
3) 8279 – Keyboard/Display Controller
4) 8257 – DMA Controller
22 06/09/2024
Pin Details of 8259
23 06/09/2024
Functional Block diagram (Architecture) of 8259
8 Functional Units
1) IRR - IR0-IR7
2) PR –
IR0 – highest priority
IR7 – lowest priority
3) IMR
4) ISR – Keep track of current
ISR
5) Control Logic – INT & INTA’
6) Data bus buffer – D0-D7
7) Read/Write Logic –
RD’, WR’,A0, CS’
8) Cascade Buffer-
CAS0-CAS2, SP’/EN’
24 06/09/2024
Interfacing of 8259 with 8086 Microprocessor
Type of interrupt signal
(Level/Edge triggered)
Type of processor
Type number
Masking of interrupts
Priority of interrupts
Steps:
Receive the interrupt IR0-IR7
Check for its priority and masking
8259 will send INT signal to INTR pin of 8086
8086 send acknowledge signal to 8259 through INTA’ pin
Receive the type number from 8259
Generate 20 bit vector table address
Start servicing the interrupt by executing the ISR stored in the vector address
25 06/09/2024
26 06/09/2024