STI - Set Interrupt Flag
FB STI Set interrupt flag; external, maskable interrupts enabled
at the end of the next instruction
Description
Sets the interrupt flag (IF) in the EFLAGS register. After the IF flag is set, the processor begins responding to external, maskable interrupts after the next instruction is executed. The delayed effect of this instruction is provided to allow interrupts to be enabled just before returning from a procedure (or subroutine). For instance, if an STI instruction is followed by an RET instruction, the RET instruction is allowed to execute before external interrupts are recognized 1 . This behavior allows external interrupts to be disabled at the beginning of a procedure and enabled again at the end of the procedure. If the STI instruction is followed by a CLI instruction (which clears the IF flag), the effect of the STI instruction is negated.
The IF flag and the STI and CLI instructions have no affect on the generation of exceptions and NMI interrupts.
The following decision table indicates the action of the STI instruction (bottom of the table) depending on the processor's mode of operation and the CPL and IOPL of the currently running program or procedure (top of the table).
PE = 0 1 1 1
VM = X 0 0 1
CPL X ≤ IOPL > IOPL =3
IOPL X X X =3
IF ← 1 Y Y N Y
#GP(0) N N Y N
NOTES:
X Don't care.
N Action in Column 1 not taken.
Y Action in Column 1 taken.
Operands Bytes Clocks
1 7 NP
Flags
The IF flag is set to 1.
Created with the Personal Edition of HelpNDoc: Full-featured EPub generator