Question

The following are some events that occur after a device controller issues an interrupt while process L is under execution.

(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.

Which one of the following is the correct order in which the events above occur?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2018 answer key

Solution

Trace the sequential hardware and operating system actions taken upon receiving an interrupt signal.

When an interrupt occurs during instruction execution:

  1. (Q) The processor completes execution of the currently executing instruction.
  2. (P) The processor saves the state/status of process L (such as PC and PSW) by pushing it onto the control stack.
  3. (T) The processor loads the program counter with the entry address of the interrupt handler from the interrupt vector table.
  4. (R) The processor executes the interrupt service routine (ISR).
  5. (S) After servicing the interrupt, the processor restores the state of process L by popping it from the control stack.

This corresponds to the sequence Q →\to P →\to T →\to R →\to S (QPTRS), matching option A.

Final answer

A

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2018 Computer Science and Information Technology (CS)
Question
19 of 65, printed as CS Q.9
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.