OA. free
Free
MathWorks Embedded Systems Embedded Systems & Hardware Medium

Question 5: Interrupt ExecutAn interrupt breaks the execution of instructions & diverts its...

MathWorks technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Question 5: Interrupt ExecutAn interrupt breaks the execution of instructions & diverts its execution to:

Choose one option.
Show answer & explanation
Answer: A. Interrupt service routine

When an interrupt occurs, the CPU suspends normal program execution and transfers control to an Interrupt Service Routine (ISR), which handles the interrupt request. The ISR is a specialized code block designed to process the specific interrupt, after which execution typically returns to the interrupted program. Options B, C, and D refer to CPU components or registers but do not represent the destination of execution flow during an interrupt.

Step-by-step Derivation:
Interrupt handling flow: 1) CPU executing normal instructions → 2) Interrupt signal received → 3) Current program counter saved → 4) Control transferred to ISR (interrupt handler code in memory) → 5) ISR executes → 6) Return to original program. The ISR is the only logical destination for diverted execution; it is a predefined function/routine that handles the interrupt request.