RosettaCodeData/Task/Bitwise-operations/6502-Assembly/bitwise-operations-6.6502
2023-07-01 13:44:08 -04:00

6 lines
282 B
Text

LDA #$FF
CLC ;clear the carry. That way, ROR will not accidentally shift a 1 into the top bit of a positive number
BPL SKIP
SEC ;if the value in A is negative, setting the carry will ensure that ROR will insert a 1 into bit 7 of A upon rotating.
SKIP:
ROR