CMP: Compare: - This instruction compares the source operand, which can be a register or memory location an immediate data with a destination operand that might be a register or a memory location. For the purpose of comparison, it subtracts the source operand from the destination operand but does not stock up the result anywhere. The flags are affected and depending on the result of the subtraction. If both of the operands are equal to zero flag is set. If the source operand is higher than the destination operand, carry flag is set or else is reset. The instance of this instruction are following:
Example :
1. CMP BX, 0100H Immediate
2. CMP 0100 Immediate [AX implicit]
3. CMP [5000H],OIOOH Direct
4. CMP BX, [SI] Register indirect
5. CMP BX, CX Register