They are used to evaluate operators, and they have an effect on the content of the flags.
CMP
CMPS (CMPSB) (CMPSW)
CMP INSTRUCTION
Idea: To measure up to the operators.
Syntax:
CMP destiny, source
This instruction subtracts the source operator from the destiny operator but with no this one storing the outcome of the operation, and it only concerns the state of the flags.
CMPS (CMPSB) (CMPSW) INSTRUCTION
Idea: To compare sequences of a byte or a word.
Syntax:
CMP destiny, source
With this instruction the series of source characters is subtracted from the destiny chain.
DI is used as an index for the additional segment of the source chain, and SI as an index of the destiny series.
It only affects the content of the flags and DI as well as SI is incremented.