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.
The Solaris mnemonics for certain instructions differ slightly from the Intel/AMD mnemonics. Alphabetization of the table below is by the Solaris mnemonic. All string operations default to long (doubleword).
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CMPS |
compare string |
cmpsq valid only under -xarch=amd64 |
|
CMPSB |
compare byte string | ||
CMPSD |
compare doubleword string | ||
CMPSW |
compare word string | ||
LODS |
load string |
lodsq valid only under -xarch=amd64 |
|
LODSB |
load byte string | ||
LODSD |
load doubleword string | ||
LODSW |
load word string | ||
MOVS |
move string |
movsq valid only under -xarch=amd64 |
|
MOVSB |
move byte string |
movsb is not movsb{wlq}. See Table 3–1 |
|
MOVSD |
move doubleword string | ||
MOVSW |
move word string |
movsw is not movsw{lq}. See Table 3–1 |
|
REP |
repeat while %ecx not zero | ||
REPNE |
repeat while not equal | ||
repnz |
REPNZ |
repeat while not zero | |
REPE |
repeat while equal | ||
repz |
REPZ |
repeat while zero | |
SCAS |
scan string |
scasq valid only under -xarch=amd64 |
|
SCASB |
scan byte string | ||
SCASD |
scan doubleword string | ||
SCASW |
scan word string | ||
STOS |
store string |
stosq valid only under -xarch=amd64 |
|
STOSB |
store byte string | ||
STOSD |
store doubleword string | ||
STOSW |
store word string |