testui
Test User Interrupt
TESTUI
Sets CF if UIF is 1, ZF if User Interrupt Pending.
Details
Tests the User Interrupt Flag (UIF) and User Interrupt Pending (UIP) status, setting CF if UIF is 1 and ZF if a user interrupt is pending. This instruction requires the UINTR CPU feature and operates only in user mode; it does not modify other flags. Execution without UINTR support causes a #UD exception.
Pseudocode Operation
CF ← UINTR.UIF
ZF ← UINTR.UIP
OF ← 0
SF ← 0
AF ← 0
PF ← 0
Example
TESTUI
Encoding
Binary Layout
F3
+0
0F
+1
01
+2
ED
+3
Operands
Reference (Intel® SDM)
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| F3 0F 01 ED | TESTUI | ZO | V/I | UINTR | Copies the current value of UIF into EFLAGS.CF. |
Operation
CF := UIF; ZF := AF := OF := PF := SF := 0;
Flags Affected
The ZF, OF, AF, PF, SF flags are cleared and the CF flags to the value of the user interrupt flag.
Exceptions
Protected Mode Exceptions
#UD The TESTUI instruction is not recognized in protected mode.
Real-Address Mode Exceptions
#UD The TESTUI instruction is not recognized in real-address mode.
Virtual-8086 Mode Exceptions
#UD The TESTUI instruction is not recognized in virtual-8086 mode.
Compatibility Mode Exceptions
#UD The TESTUI instruction is not recognized in compatibility mode.
64-Bit Mode Exceptions
#UD If the LOCK prefix is used.
If executed inside an enclave.
If CR4.UINTR = 0.
If CPUID.07H.00H:EDX.UINTR[5] = 0.
TESTUI—Determine User Interrupt Flag Vol. 2B 4-722