STI Set Interrupt Enable Flag Flags: O D I T S Z A P C - - 1 - - - - - - STIIO
Logic IF ← 1
STI sets the interrupt-enable flag (IF). After executing the instruction following STI, the CPU responds to external interrupts, but only if the next instruction allows the interrupt flag to remain enabled.
If external interrupts are disabled and you code STI,RET (such as at the end of a subroutine), the RET is allowed to execute before external interrupts are recognized. Also, if external interrupts are disabled and you code STI,CLI, then external interrupts are not recognized because the CLI instruction clears the interrupt flag during its execution.
Non-maskable interrupts are recognized no matter what the state of the IF flag.
Protected mode If the current task has insufficient privilege to alter IF, a general protection exception is generated.