RR Rotate bits right with Carry
Rotate bits right with carry
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
RRA | ||||||||
0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1F |
RR r | ||||||||
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | CB |
0 | 0 | 0 | 1 | 1 | r | |||
RR (HL) | ||||||||
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | CB |
0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1E |
RR(IX+d) | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | CB |
d | ||||||||
0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1E |
RR (IY+d) | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | CB |
d | ||||||||
0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1E |
Register | r |
---|---|
B | 000 |
C | 001 |
D | 010 |
E | 011 |
H | 100 |
L | 101 |
A | 111 |
Flags Affected
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | reset | ||||||||
p/v | set if parity even, reset if parity odd | ||||||||
c | data from bit 0 of source register |
Opcode Matrix
A | B | C | D | E | H | L | (HL) | (IX+d) | (IY+d) | |
---|---|---|---|---|---|---|---|---|---|---|
RR |
RRA
1F14 |
|
|
|
|
|
|
|
|
|
RR |
RR A
CB1F28 |
RR B
CB1828 |
RR C
CB1928 |
RR D
CB1A28 |
RR E
CB1B28 |
RR H
CB1C28 |
RR L
CB1D28 |
RR (HL)
CB1E215 |
RR (IX+d)
DDCBnn1E423 |
RR (IY+d)
FDCBnn1E423 |
Instruction
Opcode hexSize bytesCycle count
| Register | Memory |
Last modified November 16, 2021: Add flags to rot operations (2eee171)