n-----mn----m
| || |
n----Y--T-m n-oT-Y--o-m
A |7 4|3 0| |7 4|3 0| (HL)
v----T--^-u v----T--Y-u
| |
v-----------u
RRD
None
| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | $ED |
| 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | $67 |
The contents of the low-order four bits (bits 3, 2, 1, and 0) of memory location (HL) are copied to the low-order four bits of the Accumulator (Register A). The previous contents of the low-order four bits of the Accumulator are copied to the high-order four bits (7, 6, 5, and 4) of location (HL); and the previous contents of the high-order four bits of (HL) are copied to the low-order four bits of (HL). The contents of the high-order bits of the Accumulator are unaffected.
Note: (HL) refers to the memory location specified by the contents of the HL register pair.
| S | is set if the Accumulator is negative after an operation, otherwise, it is reset. |
| Z | Z is set if the Accumulator is 0 after an operation, otherwise it is reset. |
| H | is reset. |
| P/V | is set if the parity of the Accumulator is even after an operation, otherwise it is reset. |
| N | is reset. |
| C | is not affected. |
The HL register pair contains 5000h and the Accumulator and memory location 5000h contain the following data.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | Accumulator |
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | ($5000) |
Upon the execution of
RRD
the Accumulator and memory location $5000 now contain:
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Accumulator |
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | ($5000) |