🎓 BookMCQ
← Back to 7. Interrupt Instructions of 8085

📝 Interrupt Instructions in 8085 Microprocessor (16 MCQs)

Instructions for Enabling and Disabling Interrupts

The 8085 provides dedicated instructions for controlling its interrupt system. EI enables maskable interrupts globally, while DI disables them. Neither instruction masks the non-maskable TRAP input. The processor also provides SIM and RIM for individual interrupt-mask control and status reading, allowing software to manage external requests during program execution.

SIM Instruction and Accumulator Bit Organization

SIM uses the accumulator to configure interrupt masks and serial output. Bit 7 supplies SOD data, bit 6 enables serial output, bit 4 resets the RST 7.5 request latch, and bit 3 enables mask loading. Bits 2, 1 and 0 specify masks for RST 7.5, RST 6.5 and RST 5.5 respectively.

RIM Instruction and Interrupt-Status Retrieval

RIM reads the SID input into accumulator bit 7, pending requests for RST 7.5, RST 6.5 and RST 5.5 into bits 6, 5 and 4, and global interrupt-enable status into bit 3. Bits 2, 1 and 0 contain the current individual mask settings.

Example of Disabling and Re-Enabling Maskable Interrupts

Executing DI disables maskable interrupt acceptance. A later EI instruction enables it again, with the enabling taking effect after the following instruction. For example, EI followed by NOP allows the NOP to execute before the maskable interrupt system becomes enabled, supporting controlled restoration of interrupt handling.

RST Instructions and Interrupt-Service Return

RST 0 through RST 7 are one-byte software restart instructions that transfer control to fixed vector addresses. They save the return address on the stack before branching. RET restores that address after a service routine. These instructions support software-generated service requests alongside EI, DI, SIM and RIM, which control interrupt management.

Misconceptions About 8085 Interrupt Instructions

'DI disables TRAP' is incorrect because TRAP is non-maskable. 'RIM changes the interrupt masks' is incorrect because it reads their current status, whereas SIM sets them. 'SIM always updates the three masks' overlooks bit 3, which must be set to enable mask loading.

Instruction Purpose and Accumulator-Bit Examination Questions

Memorize the functions of EI, DI, SIM, RIM, RST and RET. Practise interpreting accumulator bits for individual masking and pending-request status. Understand the delayed effect of EI and distinguish global enabling from individual masking. Questions may require calculating SIM control data or identifying the instruction that reads serial input status.

Interrupt Instruction and Control-Field Terms

  • EI - Enables maskable interrupts.
  • DI - Disables maskable interrupts.
  • SIM - Sets masks and serial output data.
  • RIM - Reads interrupt and serial input status.
  • MSE - Enables interrupt-mask setting.
  • RET - Returns from an interrupt service routine.
4
Easy
11
Medium
1
Hard

📝 All Interrupt Instructions in 8085 Microprocessor MCQs

Q1. At which memory address does the 8085 automatically jump when the RST 7.5 interrupt is taken?

A.003CH
B.0038H ✅
C.0030H
D.0020H
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The RST 7.5 vector is fixed by the 8085 design at address 003CH003CH. When this interrupt is accepted, the program counter is loaded with that value, causing execution to start there. Option B (0038H0038H) corresponds to RST 6.5, option C (0030H0030H) to RST 5.5, and option D (0020H0020H) is not an interrupt vector. Knowing the exact vector is essential for placing the service routine; otherwise the processor would jump to an unintended location, leading to incorrect behavior.

Q2. What does the 8085 mnemonic EI stand for?

A.Enable Interrupts ✅
B.Enter Immediate
C.Execute Interrupt
D.Enable Input
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: EI is the abbreviation for “Enable Interrupts”. When this instruction executes, the interrupt enable flip‑flop is set, allowing maskable interrupts to be recognized. The other choices are unrelated: “Enter Immediate” is not an 8085 mnemonic, “Execute Interrupt” is a description rather than the actual name, and “Enable Input” refers to a peripheral function. Enabling interrupts is the only correct interpretation of EI.

Q3. Why are maskable interrupts in 8085 considered lower priority than non‑maskable interrupts?

A.Because they can be disabled by software ✅
B.Because they have fixed vector addresses
C.Because they are serviced after every instruction
D.Because they generate a higher voltage
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Maskable interrupts can be turned off by the EI/DI instructions, so the processor can choose to ignore them temporarily, which makes them effectively lower priority than the non‑maskable TRAP interrupt that cannot be disabled. The other statements are incorrect: fixed vector addresses do not determine priority, they are not serviced after every instruction, and voltage levels are unrelated to priority determination.

Q4. How does the RST instruction differ from a CALL instruction in terms of address generation?

A.RST adds a fixed offset to the program counter
B.RST loads the PC with a predefined vector while CALL uses a 16‑bit address from the operand
C.RST pushes the return address onto the stack ✅
D.RST can be used only for subroutines longer than 256 bytes
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: RST instructions automatically load the program counter with one of the four predefined vectors (003CH003CH, 0038H0038H, 0030H0030H, or 0020H0020H), eliminating the need for an explicit address operand. CALL, in contrast, fetches a 16‑bit address from the following two bytes and pushes the return address onto the stack. Options A and D describe behaviours that are not true for RST, and option C incorrectly states that RST does not push a return address.

Q5. A system must invert a byte received from port 00H, then add 1 to obtain its 2’s complement before storing it at address 2200H. Which sequence of 8085 instructions correctly implements this operation?

A.MOV A,M; CMA; ADI 01H; STA 2200H
B.MOV A,M; ADI 01H; CMA; STA 2200H ✅
C.CMA; MOV A,M; ADI 01H; STA 2200H
D.MOV A,M; CMA; STA 2200H; ADI 01H
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The correct sequence is to move the source byte into the accumulator, complement it with CMA (producing the 1’s complement), then add 1 using ADI 01H to form the 2’s complement, and finally store the result with STA 2200H. Option B adds before complementing, which yields the wrong result; option C performs CMA before loading the accumulator, so the wrong data is complemented; option D stores before adding the final 1, leaving the value incomplete.

Q6. In a program that processes N bytes stored starting at 2101H, the programmer uses register C as a counter. Which instruction correctly decrements C and tests for zero to continue the loop?

A.DCR C; JNZ LOOP
B.DCX C; JNZ LOOP ✅
C.DCR C; JZ LOOP
D.INR C; JNZ LOOP
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: DCR C subtracts one from the counter, and JNZ LOOP jumps back if the result is not zero, which is the standard pattern for counting down N items. DCX works on register pairs, not a single register, so option B is invalid. Option C would jump only when the counter reaches zero, reversing the loop logic. INR C increments rather than decrements, making option D unsuitable for a down‑count.

Q7. If the carry flag is set after adding the low‑order byte’s 2’s complement, what instruction should be used to propagate the carry to the next higher byte?

A.ADD B ✅
B.ADC B
C.ADI 01H
D.RLC
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: ADC B adds the contents of register B together with the current carry flag, correctly propagating the carry into the next higher byte of the multi‑byte operation. ADD B ignores the carry flag, so option A would lose the overflow. ADI 01H adds a constant 1 but does not include the existing carry, and RLC rotates bits without involving the carry flag, making options C and D inappropriate for proper propagation.

Q8. During the 2’s complement routine, the programmer wants to store each result byte starting at 2201H. Which instruction pair correctly increments the destination address after each store?

A.STAX D; INX D
B.STAX D; DCR D
C.STA (D); INX D
D.MOV M, A; INX D ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: STAX D stores the accumulator at the address pointed to by the D‑E pair, and INX D then increments that pair so the next result byte will be written to the following memory location. The other options either decrement the pointer (DCR D), use an illegal addressing mode (STA (D)), or move data without storing it correctly (MOV M,A), so they would not advance the destination address as required.

Q9. Suppose the number of bytes N is 04H. After processing the least significant byte, which register holds the remaining count?

A.C ✅
B.B
C.D
D.E
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Register C was loaded with the value of N (04H) and then decremented after each byte is processed. After the first byte, C contains the remaining count of three bytes, making it the correct register. Register B is used in the program as a temporary carry flag, while D and E together point to the destination address, so they do not contain the byte count.

Q10. When the program reaches the HLT instruction, what is the state of the program counter?

A.It points to the address of the HLT instruction ✅
B.It points to the next sequential address
C.It resets to 0000H
D.It becomes undefined
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: After executing HLT, the program counter is already incremented to the next sequential address (the byte following HLT), even though the CPU then stops fetching further instructions. Therefore the PC points to the address after HLT. Option A describes the PC before execution, option C is not true for HLT, and option D is incorrect because the PC remains defined.

Q11. Explain why the 8085 uses the CMA instruction followed by ADI 01H to compute a 2’s complement rather than a single instruction.

A.Because 2’s complement is defined as 1’s complement plus one
B.Because CMA automatically sets the carry flag ✅
C.Because ADI 01H cannot operate on memory directly
D.Because the combination is faster
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The definition of a 2’s complement number is the 1’s complement of the original value plus one. CMA produces the 1’s complement, and ADI 01H adds the required one, together yielding the correct 2’s complement. CMA does not affect the carry flag, so option B is false. ADI 01H can operate on the accumulator directly, making option C inaccurate, and the two‑instruction sequence is mandated by the instruction set, not speed, so option D is misleading.

Q12. How does the use of register B as a temporary carry flag affect the flow of the 2’s complement algorithm?

A.It allows the program to decide whether to add an extra 1 to the next byte ✅
B.It stores the original data byte
C.It resets the zero flag
D.It changes the interrupt priority
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Register B is loaded with 01H when a carry occurs and with 00H when it does not. The subsequent ADD B (or ADC B) uses this value to propagate the carry into the next higher byte, ensuring correct multi‑byte 2’s complement calculation. The other options describe unrelated effects: B does not hold the original data, it does not affect the zero flag, and it has no impact on interrupt priority.

Q13. What is the effect of the JNC instruction in the loop that processes each byte?

A.It jumps if the previous addition generated a carry ✅
B.It jumps if no carry was generated
C.It clears the carry flag
D.It sets the zero flag
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: JNC stands for “Jump if No Carry”; it causes a branch when the carry flag is clear after the addition of the current byte’s complement and the carry from the previous step. This allows the program to decide whether to propagate a carry to the next byte. Option A describes JC, not JNC. Options C and D describe flag‑manipulating instructions that JNC does not perform.

Q14. A designer needs to ensure that an external device can trigger the 8085 RST 6.5 interrupt only after the microprocessor has executed at least three instructions. Which control signal should be used?

A.INTR ✅
B.TRAP
C.SID
D.RST6.5
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: INTR is the maskable interrupt request line that the CPU samples after each instruction; by keeping INTR low until three NOPs have executed, the designer guarantees that the interrupt will be recognized only after those instructions complete. TRAP is a non‑maskable interrupt that cannot be delayed, SID is not an interrupt line, and RST6.5 is the vector address, not a control signal for timing.

Q15. In an embedded system, the 8085 must service a high‑priority interrupt while still allowing a lower‑priority interrupt to be recognized after the high‑priority service routine finishes. Which instruction sequence at the end of the high‑priority routine accomplishes this?

A.EI; RET ✅
B.DI; RET
C.EI; JMP address
D.NOP; RET
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Re‑enabling interrupts with EI before executing RET restores the ability of the processor to accept pending lower‑priority maskable interrupts once the high‑priority routine returns. Using DI would keep interrupts disabled, preventing the lower‑priority request, while EI followed by a direct jump would not return to the interrupted program, and a NOP does nothing to affect interrupt handling.

Q16. Given N = 03H, initial data bytes 0xA5, 0x3C, 0xFF at addresses 2101H‑2103H, compute the resulting bytes stored at 2201H‑2203H after the provided 2’s complement program runs. Which of the following byte sequences is correct?

A.5B C4 01 ✅
B.5A C3 00
C.5C C5 02
D.5B C3 01
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Each byte is complemented (CMA) and then incremented (ADI 01H). For 0xA5, ~A5 = 0x5A, +1 = 0x5B. For 0x3C, ~3C = 0xC3, +1 = 0xC4. For 0xFF, ~FF = 0x00, +1 = 0x01. Thus the correct result sequence

🔗 Related Topics (MCQs)