pushf

Push flags (default size)

Pushes rflags onto the stack as an 8-byte value and decrements rsp by 8.

8086 and later

Intel's reference: PUSHF/PUSHFD/PUSHFQ

CFPFAFZFSFDFOF –––––––
  • Changes no flag
  • Reads CF PF AF ZF SF TF IF DF OF

Forms

  • pushf

In 64-bit mode, pushf / pushfq subtract 8 from rsp and store a 64-bit image; pushfw subtracts 2 and stores the low 16 bits. pushfd is unavailable in this mode. The pushed 64-bit image has RF and VM cleared; it is not an exact copy of every bit of rflags.

global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        pushf

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall