edited by
10,352 views
23 votes
23 votes

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 of the following is the correct order in which the events above occur?

  1. QPTRS
  2. PTRSQ
  3. TRPQS
  4. QTPRS
edited by

4 Answers

Best answer
50 votes
50 votes

Answer should be A.

edited by
11 votes
11 votes
the answer should be A  not D because we should first store the process status info into the stack and then load the new value of PC into the program counter as the process status includes the PC of the process as well... if we directly overwrite the new value of PC into the PC register we will lose the old value  hence we should copy it into the stack first..
0 votes
0 votes
The sequence of execution in the case of an interrupt while executing a process L is:
(Q) The processor finishes the execution of the current instruction
(P) The processor pushes the process status of L onto the control stack
(T) The processor loads the new PC value based on the interrupt
(R) The processor executes the interrupt service routine
(S) The processor pops the process status of L from the control stack
This is the sequence because when a process is in the middle of execution if an interrupt comes then that process execution is completed then the interrupt is serviced.
Answer:

Related questions

34 votes
34 votes
5 answers
4