LDI¶
- LDI
- Load and Increment
- Description
- Copies one byte from
(HL)to(DE), then incrementsHL, incrementsDE, and decrementsBC.ld (de),(hl) ; Not normally a valid instruction inc hl inc de dec bc
- Uses
- This instruction is not very useful on its own, but more often used is the repeating version of
LDI:LDIR
- This instruction is not very useful on its own, but more often used is the repeating version of
- Results
Register/Flag 16-bit (non-ADL) 24-bit (ADL) SflagNot affected ZflagNot affected HflagReset P/VflagSet if BC≠ 0 after the operation; else resetNflagReset CflagNot affected - Allowed Instructions
Instruction Opcode CC (ADL/non-ADL) CC (.S) CC (.L) ldi $ED, $A0 2F + 1R + 1W + 1 3F + 1R + 1W + 1 3F + 1R + 1W + 1 - Notes
- Although this instruction increments
HLandDE, it decrementsBC. - If all you want to accomplish is
ld (de),(hl), considerld a,(hl) \ ld (de),a. It is the same size but is one clock cycle less and doesn’t modify any of the registers exceptA.
- Although this instruction increments
- See Also
- CPI, LD, LDD, LDDR, LDIR