Instruction Set
4-32
CLI
CLI
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
When the Interrupt-Enable Flag (IF) is cleared to 0 so that all maskable interrupts are
disabled, you can still use INT to generate an interrupt, even if it is masked by its interrupt
control register.
Software interrupts and traps, and nonmaskable interrupts are not affected by the IF flag.
The IRET instruction restores the value of the Processor Status Flags register from the
value pushed onto the stack when the interrupt was taken. Modifying the Processor Status
Flags register via the STI, CLI or other instruction will not affect the flags after the IRET.
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.
Related Instructions
If you want to
See
Enable maskable interrupts that are not masked by their interrupt control registers STI
; 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
; non-specific 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
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...