RosettaCodeData/Task/Integer-overflow/6502-Assembly/integer-overflow-5.6502

5 lines
256 B
Plaintext

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.