GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 9

Interrupt servicing order

Computer Organization & Architecture · Input/Output, DMA & Interrupts · Full GATE CSE 2018 paper

GATE 2018, Q9 1 mark · MCQ
Report issue

Input/Output, DMA & Interrupts

Question 9, GATE 2018: After an interrupt during process L: P saves L status on control stack; Q finishes current instruction; R executes ISR; S restores L status; T loads ISR PC. Choose A QPTRS; B PTRSQ; C TRPQS; D QTPRS.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Method

At an instruction boundary the processor has a consistent state to save. Save that state before replacing the program counter, otherwise the return address and other status could be lost. Loading the interrupt-vector target transfers control to the handler; restoring saved state is meaningful only after the handler finishes. The model describes an ordinary precise interrupt, not an exception that aborts and restarts the current instruction.

Solution

Complete the current instruction(Q), save the interrupted process state(P), load the ISR entry PC(T), run the ISR(R), and restore the saved state(S). The order is QPTRS, A.

Original paper, page 6 · Answer key