# `movzxd`

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

**Move doubleword with zero extension**

Category: Arithmetic

Copies a doubleword source into the destination, zeroing the high bits when the destination is wider.

386 and later

[Intel's reference: MOV](https://intel.github.io/SDM/instruction/MOV.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 |

## Forms

- `movzxd reg, r/m32` (16, 64)
  - `movzxd reg16, r/m32`: 8086 and later
  - `movzxd reg64, r/m32`

## Operands

- `reg`: The destination register, usually wider than the source, as in `movzxd rax, ecx`.
- `r/m32`: A 32-bit general-purpose register or doubleword in memory, for example `eax` or `dword [rsi]`.

## Description

NASM assembles `movzxd rax, ebx` as `mov eax, ebx`: every 32-bit register write already clears the high 32 bits.

NASM also accepts a 16-bit destination, such as `movzxd ax, ebx`, which retains the low 16 bits and leaves the rest of `rax` unchanged. The equal-width 32-bit alias is unavailable in 64-bit mode; use an ordinary `mov` for that copy.

## Example

```x86
global _start

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

        movzxd rax, ebx

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