movsx

8086 and later

Move with Sign-Extension

movsx ax, al | movsx eax, ax | movsx rax, eax | movsx reg16, r/m8 | movsx reg32, r/m8 | movsx reg64, r/m8 | movsx reg16, r/m16 | movsx reg32, r/m16 | movsx reg64, r/m16 | movsx reg16, r/m32 | movsx reg32, r/m32 | movsx reg64, r/m32

MOVSX sign-extends its source (second) operand to the length of its destination (first) operand, and copies the result into the destination operand. MOVZX does the same, but zero-extends rather than sign-extending.

Loading...

Forms

Every form of movsx the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
movsx ax, al8086
movsx eax, ax386
movsx rax, eaxx86-64long
movsx reg16, r/m8386
movsx reg32, r/m8386
movsx reg64, r/m8x86-64long
movsx reg16, r/m16386
movsx reg32, r/m16386
movsx reg64, r/m16x86-64long
movsx reg16, r/m32x86-64long
movsx reg32, r/m32x86-64long
movsx reg64, r/m32x86-64long