Skip to content

Instantly share code, notes, and snippets.

@mepcotterell
Last active February 17, 2025 19:48
Show Gist options
  • Save mepcotterell/199b86a558b3f944589674f53ff681b0 to your computer and use it in GitHub Desktop.
Save mepcotterell/199b86a558b3f944589674f53ff681b0 to your computer and use it in GitHub Desktop.

%eflags

Flags

Flag Description
CF Carry Flag
PF Parity Flag
AF Adjust Flag
ZF Zero Flag
SF Sign Flag
TF Trap Flag
IF Interruption Flag
DF Direction Flag
OF Overflow Flag
IOPL I/O Privilege Level
NT Nested Task Flag
RF Resume Flag
VM Virtual-8086 Mode
AC Alignment Check
VIF Virtual Interrupt Flag
VIP Virtual Interrupt Pending Flag
ID Identification Flag

Register Layout

 3         2         1
10987654321098765432109876543210
00000000001111110111111111010111
..........IVVAVR.N-IODITSZ.A.P.C
          DIICMF T OFFFFFF F F F
           PF      P
                   L

Example

Suppose %eflags = 0x206:

0x    2    0    6
0b 0010 0000 0110
     I         P
     F         F

GDB

(gdb) p/x $eflags
$1 = 0x206
(gdb) p/t $eflags
$2 = 1000000110
(gdb) p $eflags
$1 = [ PF IF ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment