Mnemonics

RRA

Rotate and Shift Group
Expansion:
Rotate Right Accumulator
Usage:
RRA

I don't think I've understood this correctly, marked for revision

Rotate Right Accumulator works by rotating the bits in register A. The most significant bit is taken from the (C)arry flag and then least significant bit is moved off to the (C)arry flag. We actually rotate on a 9-bit pattern (8-bit in the register and a 9th bit in the carry flag).

The RRA instruction does a similar job to RR A but does it faster. There are also some differences in which flags will be affected by RRA compared to RR A.

RRA / RR A Rotate Right Accumulator
Binary (C)arry
11001010 0
01100101 0
00110010 1
10011001 0
01001100 1
10100110 0
01010011 0
00101001 1
10010100 1
11001010 0
Z80.CPU instructions
Instruction Description Opcode
RRA Rotate Right on A register 1F

Example

; Example ld a, %11001010 ; move the value CA to reg A rra ; rotate right accumulator

See also