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

Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously. The processor needs to execute the interrupt service routine (ISR) to serve this interrupt. The following steps (not necessarily in order) are taken by the processor when the interrupt arrives:

(i) The processor saves the content of the program counter.
(ii) The program counter is loaded with the start address of the ISR.
(iii) The processor finishes the present instruction.

Which ONE of the following is the CORRECT sequence of steps?

The correct answer is
(iii), (i), (ii)

Interrupt Sequence: Understanding Processor Steps

This question asks about the correct order of operations a processor performs when handling an interrupt signal from an external device on a system without pipelining.

Interrupt Handling Process Explained

When an asynchronous interrupt occurs, the processor needs to pause its current task, handle the interrupt via the Interrupt Service Routine (ISR), and then potentially resume the original task.

Here's a breakdown of the steps involved:

  • (iii) The processor finishes the present instruction.

    On a non-pipelined system, the processor generally completes the instruction it is currently executing before responding to an interrupt. This ensures that the program's state is consistent and prevents data corruption. It allows the system to cleanly switch contexts.

  • (i) The processor saves the content of the program counter.

    After completing the current instruction, the processor needs to remember where it left off in the main program. The Program Counter (PC) holds the address of the next instruction to be executed. Saving the current value of the PC is crucial so that the processor can return to this exact point after the ISR has finished.

  • (ii) The program counter is loaded with the start address of the ISR.

    Once the return address (current PC value) is safely stored (often pushed onto a stack), the processor needs to start executing the code designed to handle the interrupt. This is the ISR. To do this, the PC is updated to point to the beginning of the ISR code.

Therefore, the logical sequence for the processor to handle the interrupt is to first finish the ongoing instruction, then save the program counter's current value, and finally, load the program counter with the starting address of the Interrupt Service Routine.

Correct Sequence Identification

Based on the explanation above, the correct sequence is:

  1. Finish the present instruction (iii)
  2. Save the content of the program counter (i)
  3. Load the program counter with the start address of the ISR (ii)

This corresponds to the sequence (iii), (i), (ii).

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