LDX #$FF INX ;the carry flag is not affected by this unsigned overflow, but the zero flag will be set ; so we can detect overflow that way instead! BEQ OverflowOccurred ;notice that we used BEQ here and not BCS.