100% found this document useful (1 vote)
1K views3 pages

Sim and Rim Instructions

The SIM instruction is used to mask or unmask interrupts, send data serially through the SOD pin, and reset the RST 7.5 interrupt. The RIM instruction reads the interrupt mask and pending interrupt status of the μP. A sample program is provided to generate a 1KHz square wave on the SOD pin using the SIM instruction and a delay loop.

Uploaded by

Santosh Deshmukh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views3 pages

Sim and Rim Instructions

The SIM instruction is used to mask or unmask interrupts, send data serially through the SOD pin, and reset the RST 7.5 interrupt. The RIM instruction reads the interrupt mask and pending interrupt status of the μP. A sample program is provided to generate a 1KHz square wave on the SOD pin using the SIM instruction and a delay loop.

Uploaded by

Santosh Deshmukh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SIM: SET INTERRUPT MASK

SIM is a multipurpose instruction.


It is used for the following
● To Mask or Un-Mask the RST 7.5, RST 6.5 AND RST5.5 interrupts
● To send the data out serially (bit-by-bit) through the SOD line of the µP
● To reset RST 7.5 interrupt irrespective of whether it is masked or not.

Method of execution:
● The appropriate byte is formed and loaded into the Accumulator.
● Then the SIM instruction is executed.
● The µP reads the contents of the accumulator in the above order.

RIM: READ INTERRUPT MASK


This instruction is used for the following purpose:
● To read the interrupt mask of the µP
● To accept data serially through the SID pin.
● To see the “pending interrupts” of the µP
Pending Interrupts:
Pending Interrupts are those interrupts which are waiting to be serviced.
An interrupt becomes pending as a high priority interrupt is currently being serviced
RIM Instruction indicates the Pending Status of RST7.5, RST6.5 and RST5.5

Method of execution:
● Then the RIM instruction is executed
● The µP loads the appropriate byte into the Accumulator
● The programmer reads the contents of the accumulator.

SQUARE WAVE PROGRAM USING SIM

Write a program to generate a SQUARE-WAVE of 1Khz using SOD pin of 8085.

Soln:

BACK: MVI A, 40H ; SIM Command= 0100 0000


SIM
CALL DELAY
MVI A, C0H ; SIM Command=1100 0000
SIM
CALL DELAY
JMP BACK

For a square wave of 1 Khz, the time period is 1 msec. Hence the required delay is 0.5 msec.

Assume 8085 is working at 3MHZ

DEALY: MVI B, XXH ; 7 T-States… … … Count is calculated later


BACK: DCR B ; 4 T-State… … … Decrement count
JNZ BACK ; 10T (true)/7T(false)
RET ; 10T-States

TD = MT+ [(Count)d ⤬ NT]-3T


Here MT= Time outside the loop= 17T
NT= Time inside the loop= 14T
TD = 17T + [(Count)d ⤬ 14T ] - 3T

Required TD = 0.5 msec= 0.5⤬10-3 sec


1T = 0.333 µsec= 0.333⤬10-6sec
Substituting the above values we get:
0.5⤬10-3 sec=17⤬(0.33310-6) + [(count)d⤬14⤬(0.333⤬10-6)] -3⤬(0.333⤬10-6)]
Count = 6AH

You might also like