# `nop`

[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/nop

**No operation**

Category: System

Performs no operation, and execution continues with the next instruction.

8086 and later

## Flags

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

## Forms

- `nop`
- `nop r/m` (16, 32, 64)
  - `nop r/m16`: Pentium Pro and later
  - `nop r/m32`: Pentium Pro and later
  - `nop r/m64`

## Undocumented

Intel’s manual does not list these forms, but the processor runs them.

- `nop imm, reg, r/m` (16, 32, 64)
  - `nop imm, reg16, r/m16`: Pentium Pro and later
  - `nop imm, reg32, r/m32`: Pentium Pro and later
  - `nop imm, reg64, r/m64`

## Operands

- `r/m`: A general-purpose register or memory location matching the operation’s size, for example `rax` or `qword [rbp-8]`.
- `imm`: An immediate value: a constant written in the instruction as a number, a character or a label, for example `10`, `0x1f`, `'a'` or `msg`. Open a row to see the size it has in each form, such as `imm8` or `imm32`.
- `reg`: A general-purpose register matching the operation’s size, for example `al`, `ax`, `eax` or `rax`.

## Description

The one-byte form is `90h`, which 16- and 32-bit code also gets from `xchg ax, ax` or `xchg eax, eax`. In 64-bit mode `90h` is always a true no-op, and NASM assembles `xchg eax, eax` as a real exchange that clears the upper half of `rax`, so that is not a NOP there. The longer `nop r/m` forms do nothing either; they pad code to an alignment in a single instruction.

## Example

```x86
global _start

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

        nop rax

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