Interrupts
Interrupts
If, it finds an interrupt request, then decides to acknowledge and service it.
These 256 vectors are stored in a table called the ‘Interrupt Vector Table’
(IVT) in system RAM from locations 00000 to 003FFH i.e., upto 0000: 03FF.
Interrupt vector table of 8086 A typical interrupt vector (4 bytes)
Example
Find the address (in the IVT) of the interrupt vector of INT 61H. Find the
physical address of the ISR corresponding to this interrupt if the vector is
0F00:9872.
Example -solution
• The type number of the interrupt is 61H = 97 in decimal.
• The address of the interrupt vector is 97x4 = 388 = 184H.
• Thus, the interrupt vector is to be stored in the IVT in location 0000:0184 onwards.
• For the ISR, the CS value is 0F00H and the IP value is 9872H. The part of the interrupt vector
table which has these vectors stored is shown.
Dedicated Interrupt Types
INT 0 (Divide by Zero Error)
The interrupt with type number 0 is dedicated to the ‘divide by zero’ error.
This interrupt is an ‘error generated’ interrupt (also an ‘exception’).
Dedicating Type 0 for this case means that the corresponding interrupt
vector in the interrupt vector table is available at 0000:0000.
INT 1 (Single Stepping)
During logical debugging of our programs, we would like to stop after the
execution of each instruction and check the contents of registers, memory
and so on.
For this , the TRAP flag needs to be set.
INT 2 (Non Maskable Interrupt)
This interrupt corresponds to the overflow flag. If the overflow flag is set,
this interrupt occurs, but not automatically.
There are two pins on which interrupt requests can be received – they are
the INTR pin and the NMI pin.
NMI (Non Maskable Interrupt)
This is a positive edge triggered interrupt, but it is also required to have a
duration in the high state of more than two clock cycles.
• This is a non maskable interrupt, in that t does not depend on the setting
of the interrupt flag (IF). It cannot be masked or prevented from being
activated.
It is a Type 2 interrupt,
INTR
This is the non-vectored interrupt pin of the 8086, which means that
when an interrupt request is received on this pin, it does not get
automatically directed towards any particular entry in the IVT.
The interrupt flag (IF) is required to be set for an interrupt request on the
INTR line to be honored.
During the first machine cycle, the interrupting device places the ‘type
number’ of the interrupt on the lower data lines (D0 to D7), which comes
out of the float condition.
Interrupt acknowledge machine cycle of the 8086
Can We Consider the Reset Pin as an
Interrupt Pin?
Priority of Interrupts
When many interrupts occur at the same time, which source gets its
request honored first? The processor decides the priority. The order of
priority is set in the following manner:
Thus, the user can write any procedure as an ISR, store it in some address
in memory and call it by using the instruction INT n.
Interrupt Vector Table Allocation
What Is the Size of an Interrupt
Instruction?
Thank you