Past exam question: 2081 Chaitra (Regular), Q8(b)
Open in the Padhaiko appQuestion
Explain about the interrupt processing in 8085.
Solution
Step-by-Step Interrupt Processing Sequence in 8085:
- 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
SIMfor RST 7.5/6.5/5.5) and the global Interrupt Enable flip-flop (INTE) must be set (EIinstruction), with the exception of TRAP which is non-maskable.
- The 8085 samples its interrupt lines (
- Completing Current Instruction:
- The microprocessor completes execution of the currently running instruction before responding to the interrupt request.
- Disabling Further Interrupts:
- The processor internally resets the INTE flip-flop, disabling further maskable interrupts to prevent nested interruptions during context saving.
- Issuing Interrupt Acknowledge:
- For
INTR, the CPU enters an Interrupt Acknowledge machine cycle and asserts active-lowINTA_bar. - The external interrupting device places an opcode on the data bus (such as
RST nor a 3-byteCALL addr). - For vectored interrupts (TRAP, RST 7.5/6.5/5.5), acknowledge is handled internally without asserting
INTA_bar.
- For
- 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).
- High byte of PC is stored at
- The current content of the 16-bit Program Counter (return address of the next sequential instruction) is pushed onto the stack:
- Branching to ISR Vector Address:
- The PC is loaded with the designated vector address:
TRAP->0024HRST 7.5->003CHRST 6.5->0034HRST 5.5->002CHINTR-> Vector supplied by external instruction (e.g.RST n->8 * n).
- The processor begins fetching and executing the ISR instructions.
- The PC is loaded with the designated vector address:
- 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
RETinstruction, which pops the 16-bit return address from the stack into the PC (SP = SP + 2), resuming the main program seamlessly.
- Near the end of the ISR, an
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.