STI—Set Interrupt FlagInstruction Operand EncodingDescriptionIn most cases, STI sets the interrupt flag (IF) in the EFLAGS register. This allows the processor to respond to mask-able hardware interrupts.If IF= 0, maskable hardware interrupts remain inhibited on the instruction boundary following an execution of STI. (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. No interrupts can be recognized if an execution of CLI immediately follow such an execution of STI.) The inhibition ends after delivery of another event (e.g., exception) or the execution of the next instruction.The IF flag and the STI and CLI instructions do not prohibit the generation of exceptions and nonmaskable inter-rupts (NMIs). However, NMIs (and system-management interrupts) may be inhibited on the instruction boundary following an execution of STI that begins with IF= 0.Operation is different in two modes defined as follows:•PVI mode (protected-mode virtual interrupts): CR0.PE= 1, EFLAGS.VM= 0, CPL= 3, and CR4.PVI= 1;•VME mode (virtual-8086 mode extensions): CR0.PE= 1, EFLAGS.VM= 1, and CR4.VME= 1.If IOPL< 3, EFLAGS.VIP= 1, and either VME mode or PVI mode is active, STI sets the VIF flag in the EFLAGS register, leaving IF unaffected.Table 4-24 indicates the action of the STI instruction depending on the processor operating mode, IOPL, CPL, and EFLAGS.VIP.OpcodeInstructionOp/ En64-Bit ModeCompat/Leg ModeDescriptionFBSTIZOValidValidSet interrupt flag; external, maskable interrupts enabled at the end of the next instruction.Op/EnOperand 1Operand 2Operand 3Operand 4ZONANANANATable 4-24. Decision Table for STI Results ModeIOPLEFLAGS.VIPSTI ResultReal-addressX1NOTES:1. X = This setting has no effect on instruction operation.XIF=1Protected, not PVI2≥CPLXIF = 1< CPLX#GP faultProtected, PVI33XIF = 10–20VIF=11#GP faultVirtual-8086, not VME33XIF = 10–2X#GP faultVirtual-8086, VME33XIF = 10–20VIF=11#GP fault
This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.