1/96 Page 1 of 2
UTMC APPLICATION NOTE
_______________________________________________________________
UT69R000 Interrupt Architecture
The following outlines an instruction sequence that protects un-interruptible code segments from
external interrupts. Figure 1 depicts a main program that accesses two service routines and numer-
ous interrupt service routines. During execution of the main program and service routine # 2 all
interrupts are un-masked and enabled. Execution of service routine #1 requires masking and dis-
abling of external interrupts to prevent interruption.
Figure 1. Program Code Block Diagram
The UT69R000 requires execution of following sequences of instructions prior to calling a rou-
tine that requires protection from interrupts.
MOV RD, 0000
OTR RD, MK ; clear mask register
NOP
NOP
CALL RD, SRV_RTNE2 ; branch to protected service routine
Immediately following the call instruction (i.e., branch to protected service routine), execute
OTR R0, DSBL instruction to disable interrupts. The combination of masking and disabling pre-
vents any latent interrupt vectors from within the protected service routine. After execution of the
protected service routine, restore the mask register (OTR RD,MK), pop return value in RD (POP
Main
Body of
Program
Service
Routine #1
Service
Routine #2
Interrupt
Service
Routine(s)
1/96 Page 2 of 2
RD, RS), enable interrupts (OTR RD, ENBL), and execute a branch back to main program (CALL
RD, RS).
MOV RD, XXXX16
OTR RD, MK ; re-store mask register
POP RD, RS; establish return value
OTR RD, ENBL ; enable interrupts
CALL RD, MAIN; branch to protected service routine