Difficulty: Easy
Correct Answer: An interrupt request that can be enabled or disabled (masked) by software using an interrupt enable flag
Explanation:
Introduction / Context:
Interrupts are signals that cause a microprocessor to pause its current execution and service an event such as I O completion or a timer tick. Most processors distinguish between maskable and non maskable interrupts. This classification determines whether software can temporarily ignore certain interrupt requests. Understanding maskable interrupts is crucial for designing interrupt handling strategies in embedded systems and operating systems.
Given Data / Assumptions:
Concept / Approach:
A maskable interrupt is an interrupt whose recognition can be turned on or off by software using an interrupt enable or mask register. When the interrupt is masked (disabled), the processor ignores that particular interrupt request, even if the external hardware asserts the signal. When it is unmasked (enabled), the same signal will cause the processor to suspend its current task and execute the corresponding interrupt service routine. This ability to selectively enable or disable interrupts allows software to protect critical sections of code or manage priorities.
Step-by-Step Solution:
Step 1: Recall that many processors have an interrupt enable flag or a set of mask bits that can be set or cleared by instructions.
Step 2: When the relevant enable bit is set, the processor responds to interrupt requests on specific lines by saving context and jumping to an interrupt service routine.
Step 3: When the bit is cleared, the processor temporarily ignores those interrupt requests, effectively masking them.
Step 4: This behaviour defines a maskable interrupt: one whose recognition is under software control via masking bits.
Step 5: In contrast, a non maskable interrupt bypasses these masks and is always recognised, except under very limited conditions.
Verification / Alternative check:
Consider the Intel 8085, which provides several maskable interrupts such as RST 7.5, RST 6.5 and RST 5.5. It uses an interrupt enable flip flop and individual mask bits to control whether these interrupts are honoured. If software disables interrupts using an instruction like DI, the processor will not respond to those maskable interrupt signals until interrupts are re enabled. This real world behaviour matches the definition of a maskable interrupt given in the correct option.
Why Other Options Are Wrong:
An interrupt that is always serviced immediately and cannot be disabled is actually a non maskable interrupt, not a maskable one.
An interrupt that only occurs when a specific instruction is executed describes a software generated trap or exception pattern, not the general idea of masking by flags.
An interrupt generated by mask programmable read only memory refers to how some hardware may be configured, but does not define what maskable means in processor terminology.
Common Pitfalls:
A common misunderstanding is to think that masking an interrupt stops the external event from occurring. In reality, masking only controls whether the processor responds to the signal; the hardware device may still assert the line. Another pitfall is forgetting to re enable interrupts after a critical section, leading to a system that stops responding to events. Proper interrupt management requires careful control of mask bits and awareness of system timing.
Final Answer:
A maskable interrupt is an interrupt request that can be enabled or disabled (masked) by software using an interrupt enable flag or mask register.
Discussion & Comments