Interrupts is a signal send by an external device to the processor so as to request the processor to perform a particular task or work. The microprocessor allows normal program execution to be interrupted in order to carry out a specific task/work.
The interrupts are useful for efficient data transfer between processor and peripheral. When a peripheral is ready for data transfer, it interrupts the processor by sending an appropriate signal. Upon receiving an interrupt signal, the processor suspends the current program execution, save the status in stack and executes an
ISR to perform the data transfer between the peripheral and processor.
ISR to perform the data transfer between the peripheral and processor.
ISR:- Interrupt Service Subroutine.
The various steps in interrupt handling are:-
1. It decrement stack pointer by two and pushes the flag register on to the stack.
2. It disables the 8086 interrupt input by cleaning the interrupt flag IF.
3. It tests the trap flag in flag register.
4. It decrements the SP by two and pushes the current code segment register constants on the stack.
5. It decrement SP again by two and pushes the current input contents on the stack.
6. It does an indirect far jump to start of procedure you write to respond to the interrupt.
The processor can be interrupted in the following ways:-
a. By an external signal generated by a peripheral
b. By an internal signal generated by a special instruction in the program.
c. By an internal signal generated due to an external condition which occurs while executing an instruction. ( For example, in 8086 processor, divide by zero is an exceptional condition which initiates type-0 interrupt and such an interrupt is also called exception. )
Classification of interrupts
In general the interrupts can be classified in the following three ways.
1. Hardware and software interrupts.
2. Vectored and non-vectored interrupts.
3. Maskable and non-maskable interrupts.
0 comments:
Post a Comment