# `movzxb`

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

**Move byte with zero extension**

Category: Arithmetic

Zero-extends the byte source to the width of the destination register, filling the high bits with zero.

386 and later

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

- `movzxb reg, r/m8` (16, 32, 64)
  - `movzxb reg16, r/m8`
  - `movzxb reg32, r/m8`
  - `movzxb reg64, r/m8`

## Operands

- `reg`: The destination register, usually wider than the source, as in `movzxb eax, bl`.
- `r/m8`: An 8-bit general-purpose register or byte in memory, for example `al` or `byte [rsi]`. The high-byte registers `ah`, `bh`, `ch` and `dh` cannot be used in an instruction that also uses a 64-bit operand, `spl`, `bpl`, `sil`, `dil`, or `r8` to `r15` at any size.

## Description

It reads an unsigned byte and fills the added bits of a 16-, 32- or 64-bit destination with zeros. For example, `movzxb rax, [rdi]` reads one byte and produces a value from 0 to 255.

## Example

```x86
global _start

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

        movzxb rax, bl

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