Open main menu

CDOT Wiki β

Changes

6502 Instructions - Introduction

6 bytes removed, 01:56, 11 September 2023
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.