x86 EFLAGS: Difference between revisions
Jump to navigation
Jump to search
→C macro constants: fix resvd flags (again xd) |
→C macro constants: fix constant vals |
||
Line 114: | Line 114: | ||
== C macro constants == | == C macro constants == | ||
<syntaxhighlight lang="c"> | |||
< | #define X86_EFLAGS_CF 0 /* Carry Flag [S] */ | ||
#define X86_EFLAGS_rsvd_2 | #define X86_EFLAGS_rsvd_2 1 /* Always clear [0] */ | ||
#define X86_EFLAGS_PF | #define X86_EFLAGS_PF 2 /* Parity Flag [S] */ | ||
#define X86_EFLAGS_rsvd_4 | #define X86_EFLAGS_rsvd_4 3 /* Always set [1] */ | ||
#define X86_EFLAGS_AF | #define X86_EFLAGS_AF 4 /* Auxiliary Carry Flag [S] */ | ||
#define X86_EFLAGS_rsvd_6 | #define X86_EFLAGS_rsvd_6 5 /* Always set [1] */ | ||
#define X86_EFLAGS_ZF | #define X86_EFLAGS_ZF 6 /* Zero Flag [S] */ | ||
#define X86_EFLAGS_SF | #define X86_EFLAGS_SF 7 /* Sign Flag [S] */ | ||
#define X86_EFLAGS_TF | #define X86_EFLAGS_TF 8 /* Trap Flag [X] */ | ||
#define X86_EFLAGS_IF | #define X86_EFLAGS_IF 9 /* Interrupt Enable Flag [X] */ | ||
#define X86_EFLAGS_DF | #define X86_EFLAGS_DF 10 /* Direction Flag [C] */ | ||
#define X86_EFLAGS_OF | #define X86_EFLAGS_OF 11 /* Overflow Flag [S] */ | ||
#define X86_EFLAGS_IOPL 13 | #define X86_EFLAGS_IOPL 12 /* I/O Privilege Level [X] */ | ||
#define X86_EFLAGS_NT 14 | #define X86_EFLAGS_IOPL_LO 12 /* I/O Privilege Level low bit. [X] */ | ||
#define X86_EFLAGS_rsvd_15 15 | #define X86_EFLAGS_IOPL_HI 13 /* I/O Privilege Level high bit. [X] */ | ||
#define X86_EFLAGS_RF 16 | #define X86_EFLAGS_NT 14 /* Nested Task [X] */ | ||
#define X86_EFLAGS_VM 17 | #define X86_EFLAGS_rsvd_15 15 /* Always clear [0] */ | ||
#define X86_EFLAGS_AC 18 | #define X86_EFLAGS_RF 16 /* Resume Flag [X] */ | ||
#define X86_EFLAGS_VIF 19 | #define X86_EFLAGS_VM 17 /* Virtual-8086 Mode [X] */ | ||
#define X86_EFLAGS_VIP 20 | #define X86_EFLAGS_AC 18 /* Alignment Check / Access Control [X] */ | ||
#define X86_EFLAGS_ID 21 | #define X86_EFLAGS_VIF 19 /* Virtual Interrupt Flag [X] */ | ||
#define X86_EFLAGS_VIP 20 /* Virtual Interrupt Pending [X] */ | |||
{{Page lang|en}} | #define X86_EFLAGS_ID 21 /* ID Flag [X] */ | ||
</syntaxhighlight>{{Page lang|en}} | |||
[[Category:Notes]] | [[Category:Notes]] |
Revision as of 17:15, 22 March 2025
EFLAGS table
Bit | Type /val.[1] |
Name | Abbreviation |
---|---|---|---|
1 | S | Carry Flag | CF
|
2 | 0 | Always clear | rsvd_2 [2]
|
3 | S | Parity Flag | PF
|
4 | 1 | Always set | rsvd_4
|
5 | S | Auxiliary Carry Flag | AF
|
6 | 1 | Always set | rsvd_6
|
7 | S | Zero Flag | ZF
|
8 | S | Sign Flag | SF
|
9 | X | Trap Flag | TF
|
10 | X | Interrupt Enable Flag | IF
|
11 | C | Direction Flag | DF
|
12 | S | Overflow Flag | OF
|
13 | X | I/O Privilege Level | IOPL
|
14 | X | Nested Task | NT
|
15 | 0 | Always clear | rsvd_15
|
16 | X | Resume Flag | RF
|
17 | X | Virtual-8086 Mode | VM
|
18 | X | Alignment Check / Access Control | AC
|
19 | X | Virtual Interrupt Flag | VIF
|
20 | X | Virtual Interrupt Pending | VIP
|
21 | X | ID Flag | ID
|
C macro constants
#define X86_EFLAGS_CF 0 /* Carry Flag [S] */
#define X86_EFLAGS_rsvd_2 1 /* Always clear [0] */
#define X86_EFLAGS_PF 2 /* Parity Flag [S] */
#define X86_EFLAGS_rsvd_4 3 /* Always set [1] */
#define X86_EFLAGS_AF 4 /* Auxiliary Carry Flag [S] */
#define X86_EFLAGS_rsvd_6 5 /* Always set [1] */
#define X86_EFLAGS_ZF 6 /* Zero Flag [S] */
#define X86_EFLAGS_SF 7 /* Sign Flag [S] */
#define X86_EFLAGS_TF 8 /* Trap Flag [X] */
#define X86_EFLAGS_IF 9 /* Interrupt Enable Flag [X] */
#define X86_EFLAGS_DF 10 /* Direction Flag [C] */
#define X86_EFLAGS_OF 11 /* Overflow Flag [S] */
#define X86_EFLAGS_IOPL 12 /* I/O Privilege Level [X] */
#define X86_EFLAGS_IOPL_LO 12 /* I/O Privilege Level low bit. [X] */
#define X86_EFLAGS_IOPL_HI 13 /* I/O Privilege Level high bit. [X] */
#define X86_EFLAGS_NT 14 /* Nested Task [X] */
#define X86_EFLAGS_rsvd_15 15 /* Always clear [0] */
#define X86_EFLAGS_RF 16 /* Resume Flag [X] */
#define X86_EFLAGS_VM 17 /* Virtual-8086 Mode [X] */
#define X86_EFLAGS_AC 18 /* Alignment Check / Access Control [X] */
#define X86_EFLAGS_VIF 19 /* Virtual Interrupt Flag [X] */
#define X86_EFLAGS_VIP 20 /* Virtual Interrupt Pending [X] */
#define X86_EFLAGS_ID 21 /* ID Flag [X] */