LDI

Operation

(DE) <- (HL), DE <- DE+1, HL <- HL+1, BC <- BC-1

Mnemonic

LDI

Operands

None

b7b6b5b4b3b2b1b0
1 1 1 0 1 1 0 1$ED
1 0 1 0 0 0 0 0$A0

Description

A byte of data is transferred from the memory location addressed, by the contents of the HL register pair to the memory location addressed by the contents of the DE register pair. Then both these register pairs are incremented and the Byte Counter (BC) Register pair is decremented.

Condition Bits Affected

Sis not affected.
Zis not affected.
His reset.
P/Vis set if BC-1 != 0; otherwise, it is reset.
Nis reset.
Cis not affected.

Example

If the HL register pair contains $1111, memory location $1111 contains byte $88, the DE register pair contains $2222, the memory location $2222 contains byte $66, and the BC register pair contains $07, then the instruction

	LDI

results in the following contents in register pairs and memory addresses:

HLcontains$1112
($1111)contains$88
DEcontains$2223
($2222)contains$88
BCcontains$06