Computer organization: The section of code that executes when the processor receives an interrupt (i.e., the routine to which control is transferred) is known as what?

Difficulty: Easy

Correct Answer: Interrupt service routine (ISR)

Explanation:


Introduction / Context:
Processors temporarily suspend normal execution when an external or internal event occurs, such as I/O completion, a timer tick, or a fault. Understanding the software component that responds is basic to operating systems and embedded programming.


Given Data / Assumptions:

  • An interrupt occurs and the CPU transfers control to a predefined routine.
  • We are naming that routine, not the table of addresses or the system call mechanism.


Concept / Approach:

The routine that runs in response to an interrupt is called an Interrupt Service Routine (ISR), also known as an interrupt handler. The ISR executes, performs minimal required work, and returns via a special instruction so the interrupted program can resume.


Step-by-Step Solution:

1) Map terms: the code executed on interrupt == ISR.2) Distinguish from related components: an interrupt vector is the address entry pointing to the ISR, and SVC is a software-invoked call, not necessarily an external interrupt.3) Choose 'Interrupt service routine (ISR)'.


Verification / Alternative check:

All major architectures (x86, ARM, RISC-V) define handlers/ISRs that save context, service the event, and return with an 'iret'/'rfe' style instruction.


Why Other Options Are Wrong:

  • Interrupt vector: a pointer, not the routine itself.
  • Trap handler: handles synchronous exceptions; related but not the generic interrupt term.
  • Context switcher: part of OS scheduling, not the event-handling code.
  • Supervisor call (SVC): a software interrupt for system calls, not the general name for the routine.


Common Pitfalls:

  • Confusing the vector table entry with the routine body.
  • Equating traps/exceptions and asynchronous interrupts.


Final Answer:

Interrupt service routine (ISR).

More Questions from Computer Fundamentals

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion