Instruction Set
4-39
CMPS
CMPS
Tips
Before using CMPS, always set up CX with the length of the string, and use CLD (forward)
or STD (backward) to establish the direction for string processing.
To determine whether one string is the same as another, use the REPE (or REPZ) prefix
to execute CMPS repeatedly. If all the corresponding components match, ZF is set to 1.
To determine whether one string is different from another, use the REPNE (or REPNZ)
prefix to execute CMPS repeatedly. If no corresponding components match, ZF is cleared
to 0.
The string instructions always advance SI and/or DI, regardless of the use of the REP prefix.
Be sure to set or clear DF before any string instruction.
Related Instructions
If you want to
See
Process string components from lower to higher addresses
CLD
Repeat one string comparison instruction while the components are the same
REPE
Repeat one string comparison instruction while the components are not the same REPNE
Compare a component in a string to a register
SCAS
Process string components from higher to lower addresses
STD
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...