3-441
INSTRUCTION SET REFERENCE
MOVSXMove with Sign-Extension
Description
This instruction copies the contents of the source operand (register or memory location) to the
destination operand (register) and sign extends the value to 16 or 32 bits. For more information,
refer to Section 6-5, Sign Extension in Chapter 6, Instruction Set Summary of the Intel Architec-
ture Software Developers Manual, Volume 1. The size of the converted value depends on the
operand-size attribute.
Operation
DEST
<
SignExtend(SRC);
Flags Affected
None.
Protected Mode Exceptions
#GP(0)
If a memory operand effective address is outside the CS, DS, ES, FS, or
GS segment limit.
If the DS, ES, FS, or GS register contains a null segment selector.
#SS(0)
If a memory operand effective address is outside the SS segment limit.
#PF(fault-code)If a page fault occurs.
#AC(0)
If alignment checking is enabled and an unaligned memory reference is
made while the current privilege level is 3.
Real-Address Mode Exceptions
#GP
If a memory operand effective address is outside the CS, DS, ES, FS, or
GS segment limit.
#SS
If a memory operand effective address is outside the SS segment limit.
Opcode
Instruction
Description
0F BE /r
MOVSX r16,r/m8
Move byte to word with sign-extension
0F BE /r
MOVSX r32,r/m8
Move byte to doubleword, sign-extension
0F BF /r
MOVSX r32,r/m16
Move word to doubleword, sign-extension