User Guide

General-Purpose Programming 57
24592—Rev. 3.15—November 2009 AMD64 Technology
Compare Strings
CMPS—Compare Strings
CMPSB—Compare Strings by Byte
CMPSW—Compare Strings by Word
CMPSD—Compare Strings by Doubleword
CMPSQ—Compare Strings by Quadword
The CMPSx instructions compare the values of two implicit operands of the same size located at
seg:[rSI] and ES:[rDI]. After the copy, both the rSI and rDI registers are auto-incremented (if the DF
flag is 0) or auto-decremented (if the DF flag is 1).
Scan String
SCAS—Scan String
SCASB—Scan String as Bytes
SCASW—Scan String as Words
SCASD—Scan String as Doubleword
SCASQ—Scan String as Quadword
The SCASx instructions compare the values of a memory operands in ES:rDI to a value of the same
size in the AL/rAX register. Bits in rFLAGS are set to indicate the outcome of the comparison. After
the comparison, the rDI register is auto-incremented (if the DF flag is 0) or auto-decremented (if the
DF flag is 1).
Move String
MOVS—Move String
MOVSB—Move String Byte
MOVSW—Move String Word
MOVSD—Move String Doubleword
MOVSQ—Move String Quadword
The MOVSx instructions copy an operand from the memory location seg:[rSI] to the memory location
ES:[rDI]. After the copy, both the rSI and rDI registers are auto-incremented (if the DF flag is 0) or
auto-decremented (if the DF flag is 1).
Load String
LODS—Load String
LODSB—Load String Byte
LODSW—Load String Word
LODSD—Load String Doubleword
LODSQ—Load String Quadword