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.
movsx
8086 and laterMove 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/m32Loading...
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.
| Form | Since | Notes |
|---|---|---|
| movsx ax, al | 8086 | |
| movsx eax, ax | 386 | |
| movsx rax, eax | x86-64 | long |
| movsx reg16, r/m8 | 386 | |
| movsx reg32, r/m8 | 386 | |
| movsx reg64, r/m8 | x86-64 | long |
| movsx reg16, r/m16 | 386 | |
| movsx reg32, r/m16 | 386 | |
| movsx reg64, r/m16 | x86-64 | long |
| movsx reg16, r/m32 | x86-64 | long |
| movsx reg32, r/m32 | x86-64 | long |
| movsx reg64, r/m32 | x86-64 | long |