RRAΒΆ
- RRA
- Rotate Right Accumulator
- Description
- Performs a very fast
RR A
; the 0th bit ofA
is moved into the carry, and the carry is moved into the 7th bit ofA
. - Uses
- Quickly dividing
A
by two (carry flag is set if there was a remainder) - Retrieving consecutive bits of a byte in a loop, starting from the right
- Quickly dividing
- Results
Register/Flag 8-bit A
S
flagNot affected Z
flagNot affected H
flagReset P/V
flagNot affected N
flagReset C
flag0th bit of A
- Allowed Instructions
Instruction Opcode CC (ADL/non-ADL) rra $1F 1F - Notes
- When using
RRA
to divideA
by 2, first make sure the carry flag is reset or the result will be( A * 2 ) + ( 128 * Carry )
. - Unlike
RR A
, this instruction does not meaningfully affect any flags exceptC
.
- When using
- See Also
- RLA, RR, RRCA