GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Order interrupt entry and return-state handling

6 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Finish the current instruction, preserve return state, load the interrupt handler PC and execute service before restoration.

1 mark · MCQ
Report issue

Ordering interrupt service entry

Input/Output, DMA & Interrupts

Question 11, GATE 2025: A non-pipelined single processor receives an asynchronous device interrupt while running a program. Order these steps: (i) save the program counter, (ii) load the ISR start address into the program counter, (iii) finish the current instruction. A iii,i,ii; B i,iii,ii; C i,ii,iii; D iii,ii,i. Options C and D continue on source page 11.
Question 11, GATE 2025: A non-pipelined single processor receives an asynchronous device interrupt while running a program. Order these steps: (i) save the program counter, (ii) load the ISR start address into the program counter, (iii) finish the current instruction. A iii,i,ii; B i,iii,ii; C i,ii,iii; D iii,ii,i. Options C and D continue on source page 11.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Approach: Preserve a consistent return point before redirecting instruction execution.
First finish the instruction already in progress: step iii. In the usual instruction-boundary interrupt model, this leaves the program’s architectural state consistent and determines the address at which it must resume. Interrupts are asynchronous arrivals, but service is begun at an instruction boundary.
Next save the program counter containing that resume address: step i. Finally load the ISR entry address into the program counter: step ii. Fetching now begins in the interrupt routine, and the saved address remains available for return.
The sequence is iii,i,ii, option A. B and C save before the current instruction has completed; D overwrites the return address with the ISR address before saving it. This ordering describes the stipulated simple processor, not an attempt to interrupt halfway through a partially completed instruction.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

Interrupt servicing order

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

2 marks · MCQ
Report issue

Interrupt-entry micro-operations

Input/Output, DMA & Interrupts

Question 28, GATE 2013: Micro-operations are MBR←PC; MAR←X; PC←Y; Memory←MBR (write at MAR). Which operation can this implement? A instruction fetch; B operand fetch; C conditional branch; D interrupt-service initiation.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

MBR receives the current PC, MAR selects location X, PC is changed to Y, and the saved PC is written at X. This saves a return address and transfers control to another routine, consistent with interrupt-service initiation, D.

Track the values rather than just the register names. The old PC is copied into MBR before PC is overwritten, so it is preserved. MAR directs the final write to X, saving that old PC in memory. Loading Y into PC redirects execution. Together these actions save a return location and jump to a service routine, consistent with D. An instruction fetch would read memory into an instruction register/buffer rather than store the old PC to memory.

Original paper, page 6 · Answer key

1 mark · MCQ
Report issue

Interrupt recognition point

Input/Output, DMA & Interrupts

Question 8, GATE 2009: When does a CPU normally begin interrupt service? A immediately when raised; B after checking at the end of fetch; C after checking when the current instruction finishes; D at fixed time intervals.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

In the conventional instruction-cycle model, an enabled pending interrupt is checked after the current instruction completes, then control transfers to its service routine. This preserves an instruction boundary rather than interrupting immediately at an arbitrary internal step. Thus C.

The usual instruction-cycle model completes an instruction before recognizing a pending interrupt and saving a consistent next-instruction state. This gives C. An asynchronous request can arrive earlier, but arrival is not the same as immediate transfer of control. Fetch completion is too early in that simple model, and periodic checking is not the general interrupt mechanism. Architecture-specific restartable instructions and precise-exception implementations are finer details outside this convention.

Original paper, page 2

1 mark · MCQ
Report issue

When an 8085 services an interrupt

Input/Output, DMA & Interrupts

Question 1.9, GATE 2000: When does the 8085 respond to an eligible TRAP request: immediately upon a high level, at the end of fetch, at instruction completion, or at unspecified regular intervals?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: The processor normally completes the current instruction before transferring to an interrupt service routine, preserving a well-defined instruction boundary.

Step 2: Thus the textbook choice is C, at the end of execution rather than merely at opcode fetch or immediately on signal assertion.

Qualification: TRAP has edge-and-level triggering requirements; an arbitrary static high level alone is not a complete description of a valid new request. The answer concerns service timing after an eligible request.

Original paper, page 1

1 mark · MCQ
Report issue

Instruction-boundary interrupt checks

Input/Output, DMA & Interrupts

Question 1.20, GATE 1998: Choose a true claim: all interrupts need enabling, loops cannot be interrupted, processor checks interrupts before a new instruction, only level-triggered interrupts exist.
Tap to enlarge
Your answer
Answer & solution

Answer: C under the ordinary instruction-boundary model (no official key was published)

An eligible interrupt is normally recognized at an architectural instruction boundary, before starting the next instruction, so C expresses the conventional model. Nonmaskable interrupts refute a blanket requirement that every interrupt first be enabled. A software loop comprises instructions and can be interrupted between them. Both edge- and level-triggered interrupt mechanisms exist. Some complex/restartable instructions have additional interrupt points, but these do not rescue the false universal claims in A, B, D.

Original paper, page 2