CPY (compare data and Y) Tags: NZC

Description:

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

Example:

    CPY    #50; comparison of data with Y-register