written 2.8 years ago by |
INTERRUPTS OF 8086:
The interrupts of 8086 are :
Hardware Interrupts
Software Interrupts 256
Divide -by - Zero Interrupt (Type - 0 Interrupt)
Single Step (or) TRAP Interrupt (Type-1 Interrupt)
Non-Maskable Interrupt (NMI) (Type -2 Interrupt)
Break-point Interrupt (Type - 3 Interrupt)
Overflow Interrupt (Type - 4 Interrupt)
1. Hardware Interrupts:
8086 has two hardware interrupts NMI and INTR
NMI: It is a Non-maskable Interrupt
• NMI has the highest priority among external interrupts
• NMI is edge-triggered on a low to high transition
• It is required to remain in high state for more than two clock cycles
INTR: It is a maskable interrupt
•INTR has lower priority as compared to NMI
•INTR is a level-triggered input which is sampled during last clock cycle of every instruction
• INTR signal can be masked by resetting interrupt Flag (IF)
2. Software Interrupts:
• o255 Software interrupt is generated by inserting INT instruction in a program
• 8086 has 256 software interrupts (i.e, INT O - INT 255) Vectored
3. Type-0 Interrupt :
•Type-0 interrupt is Divide - by – Zero Interrupt
•When the result (Quotient) of division operation is too larg to be stored in the destination register then 8086 perform Type-0 interrupt
•NMI is edge-triggered on a low to high transition
•It is required to remain in high state for more than two clock cycles
4. Type-1 Interrupt :
•Type-1 interrupt is a single step interrupt
•Single step interrupt is used for debugging Program (ALP)
•In single step control, the processor executes one instruction and then stops
•Thereafter the contents of registers and memory can be examined to see the result If the results are correct the user can give a command to execute the next instruction
•In 8086 Trap flag(TF) is set to 1, to implement single step control
•The ISR for Type-1 interrupt is written to save the contents of all registers on the stack so that results can be examined
5. Type-2 Interrupt:
• Type-2 is Non-maskable emergency conditions interrupt used for some emergency conditions.
•ISR for Type-2 interrupt is written to save program which processor is executing
• For example, it can be used to save program and data when power fails
•The program along with the data is restored when power returns
6. Type-3 Interrupt :
•Type-3 interrupt is Break-point Interrupt A break point is inserted in a program program (ALP) for debugging
•The program is executed up to the break point and an interrupt occurs at this point of the program
•The ISR saves the contents of the registers on the stack
•The register contents may be displayed on the CRT terminal (or) the control is returned to the user
7. Type-4 Interrupt :
•Type-4 interrupt is an Overflow Interrupt
•When signed result of an arithmetic operation on two signed numbers is too large to be stored in the destination register (or) memory location, an overflow error occurs and the 8086 sets overflow flag(OF) to 1
•To implement Type-4 interrupt INTO instruction is inserted in the program immediately after the arithmetic instruction
•If OF = 0; INTO instruction performance no operation OF = 1; INTO instruction performance Type-4 interrupt