RRD

Operation

	  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

Mnemonic

RRD

Operands

None

b7b6b5b4b3b2b1b0
1 1 1 0 1 1 0 1$ED
0 1 1 0 1 1 1 0$67

Description

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.

Condition Bits Affected

Sis set if the Accumulator is negative after an operation, otherwise, it is reset.
ZZ is set if the Accumulator is 0 after an operation, otherwise it is reset.
His reset.
P/Vis set if the parity of the Accumulator is even after an operation, otherwise it is reset.
Nis reset.
Cis not affected.

Example

The HL register pair contains 5000h and the Accumulator and memory location 5000h contain the following data.

76543210
10000100Accumulator

76543210
00100000($5000)

Upon the execution of

	RRD

the Accumulator and memory location $5000 now contain:

76543210
10000000Accumulator

76543210
01000010($5000)