movbe

Move data after swapping bytes

Moves data between a register and memory, reversing the byte order as it is copied.

Atom, and Haswell and later

Intel's reference: MOVBE

CFPFAFZFSFDFOF –––––––
  • Changes no flag

Forms

Operands

reg
A general-purpose register matching the operation’s size, for example al, ax, eax or rax. The byte registers ah, bh, ch and dh cannot be used with a REX prefix, which is required by spl, bpl, sil, dil and r8–r15.
mem
A memory location addressed with square brackets, for example [rbx+8] or [label].
global _start

section .data
value: dq 7

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

        movbe rax, [value]

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