54. CoMPare Memory

54.1. Name

CMPM -- Compare memory

54.2. Synopsis

        CMPM        (Ay)+,(Ax)+

        Size = (Byte, Word, Long)

54.3. Function

Subtracts the source operand from the destination operand and sets the condition codes according to the result. The destination operand is NOT changed. Operands are always addressed with the postincrement mode.

54.4. Format

        -----------------------------------------------------------------
        |15 |14 |13 |12 |11 |10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        |---|---|---|---|-----------|---|-------|---|---|---|-----------|
        | 1 | 0 | 1 | 1 |Ax REGISTER| 1 | SIZE  | 0 | 0 | 1 |Ay REGISTER|
        ----------------------------------------=========================
                                                          <ea>

SIZE
        00->one Byte operation
        01->one Word operation
        10->one Long operation

REGISTER
        Ax register specifies destination operand (for post-incrementation).
        Ay register specifies source operand.

54.5. Result

        X - Not affected
        N - Set if the result is negative. Cleared otherwise.
        Z - Set if the result is zero. Cleared otherwise.
        V - Set if an overflow occours. Cleared otherwise.
        C - Set if a borrow occours. Cleared otherwise.

54.6. See also

CMP CMPI CMPA CMP2 TST CHK CHK2