# `pushf`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/pushf

**Push flags (default size)**

Category: Stack

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

8086 and later

[Intel's reference: PUSHF/PUSHFD/PUSHFQ](https://intel.github.io/SDM/instruction/PUSHF-PUSHFD-PUSHFQ.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: CF, PF, AF, ZF, SF, TF, IF, DF, OF

## Forms

- `pushf`

## Description

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`.

## Example

```x86
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
```
