CPX (compare data and X) Tags: NZC

Description:

Compares the data with the X register by performing a subtraction (X - data). Sets the N, Z, and C tags without saving the result of the subtraction anywhere. Z is set when the result is zero, otherwise zeroed. N takes on the value of the highest bit of the result. C is set for X>=data, erased for X<data.

Example:

    CMX #$14    ; comparison with register X