- 2075 Baisakh · 4 marks
RIM instruction in 8085
Short answer
RIM (opcode 20H) loads accumulator with interrupt mask status, pending interrupts (I7.5–I5.5), IE flag, and SID input. Used to read serial data and poll mask/pending conditions without affecting flags.
Describe the operation of interrupt instruction RIM in 8085 microprocessor.
RIM (Read Interrupt Mask) is a 1-byte instruction (opcode 20H, 4 T-states). It loads the accumulator with the status of the interrupt masks, the pending interrupts, the interrupt enable flip-flop and the serial input data. It affects no flags.
Accumulator format after RIM
| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
|---|---|---|---|---|---|---|---|
| SID | I7.5 | I6.5 | I5.5 | IE | M7.5 | M6.5 | M5.5 |
- SID (D7): the bit present on the serial input pin at that moment.
- I7.5, I6.5, I5.5 (D6–D4): 1 means an interrupt request is pending at that line.
- IE (D3): 1 means maskable interrupts are enabled (EI executed).
- M7.5, M6.5, M5.5 (D2–D0): 1 means that interrupt is masked (disabled).
Uses
- To read serial input data (SID) from a device.
- To check the present mask condition before changing it with SIM, so other mask bits are not disturbed.
- To read which RST interrupts are pending. This allows polling of RST 5.5/6.5/7.5 inputs when interrupts are disabled.
Example
RIM ; A <- status
ANI 08H ; test IE bit (D3)
JZ NOINT ; if 0, interrupts are disabled
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Interrupt pins of 8085 · Microprocessor, chapter 5
- Interrupt vs polling; interrupts in 8085 · Microprocessor, chapter 5
- EI, DI, SIM, RIM and ISR address · Microprocessor, chapter 5
- RTL for LXI instruction · Microprocessor, chapter 1 · asked 3×
- Instruction and data format, addressing modes · Microprocessor, chapter 2 · asked 2×
- Interrupt processing in 8086 · Microprocessor, chapter 5 · asked 3×
- Instruction cycle state diagram with interrupt · Computer Organization and Architecture, chapter 1 · asked 6×
- Datapath operation and instruction cycles · Embedded System, chapter 2
- Interrupt-driven I/O with vectored interrupt · Embedded System, chapter 5 · asked 3×
- LD instruction under addressing modes · Computer Organization and Architecture, chapter 2