1,885
edits
Changes
→Test and Comparison Operations
The A, X, and Y registers can be directly compared with immediate or memory values:
CMP ; compare (accumulator) CPX ; compare (X register) CPY ; compare (Y register)
These operations are performed by subtraction. The appropriate condition flags are set, and the result of the subtraction is discarded. Conditional branch instructions can be used to alter program flow based on the results of the comparisons.