x86 Assembly Language Reference Manual

Exit Print View

Updated: December 2014
 
 

3.2.8 String Instructions

The string instructions operate on strings of bytes. Operations include storing strings in memory, loading strings from memory, comparing strings, and scanning strings for substrings.


Note - The Oracle Solaris mnemonics for certain instructions differ slightly from the Intel/AMD mnemonics. Alphabetization of the table below is by the Oracle Solaris mnemonic. All string operations default to long (doubleword).
Table 3-9  String Instructions
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
cmps{q}
CMPS
compare string
cmpsq valid only under –m64
cmpsb
CMPSB
compare byte string
cmpsl
CMPSD
compare doubleword string
cmpsw
CMPSW
compare word string
lods{q}
LODS
load string
lodsq valid only under –m64
lodsb
LODSB
load byte string
lodsl
LODSD
load doubleword string
lodsw
LODSW
load word string
movs{q}
MOVS
move string
movsq valid only under –m64
movsb
MOVSB
move byte string
movsb is not movsb{wlq}. See Table 3–2
movsl, smovl
MOVSD
move doubleword string
movsw, smovw
MOVSW
move word string
movsw is not movsw{lq}. See Table 3–2
rep
REP
repeat while %ecx not zero
repnz
REPNE
repeat while not equal
repnz
REPNZ
repeat while not zero
repz
REPE
repeat while equal
repz
REPZ
repeat while zero
scas{q}
SCAS
scan string
scasq valid only under –m64
scasb
SCASB
scan byte string
scasl
SCASD
scan doubleword string
scasw
SCASW
scan word string
stos{q}
STOS
store string
stosq valid only under –m64
stosb
STOSB
store byte string
stosl
STOSD
store doubleword string
stosw
STOSW
store word string