Computer Sciences > GATE 2025 SET-1 > Interrupts
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?
A
(iii), (i), (ii)
B
(i), (iii), (ii)
C
(i), (ii), (iii)
D
(iii), (ii), (i)

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

A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ
Choose the word that is opposite in meaning to the word “coherent”.
#5 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......