
Instruction Set
4-236
STI
STI
Examples
This example of an interrupt-service routine: enables interrupts so that interrupt nesting
can occur, resets a device, disables interrupts until the interrupted procedure is resumed,
and then clears the in-service bits in the In-Service (INSERV) register by writing to the End-
Of-Interrupt (EOI) register.
Tips
Before you use STI, make sure that the stack is initialized (SP and SS).
If you disable maskable interrupts using CLI, the microcontroller does not recognize
maskable interrupt requests until the instruction that follows STI is executed.
After using CLI to disable maskable interrupts, use STI to enable them as soon as possible
to reduce the possibility of missing maskable interrupt requests.
INT clears IF to 0.
IRET restores IF to its value prior to calling the interrupt routine.
Related Instructions
If you want to
See
Disable all maskable interrupts
CLI
; the microcontroller pushes the flags onto
; the stack before executing this routine
; enable interrupt nesting during routine
ISR1
PROC
FAR
PUSHA
; save general registers
STI
; enable unmasked maskable interrupts
mRESET_DEVICE1
; perform operation (macro)
CLI
; disable maskable interrupts until IRET
; reset in-service bits by writing to EOI register
MOV
DX,INT_EOI_ADDR
; address of EOI register
MOV
AX,8000h
; nonspecific EOI
OUT
DX,AX
; write to EOI register
POPA
; restore general registers
IRET
ISR1
ENDP
; the microcontroller pops the flags from the stack
; before returning to the interrupted procedure
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...