PadhaikoAll subjects

Past exam question: 2081 Chaitra (Regular), Q8(b)

Microprocessors · 4 marks

Open in the Padhaiko app

Topic: Interrupts, Polling, Types & 8085 Interrupt Processing

Question

Explain about the interrupt processing in 8085.

Solution

Step-by-Step Interrupt Processing Sequence in 8085:

  1. Sampling the Interrupt Lines:
    • The 8085 samples its interrupt lines (TRAP, RST 7.5, RST 6.5, RST 5.5, INTR) during the penultimate clock cycle (T-state) of every instruction.
    • For an interrupt to be recognized, it must be unmasked (via SIM for RST 7.5/6.5/5.5) and the global Interrupt Enable flip-flop (INTE) must be set (EI instruction), with the exception of TRAP which is non-maskable.
  2. Completing Current Instruction:
    • The microprocessor completes execution of the currently running instruction before responding to the interrupt request.
  3. Disabling Further Interrupts:
    • The processor internally resets the INTE flip-flop, disabling further maskable interrupts to prevent nested interruptions during context saving.
  4. Issuing Interrupt Acknowledge:
    • For INTR, the CPU enters an Interrupt Acknowledge machine cycle and asserts active-low INTA_bar.
    • The external interrupting device places an opcode on the data bus (such as RST n or a 3-byte CALL addr).
    • For vectored interrupts (TRAP, RST 7.5/6.5/5.5), acknowledge is handled internally without asserting INTA_bar.
  5. Saving Return Address on Stack:
    • The current content of the 16-bit Program Counter (return address of the next sequential instruction) is pushed onto the stack:
      • High byte of PC is stored at [SP - 1].
      • Low byte of PC is stored at [SP - 2].
      • Stack Pointer is decremented by 2 (SP = SP - 2).
  6. Branching to ISR Vector Address:
    • The PC is loaded with the designated vector address:
      • TRAP -> 0024H
      • RST 7.5 -> 003CH
      • RST 6.5 -> 0034H
      • RST 5.5 -> 002CH
      • INTR -> Vector supplied by external instruction (e.g. RST n -> 8 * n).
    • The processor begins fetching and executing the ISR instructions.
  7. Re-enabling Interrupts & Returning:
    • Near the end of the ISR, an EI (Enable Interrupts) instruction is executed to re-arm the interrupt mechanism.
    • The ISR terminates with a RET instruction, which pops the 16-bit return address from the stack into the PC (SP = SP + 2), resuming the main program seamlessly.
Answer:

Interrupt processing in 8085 follows: sampling lines in the next-to-last T-state, completing current instruction, resetting INTE flip-flop, pushing PC onto stack (SP-2), loading vector address into PC to execute ISR, executing EI, and returning via RET to pop PC and resume execution.

All past exam questions for Microprocessors