x86 EFLAGS: Difference between revisions

From Thought dump
Jump to navigation Jump to search
→‎EFLAGS table: fix resvd flags
C macros
Line 112: Line 112:
| <code>ID</code>
| <code>ID</code>
|}
|}
== C macro constants ==
<pre>#define X86_EFLAGS_CF 1        /* Carry Flag [S]                      */
#define X86_EFLAGS_rsvd_2 2    /* Always clear [1]                    */
#define X86_EFLAGS_PF 3        /* Parity Flag [S]                      */
#define X86_EFLAGS_rsvd_4 4    /* Always set [1]                      */
#define X86_EFLAGS_AF 5        /* Auxiliary Carry Flag [S]            */
#define X86_EFLAGS_rsvd_6 6    /* Always set [1]                      */
#define X86_EFLAGS_ZF 7        /* Zero Flag [S]                        */
#define X86_EFLAGS_SF 8        /* Sign Flag [S]                        */
#define X86_EFLAGS_TF 9        /* Trap Flag [X]                        */
#define X86_EFLAGS_IF 10        /* Interrupt Enable Flag [X]            */
#define X86_EFLAGS_DF 11        /* Direction Flag [C]                  */
#define X86_EFLAGS_OF 12        /* Overflow Flag [S]                    */
#define X86_EFLAGS_IOPL 13      /* I/O Privilege Level [X]              */
#define X86_EFLAGS_NT 14        /* Nested Task [X]                      */
#define X86_EFLAGS_rsvd_15 15  /* Always clear [1]                    */
#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]                          */</pre>


{{Page lang|en}}
{{Page lang|en}}
[[Category:Notes]]
[[Category:Notes]]

Revision as of 03:09, 20 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 1         /* Carry Flag [S]                       */
#define X86_EFLAGS_rsvd_2 2     /* Always clear [1]                     */
#define X86_EFLAGS_PF 3         /* Parity Flag [S]                      */
#define X86_EFLAGS_rsvd_4 4     /* Always set [1]                       */
#define X86_EFLAGS_AF 5         /* Auxiliary Carry Flag [S]             */
#define X86_EFLAGS_rsvd_6 6     /* Always set [1]                       */
#define X86_EFLAGS_ZF 7         /* Zero Flag [S]                        */
#define X86_EFLAGS_SF 8         /* Sign Flag [S]                        */
#define X86_EFLAGS_TF 9         /* Trap Flag [X]                        */
#define X86_EFLAGS_IF 10        /* Interrupt Enable Flag [X]            */
#define X86_EFLAGS_DF 11        /* Direction Flag [C]                   */
#define X86_EFLAGS_OF 12        /* Overflow Flag [S]                    */
#define X86_EFLAGS_IOPL 13      /* I/O Privilege Level [X]              */
#define X86_EFLAGS_NT 14        /* Nested Task [X]                      */
#define X86_EFLAGS_rsvd_15 15   /* Always clear [1]                     */
#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]                          */
  1. Indicated whether this is a status (s), control (c), or system (x) flag. For reserved flags, its value is shown.
  2. For reserved flags, name from the code below is shown.