# CMPM Instruction

CMPM (CoMPare Memory) compares two memory locations with each other with after-increment. The flags are affected the same way as if the source was subtracted from the destination. None of the operands are changed.
ADDRESS METHODS: (An)+
DATA LENGTH: Byte, word, longword

FLAGS: | X - U
N - S
Z - S
C - Set if a borrow was needed when subtracting, otherwise it is cleared.
V - S

SYNTAX: CMPM (Ay)+,(Ax)+
There are four CMP instructions, CMP, CMPA, CMPI and CMPM. The compiler often chooses the right instruction, so you can write CMP all the time if you want.