š Interrupt Control of 8085 Microprocessor (8 MCQs)
Interrupt System and Processor Response Mechanism
The 8085 interrupt control system allows external or internal program requests to redirect normal instruction execution to a service routine. It provides five hardware interrupt inputs: TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR. These inputs differ in priority, masking and triggering characteristics, allowing important events to receive processor attention without continuous software polling.
Priority and Triggering Characteristics of Hardware Interrupts
TRAP has the highest priority and is non-maskable, responding to both an edge and a maintained high level. RST 7.5 is maskable and positive-edge triggered with latching. RST 6.5 and RST 5.5 are maskable and level-sensitive. INTR is maskable, level-sensitive and has the lowest priority.
Interrupt Vectors and Masking Control
The vectored interrupts use fixed locations: TRAP at 0024H, RST 7.5 at 003CH, RST 6.5 at 0034H and RST 5.5 at 002CH. INTR does not have a fixed vector; the external device supplies an instruction during interrupt acknowledgement. EI enables maskable interrupts, DI disables them, and SIM and RIM support individual masking and status operations.
Sequence of Interrupt Recognition and Servicing
The processor normally completes its current instruction before accepting an eligible interrupt. It saves the return address on the stack, disables further maskable interrupt recognition as appropriate and transfers control to the interrupt service routine. The routine handles the event and uses RET to resume the interrupted program from its saved address.
Interrupt Control in Real-Time Input and Event Handling
Interrupts allow the processor to respond to external events such as device requests without repeatedly checking their status. Higher-priority requests receive attention before lower-priority maskable requests. TRAP supports critical events, while RST inputs provide convenient vectored service locations. INTR supports devices requiring an externally supplied instruction to determine the service address.
Misconceptions About Interrupt Priority and Triggering
'INTR has the highest priority' is incorrect because it has the lowest priority. 'All RST inputs are edge-triggered' overlooks the level-sensitive behavior of RST 6.5 and RST 5.5. 'DI disables TRAP' is incorrect because TRAP is non-maskable and cannot be disabled through the normal interrupt-enable instruction.
Interrupt Priority, Vector and Masking Examination Questions
Memorize the priority order TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR, together with the four fixed vector addresses. Distinguish edge-triggered and level-sensitive inputs, identify maskable requests and explain EI, DI, SIM and RIM. Practise tracing interrupt acknowledgement, stack operations and RET.
Interrupt Input and Servicing Terminology
- TRAP - Highest-priority non-maskable interrupt.
- RST 7.5 - Maskable, positive-edge-triggered interrupt.
- RST 6.5 - Maskable, level-sensitive interrupt.
- RST 5.5 - Lower-priority level-sensitive interrupt.
- INTR - Maskable, non-vectored interrupt.
- ISR - Interrupt service routine.
š All Interrupt Control of 8085 Microprocessor MCQs
Q1. What does the Interrupt Enable (IE) flag control in a microprocessor?
š Explanation: The IE flag, when set to 1, tells the processor that it may accept maskable interrupt requests. OptionāÆB matches this definition, so it is correct. OptionāÆA describes priority logic, which is handled by a separate priority encoder, not the IE flag. OptionāÆC confuses the flag with the program counter or stack pointer that hold the ISR address. OptionāÆD is unrelated because the program counter is automatically saved and restored by the interrupt mechanism. Understanding the IE flag helps designers decide when the system can safely respond to external events.
Q2. Why does a microprocessor use a priority encoder to rank multiple interrupt sources?
š Explanation: A priority encoder examines all pending interrupt lines and generates a code for the highestāpriority request, guaranteeing that the most critical event is handled before less important ones. This matches optionāÆC, making it correct. OptionāÆA is wrong because the encoderās purpose is not power reduction. OptionāÆB describes the outcome but not the mechanism; the encoder itself does not ensure serviceāit merely selects. OptionāÆD is unrelated to interrupt ranking. Knowing this helps engineers design predictable realātime responses.
Q3. In a system with two external interrupts INT0 (high priority) and INT1 (low priority), what occurs if both signals become active at the same instant?
š Explanation: When two interrupt lines are asserted together, the priority logic selects the higherāpriority lineāINT0 in this caseāand the CPU begins executing its ISR. Only after that ISR completes (or is explicitly interrupted) will the lowerāpriority INT1 be considered. Therefore optionāÆA is correct. OptionāÆB is impossible because a singleācore CPU cannot handle two ISRs at once. OptionāÆC reverses the priority rule. OptionāÆD is false because the processor does not discard pending interrupts; it queues the lowerāpriority request. This scenario mirrors realāworld designs where critical safety signals must preāempt less urgent ones.
Q4. How does the interrupt vector table in a SAPāIIIālike processor determine where an interrupt service routine (ISR) begins execution?
š Explanation: The vector table holds predefined addressesāoften in low memoryāso that when an interrupt is recognized the CPU fetches the corresponding address and branches directly to the ISR. This fixedāaddress approach is described in optionāÆD and is correct. OptionāÆA incorrectly claims the table stores a single fixed address for all interrupts, ignoring the need for separate vectors. OptionāÆB confuses the vector table with a subāroutine library. OptionāÆC suggests a dynamic calculation, which is not how hardware vectors operate. Engineers rely on this mechanism to achieve deterministic response times in embedded systems.
Q5. A program disables interrupts, runs a critical section, then reāenables them. What risk remains if an interrupt occurs while interrupts are disabled?
š Explanation: While interrupts are disabled, any incoming request is typically latched and held pending. When reāenabled, the CPU resumes normal operation and may immediately service the pending interrupt. If the critical section was not designed to be reāentrant, the ISR could interfere with shared resources, producing the inconsistency described in optionāÆB, which is the correct answer. OptionāÆA is false because most designs preserve the request. OptionāÆC misstates behavior; the CPU does not restart user code. OptionāÆD is unrelated to the interrupt enable flag. Understanding this helps developers protect shared data with proper synchronization techniques.
Q6. If an interrupt service routine (ISR) forgets to clear its interrupt flag before returning, what is the most likely outcome?
š Explanation: Most microcontrollers require the ISR to clear the source flag to acknowledge the interrupt. If the flag remains set, the interrupt controller will consider the request still pending and may either repeatedly invoke the ISR or, depending on the design, block further interrupts of that type. OptionāÆB captures the typical blocking behavior, making it correct. OptionāÆA describes a storm, which can happen on some architectures but is less common when the flag is not cleared. OptionāÆC and D are unrelated to flag handling. This knowledge is vital for reliable firmware where missed acknowledgments can stall critical functionality.
Q7. How does a CPU differentiate between maskable and nonāmaskable interrupts?
š Explanation: Nonāmaskable interrupts (NMIs) are designed to be recognized regardless of the state of the interrupt enable flag, ensuring that critical events cannot be ignored. Maskable interrupts, however, are subject to the IE flag and can be disabled. This distinction is correctly described in optionāÆA. OptionāÆB reverses the relationship. OptionāÆC suggests a software distinction that does not exist at the hardware level. OptionāÆD mixes source type with maskability, which is inaccurate. Engineers use NMIs for emergency conditions like powerāfail detection.
Q8. During a system startup, the program counter (PC) is loaded with the address of the interrupt vector table entry for the reset interrupt. Which of the following best describes this process?
š Explanation: When a reset occurs, the hardware automatically places the PC at a predefined locationācommonly addressāÆ0x0000āwhere the reset vector points to the initialization routine. This behavior matches optionāÆD, making it correct. OptionāÆA incorrectly states that the PC is set to the vector itself rather than the start of the vector table. OptionāÆB suggests a dataādriven jump, which is not part of the reset sequence. OptionāÆC describes a search algorithm that does not occur. Knowing the reset vector mechanism helps designers ensure that their firmware starts in a known state.