Question: how cmp works in assembly?
Answer: The CMP instruction compares two operands. ... This instruction basically subtracts one operand from the other for comparing whether the operands are equal or not. It does not disturb the destination or source operands. It is used along with the conditional jump instruction for decision making.