Similar questions 5 more →
Input/Output, DMA & Interrupts


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.