RLD

Operation

	 n-----------m
	 |           |
  n----Y-T--m n----Y-o--m
A |7  4|3  0| |7  4|3  0| (HL)
  v----T--^-u v-Y^-T--Y-u
          |     ||    |
	  v-----uv----u

Mnemonic

RLD

Operands

None

b7b6b5b4b3b2b1b0
1 1 1 0 1 1 0 1$ED
0 1 1 0 1 1 1 1$6F

Description

The contents of the low-order four bits (bits 3, 2, 1, and 0) of the memory location (HL) are copied to the high-order four bits (7, 6, 5, and 4) of that same memory location; the previous contents of those high-order four bits are copied to the low-order four bits of the Accumulator (Register A); and the previous contents of the low-order four bits of the Accumulator are copied to the low-order four bits of memory location (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
01111010Accumulator

76543210
00110001($5000)

Upon the execution of

	RLD

the Accumulator and memory location $5000 now contain:

76543210
01110011Accumulator

76543210
00011010($5000)