CMP
Compare Memory and Accumulator
Operation: A - M
N V - B D I Z C / . . . . . / /
| Addressing Mode | Assembly Language Form | OP CODE | No. Bytes | No. Cycles |
|---|---|---|---|---|
| Immediate | CMP #$FF | $C9 | 2 | 2 |
| ZeroPage | CMP $FF | $C5 | 2 | 3 |
| ZeroPage,X | CMP $FF,X | $D5 | 2 | 4 |
| Absolute | CMP $FFFF | $CD | 3 | 4 |
| Absolute,X | CMP $FFFF,X | $DD | 3 | 4* |
| Absolute,Y | CMP $FFFF,Y | $D9 | 3 | 4* |
| (Indirect,X) | CMP ($FF,X) | $C1 | 2 | 6 |
| (Indirect),Y | CMP ($FF),Y | $D1 | 2 | 5* |
* Add 1 if page boundary is crossed.
For penalty cycles on the 65816, check the desired addressing mode.