(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?
Correct : a
Explanation:
1. Step 1 — Finish Present Instruction (iii): An asynchronous interrupt can arrive at any arbitrary point during an instruction cycle. To ensure system stability and prevent corruption of program state, the processor will always complete the execution of the currently running instruction before responding to or servicing the interrupt.
2. Step 2 — Save Program Counter (i): Once the current instruction finishes, the processor prepares to context-switch to the ISR. Before jumping away, it must save the current content of the Program Counter (PC)—which points to the next instruction of the interrupted program—onto the stack. This allows the processor to seamlessly resume the original program later.
3. Step 3 — Load ISR Address (ii): After safely storing the return address, the Program Counter is updated and loaded with the starting address of the Interrupt Service Routine (ISR) so that the processor can begin executing the interrupt code on the next clock cycle.
4. Conclusion: Therefore, the exact order of execution is (iii) → (i) → (ii).
Similar Questions
Total Unique Visitors