MOVSX
Move with sign extension
Copy a narrower value, extending it to the destination width.
| Form | Bits | Requires | Encoding |
|---|---|---|---|
MOVSX r32, r8 | 32 | x86-64 | 0F BE /r |
MOVSX r32, m8 | 32 | x86-64 | 0F BE /r |
MOVSX r32, r16 | 32 | x86-64 | 0F BF /r |
MOVSX r32, m16 | 32 | x86-64 | 0F BF /r |
MOVSX r64, r8 | 64 | x86-64 | REX.W + 0F BE /r |
MOVSX r64, m8 | 64 | x86-64 | REX.W + 0F BE /r |
MOVSX r64, r16 | 64 | x86-64 | REX.W + 0F BF /r |
MOVSX r64, m16 | 64 | x86-64 | REX.W + 0F BF /r |
Operation#
Pseudo-C · selected form
dst = sign_extend(src, 32)Exact upstream semantics
Standard variant
let result := Sign_Extend(src, operand_size);What to watch for
- A REX prefix prevents use of AH/BH/CH/DH as the byte source.
- A signed result extended to 32 bits is then zero-extended by the 32-bit destination write into the enclosing 64-bit register.
Architectural details#
- Flags
- RFLAGS unchanged.
- Destination
- Writes the low 32 bits and clears the corresponding 64-bit register’s upper half.
- Encoding
0F BE /r- Operands
r32write · 32 bits · signedr8read · 8 bits · signed
- Coverage
- Selected scalar forms in 64-bit execution mode. 8/16-bit arithmetic, APX and unlisted encoding alternatives are outside this selection.
Exception information & execution requirements
#UD
Imported exceptions are checks exposed by this XML form; memory, stack, instruction-fetch and called architectural helpers can introduce additional faults.
Feature availability alone does not guarantee execution: OS state and execution-level controls also apply. Use the linked architecture documentation for the full exception conditions.
Sources & provenance#
Technical fields are imported from pinned upstream files. Explanations and explorer behavior are maintained separately.
Intel · MOVSX-MOVSXD-Move-With-Sign-Extension.xml
- Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7- SHA-256
d54c8aab3a390f527d7c266238a075370ab7bf40d3e92089e4fc0d9c29a2316e- Terms
- Intel SDM terms; see License.md