cmpm
Compare memory
Compares two memory operands that use post-increment addressing and sets the flags.
Sizes .b .w .l, .w by default
XNZVC –●●●●
- ● set from the result
- – not changed
Forms
cmpm ,
Operands
(An)+- Memory at the address stored in an address register, for example
(a0)+. After access, the simulator increases the register by the operation’s size in bytes. More
* --- Compare two memory blocks byte by byte ---
lea $1000, a0
lea $2000, a1
move.l #$AABB, (a0)
move.l #$AABB, (a1)
cmpm.b (a0)+, (a1)+ ; compare 1st byte (equal)
seq d0
cmpm.b (a0)+, (a1)+ ; compare 2nd byte (equal)
seq d1
; a0 and a1 are auto-incremented after each cmpm