SIM and RIM instructions in 8085

Microprocessor8085

In 8085 Instruction set, SIM (Set Interrupt Mask) and RIM (Read Interrupt Mask) instructions can perform mask and unmask RST7.5, RST6.5, and RST5.5 interrupt pins and can also read their status. 

In 8085 Instruction set, SIM stands for “Set Interrupt Mask”. It is 1-Byte instruction and it is a multi-purpose instruction. The main uses of SIM instruction are –

  • Masking/unmasking of RST7.5, RST6.5, and RST5.5

  • Reset to 0 RST7.5 flip-flop

  • Perform serial output of data


Mnemonics, Operand
Opcode(in HEX)
Bytes
SIM
30
1

When SIM instruction is executed then the content of the Accumulator decides the action to be taken. So before executing the SIM instruction, it is mandatory to initialize Accumulator with the required value. The meaning and purpose of the various bits of the accumulator when SIM is executed has been depicted below – 


Note that except bit 5, which is a don't care bit, the other bits of the Accumulator decide the effect of executing the SIM instruction. Masking of interrupts: Only the LS 4 bits of the accumulator are used for masking or unmasking of interrupts.

In 8085 Instruction set, RIM stands for “Read Interrupt Mask”. It is a 1-Byte multi-purpose instruction. It is used for the following purposes.

  • To check whether RST7.5, RST6.5, and RST5.5 are masked or not;

  • To check whether interrupts are enabled or not;

  • To check whether RST7.5, RST6.5, or RST5.5 interrupts are pending or not;

  • To perform serial input of data.


Mnemonics, Operand
Opcode(in HEX)
Bytes
RIM
20
1

To get the status information about the interrupt system, RIM instruction provides status information about interrupt system and this instruction can be used for serial input of data. Through this RIM instruction, 8085 can know which interrupt is masked or unmasked, etc. The contents of the Accumulator after the execution of the RIM instruction provide this information.

Thus, it is essential to look into the Accumulator contents after the RIM instruction is executed. The meaning of the various bits of the Accumulator after RIM is executed is shown in the following figure –


Mask status of interrupts: The LS 3 bits of the accumulator are used to provide mask status of interrupts. Note that they are not used for masking or unmasking. Masking or unmasking has to be done using the SIM instruction.

raja
Updated on 27-Jun-2020 12:15:52

Advertisements