RosettaCodeData/Task/Bitwise-operations/6502-Assembly/bitwise-operations-6.6502

7 lines
282 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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