Instructions
x86-64MOV (x86/x64)
The fundamental data-transfer instruction: copies a value between registers, memory and immediates without affecting flags.
MOV copies the source operand to the destination operand. It is the most
common instruction in x86/x64 code and — importantly — does not modify the
EFLAGS register.
Forms
| Syntax (Intel) | Meaning |
|---|---|
mov eax, ebx | register ← register |
mov eax, 0x10 | register ← immediate |
mov eax, [rbx] | register ← memory |
mov [rbx], eax | memory ← register |
mov rax, [rbx+rcx*4] | register ← scaled-index memory |
Notes for reverse engineers
mov eax, eaxzero-extends intoraxin 64-bit mode — a common idiom.movcannot copy memory-to-memory directly; compilers stage through a register.xor eax, eaxis preferred overmov eax, 0to zero a register (shorter, breaks dependency), so don't expect a literalmovfor every zeroing.
See also: Calling Conventions.
Try it — Virtual CPU
open full playground →- 1 mov eax, 5
- 2 mov ebx, eax
- 3 mov ecx, 0x10
- 4 mov DWORD PTR [rbp-4], ecx
- 5 mov edx, DWORD PTR [rbp-4]
- 6
step 0
▸ Loading emulator…