.
.
Whenever an interrupt occurs the processor completes the execution of the current instruction and starts the execution of an Interrupt Service Routine (ISR) or Interrupt Handler. ISR is a program that tells the processor what to do when the interrupt occurs. After the execution of ISR, control returns back to the main routine where it was interrupted.
In 8086 microprocessor following tasks are performed when microprocessor encounters an interrupt:
- The value of flag register is pushed into the stack. It means that first the value of SP (Stack Pointer) is decremented by 2 then the value of flag register is pushed to the memory address of stack segment.
 - The value of starting memory address of CS (Code Segment) is pushed into the stack.
 - The value of IP (Instruction Pointer) is pushed into the stack.
 - IP is loaded from word location (Interrupt type) * 04.
 - CS is loaded from the next word location.
 - Interrupt and Trap flag are reset to 0.