Professional Documents
Culture Documents
Interrupt 8086
Interrupt 8086
Interrupt 8086
interrupt in 8086
Interrupts in the 8086 microprocessor are mechanisms by which a program's normal execution flow is
temporarily halted to allow the processor to handle a specific event or condition. There are several
types of interrupts in the 8086 microprocessor:
1. Hardware Interrupts: These are triggered by external hardware devices. They are further
divided into:
Maskable Interrupts (INTR): These can be enabled or disabled using the Interrupt Flag
(IF). An example is the INTR pin.
Non-Maskable Interrupts (NMI): These cannot be disabled and have a higher priority. The
NMI pin is used for such interrupts.
2. Software Interrupts: These are triggered by executing the INT instruction in the program. They
are used to call operating system services or other routines. They have the following types:
INT n: The INT instruction followed by a type number (n) ranging from 0 to 255.
3. Internal Interrupts: These are also known as exceptions. They are generated by the CPU in
response to error conditions. Common examples include:
Divide-by-zero error: When a division by zero occurs, the CPU generates an interrupt.
Overflow: When an arithmetic overflow occurs.
When an interrupt occurs, the 8086 looks up a predefined location in memory called the Interrupt
Vector Table (IVT) to determine the address of the interrupt service routine (ISR). The IVT is located at
the beginning of memory (0000h to 03FFh) and contains 256 vectors, each consisting of a 4-byte
address (segment
) of the ISR.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 1/2
Common Interrupt Types and Their Vectors
assembly
In this example, `int 21h` calls a DOS service to print a string. The service number (09h) is loaded into
the AH register, and the address of the string is loaded into the DX register.
The 8086 microprocessor can enable or disable maskable interrupts using the following instructions:
These instructions modify the Interrupt Flag (IF) in the flags register.
Understanding interrupts in the 8086 microprocessor is crucial for effective low-level programming,
especially in systems where real-time processing and hardware interfacing are
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 2/2