PhysicsTeacher.in

High School Physics

Interrupt in Microprocessor

Interrupt in the microprocessor allows peripheral devices to access the microprocessor. In this post, we will study the concepts of Interrupt in microprocessor, Interrupt processing, returning to the main program after completing ISR, Interrupt process in 8085 microprocessor, and Interrupt process in 8086 microprocessor.

Interrupt in Microprocessor | Interrupt Processing

When the microprocessor receives an interrupt signal from peripheral(s) which are requesting its services, it stops its current execution, and program control is transferred to a sub-routine ( Interrupt Service Routine). This transfer is done by generating a CALL signal. And after executing the sub-routine, again program control is transferred [by generating RET signal] to the main program.

Interrupt in Microprocessor - processing

When an interrupt line goes high, the processor completes the execution of its current instruction and saves the program counter value on the stack. It also resets Interrupt Enable flip-flop (part of microprocessor architecture) before taking up ISR (Interrupt Service Routine) so that the occurrence of further interrupts by other devices is prevented during the execution of ISR. After the execution of ISR, the control returns back to the main program where it was interrupted.

How does the microprocessor return to the main program after completing the ISR of an interrupt?

In the microprocessor, the following tasks are performed if an interrupt has been requested:

  1. The value of the 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 the flag register is pushed to the memory address of the stack pointed by the stack pointer register.
  2. Save the value of program counter (PC) contents (address of the next instruction) in the stack.
  3. Load PC with the starting address of an ISR (Interrupt Service Routine).
  4. Executes the service routine program.
  5. Finish ISR when the return instruction (last line instruction of an ISR) is executed.
  6. Note: Before going to the main program, the microprocessor must set the Interrupt Enable flip-flop so that the occurrence of further interrupts by other devices is recognized by the processor.
  7. Return to the point in the interrupted program where an execution was interrupted.

How does the microprocessor return to the main program after completing the ISR of an interrupt?

Interrupt process in 8085 microprocessor

The following flow diagram shows the processing of an interrupt by the 8085 microprocessor.

Figure: Diagram shows the interrupt process in 8085 microprocessor

Figure: Diagram shows the interrupt process in 8085 microprocessor

Interrupt process in 8086 microprocessor

The following flow diagram shows the processing of an interrupt by the 8086 microprocessor


Figure: Diagram shows the interrupt process in 8086 microprocessor

Author of this post

This post is co-authored by Professor Saraswati Saha, who is an assistant professor at RCCIIT, a renowned degree engineering college in India. Professor Saha teaches subjects related to digital electronics & microprocessors.

See also  Pin functions of 8085 microprocessor
Scroll to top
error: physicsTeacher.in