80386 Programmer's Reference Manual -- Opcode MOVSX

MOVSX -- Move with Sign-Extend

OpcodeInstructionClocks DescriptionExample
0F BE /rmovsx r/m8,r163/6 Move byte to word with sign-extendmovsx %dl,%bx
movsx (%ebx,1),%bx
movsx m8(%ebx,1),%bx
movsx m8(%ebx,%ebp,1),%bx
0F BE /rmovsx r/m8,r323/6 Move byte to dword, sign-extendmovsx %dl,%ebx
movsx (%ebx,1),%ebx
movsx m8(%ebx,1),%ebx
movsx m8(%ebx,%ebp,1),%ebx
0F BF /rmovsx r/m16,r323/6 Move word to dword, sign-extendmovsx %cx,%ebx
movsx (%ebx,1),%ebx
movsx (%ebx,2),%ebx
movsx (%ebx,%ebp,1),%ebx


DEST := SignExtend(SRC);


MOVSX reads the contents of the effective address or register as a byte or a word, sign-extends the value to the operand-size attribute of the instruction (16 or 32 bits), and stores the result in the destination register.

Flags Affected


Protected Mode Exceptions

#GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault

Real Address Mode Exceptions

Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH

Virtual 8086 Mode Exceptions

Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault

[Home Page dell'ITIS "Fermi"] [80386 Programmer's Reference Manual Index] [Previous] [Next]