All Exams Test series for 1 year @ ₹349 only
Question

Arrange the following events in correct order when an interrupt occurs during instruction execution.

 A. Save program counter (PC) and status register. 

B. Fetch interrupt vector from memory. 

C. Execute the interrupted instruction completely. 

D. Transfer control to interrupt service routine (ISR)

 E. Restore PC and register after ISR

Choose the correct answer from the options given below : 


 

The correct answer is
C, A, B, D, E

Interrupt Handling Sequence Explained

When an interrupt occurs during instruction execution, the processor follows a specific sequence to handle it, ensuring the system can resume correctly later. Based on the provided correct order, the events are:

  1. Complete Instruction Execution:

    The instruction that was currently being executed when the interrupt signal arrived is first completed. This ensures atomicity for the current operation.

  2. Save Processor State:

    The current state of the processor needs to be saved so that execution can be resumed later from exactly where it left off. This includes:

    • Saving the Program Counter (PC), which holds the address of the next instruction to be executed.
    • Saving the Status Register (or flags register), which contains information about the results of the latest operations and the current processor mode.
  3. Fetch Interrupt Vector:

    The processor determines which specific interrupt has occurred. It then fetches an interrupt vector from memory. This vector typically contains the starting address of the Interrupt Service Routine (ISR) designed to handle that particular interrupt.

  4. Transfer Control to ISR:

    Once the ISR's address is known, the processor transfers control to it. This means the PC is loaded with the ISR's starting address, and the ISR begins execution.

  5. Restore State After ISR:

    After the ISR has finished its tasks, the processor restores the previously saved state. This involves reloading the PC and the status register from the saved values. This allows the interrupted program to resume execution seamlessly from the point it was interrupted.

Therefore, the correct order is C, A, B, D, E.

Was this answer helpful?

Important Questions from Program Interrupt

  1. The register in the 8085A that is used to keep track of the memory address of the next op-code to be run in the program is the-

  2. Match List-I with List-II

    List I

    List II

    a.

    Micro operation

    i.

    Specify micro operations

    b.

    Micro programmed control unit

    ii.

    Improve CPU utilization

    c.

    Interrupts

    iii.

    Control Memory

    d.

    Micro instruction

    iv.

    Elementary operation performed on data stored in registers

    Choose the correct option from those given below:

  3. Disabling an interrupt is known as ______.

  4. The clock tick interrupts, which wakes up the processor from a halt state and allows the scheduler to pick other work to perform, is an example of _______.

  5. Which is not true about an interrupt

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App