Loads nnnn into BC.
ld
Operands
ld rr,nnnn | ld (rr),r | ld r,nn | ld r,(rr) | ld (nnnn),rr | ld rr,(nnnn) | ld (nnnn),r | ld (rr),nn | ld r,(nnnn) | ld r,r' | ld rr,rr' | ld rr,(rr) | ld (rr),rr | ld (ii+dd),nn | ld r,(ii+dd) | ld (ii+dd),r | ld i,a | ld r,a | ld a,i | ld a,rVariants
Every form of ld the assembler accepts. The cycles column counts clock
cycles, written as taken/not taken for the conditional forms.
| Instruction | Description | Flags | Bytes | Cycles |
|---|---|---|---|---|
| ld bc,nnnn | Loads | — | 3 | 10 |
| ld (bc),a | Stores A into the memory location pointed to by BC. | — | 1 | 7 |
| ld b,nn | Loads | — | 2 | 7 |
| ld a,(bc) | Loads the value pointed to by BC into A. | — | 1 | 7 |
| ld c,nn | Loads | — | 2 | 7 |
| ld de,nnnn | Loads | — | 3 | 10 |
| ld (de),a | Stores A into the memory location pointed to by DE. | — | 1 | 7 |
| ld d,nn | Loads | — | 2 | 7 |
| ld a,(de) | Loads the value pointed to by DE into A. | — | 1 | 7 |
| ld e,nn | Loads | — | 2 | 7 |
| ld hl,nnnn | Loads | — | 3 | 10 |
| ld (nnnn),hl | Stores HL into the memory location pointed to by | — | 3 | 16 |
| ld h,nn | Loads | — | 2 | 7 |
| ld hl,(nnnn) | Loads the value pointed to by | — | 3 | 16 |
| ld l,nn | Loads | — | 2 | 7 |
| ld sp,nnnn | Loads | — | 3 | 10 |
| ld (nnnn),a | Stores A into the memory location pointed to by | — | 3 | 13 |
| ld (hl),nn | Loads | — | 2 | 10 |
| ld a,(nnnn) | Loads the value pointed to by | — | 3 | 13 |
| ld a,nn | Loads | — | 2 | 7 |
| ld b,b | The contents of B are loaded into B. | — | 1 | 4 |
| ld b,c | The contents of C are loaded into B. | — | 1 | 4 |
| ld b,d | The contents of D are loaded into B. | — | 1 | 4 |
| ld b,e | The contents of E are loaded into B. | — | 1 | 4 |
| ld b,h | The contents of H are loaded into B. | — | 1 | 4 |
| ld bc,hl undocumented | The contents of HL are loaded into BC. | — | 2 | 8 |
| ld b,l | The contents of L are loaded into B. | — | 1 | 4 |
| ld b,(hl) | The contents of (HL) are loaded into B. | — | 1 | 7 |
| ld b,a | The contents of A are loaded into B. | — | 1 | 4 |
| ld c,b | The contents of B are loaded into C. | — | 1 | 4 |
| ld c,c | The contents of C are loaded into C. | — | 1 | 4 |
| ld c,d | The contents of D are loaded into C. | — | 1 | 4 |
| ld c,e | The contents of E are loaded into C. | — | 1 | 4 |
| ld c,h | The contents of H are loaded into C. | — | 1 | 4 |
| ld c,l | The contents of L are loaded into C. | — | 1 | 4 |
| ld c,(hl) | The contents of (HL) are loaded into C. | — | 1 | 7 |
| ld bc,(hl) undocumented | The contents of (HL) are loaded into BC. | — | 4 | 26 |
| ld c,a | The contents of A are loaded into C. | — | 1 | 4 |
| ld d,b | The contents of B are loaded into D. | — | 1 | 4 |
| ld de,bc undocumented | The contents of BC are loaded into DE. | — | 2 | 8 |
| ld d,c | The contents of C are loaded into D. | — | 1 | 4 |
| ld d,d | The contents of D are loaded into D. | — | 1 | 4 |
| ld d,e | The contents of E are loaded into D. | — | 1 | 4 |
| ld d,h | The contents of H are loaded into D. | — | 1 | 4 |
| ld de,hl undocumented | The contents of HL are loaded into DE. | — | 2 | 8 |
| ld d,l | The contents of L are loaded into D. | — | 1 | 4 |
| ld d,(hl) | The contents of (HL) are loaded into D. | — | 1 | 7 |
| ld d,a | The contents of A are loaded into D. | — | 1 | 4 |
| ld e,b | The contents of B are loaded into E. | — | 1 | 4 |
| ld e,c | The contents of C are loaded into E. | — | 1 | 4 |
| ld e,d | The contents of D are loaded into E. | — | 1 | 4 |
| ld e,e | The contents of E are loaded into E. | — | 1 | 4 |
| ld e,h | The contents of H are loaded into E. | — | 1 | 4 |
| ld e,l | The contents of L are loaded into E. | — | 1 | 4 |
| ld e,(hl) | The contents of (HL) are loaded into E. | — | 1 | 7 |
| ld e,a | The contents of A are loaded into E. | — | 1 | 4 |
| ld h,b | The contents of B are loaded into H. | — | 1 | 4 |
| ld hl,bc undocumented | The contents of BC are loaded into HL. | — | 2 | 8 |
| ld h,c | The contents of C are loaded into H. | — | 1 | 4 |
| ld h,d | The contents of D are loaded into H. | — | 1 | 4 |
| ld hl,de undocumented | The contents of DE are loaded into HL. | — | 2 | 8 |
| ld h,e | The contents of E are loaded into H. | — | 1 | 4 |
| ld h,h | The contents of H are loaded into H. | — | 1 | 4 |
| ld h,l | The contents of L are loaded into H. | — | 1 | 4 |
| ld h,(hl) | The contents of (HL) are loaded into H. | — | 1 | 7 |
| ld h,a | The contents of A are loaded into H. | — | 1 | 4 |
| ld l,b | The contents of B are loaded into L. | — | 1 | 4 |
| ld l,c | The contents of C are loaded into L. | — | 1 | 4 |
| ld l,d | The contents of D are loaded into L. | — | 1 | 4 |
| ld l,e | The contents of E are loaded into L. | — | 1 | 4 |
| ld l,h | The contents of H are loaded into L. | — | 1 | 4 |
| ld l,l | The contents of L are loaded into L. | — | 1 | 4 |
| ld l,(hl) | The contents of (HL) are loaded into L. | — | 1 | 7 |
| ld l,a | The contents of A are loaded into L. | — | 1 | 4 |
| ld (hl),b | The contents of B are loaded into (HL). | — | 1 | 7 |
| ld (hl),c | The contents of C are loaded into (HL). | — | 1 | 7 |
| ld (hl),bc undocumented | The contents of BC are loaded into (HL). | — | 4 | 26 |
| ld (hl),d | The contents of D are loaded into (HL). | — | 1 | 7 |
| ld (hl),e | The contents of E are loaded into (HL). | — | 1 | 7 |
| ld (hl),de undocumented | The contents of DE are loaded into (HL). | — | 4 | 26 |
| ld (hl),h | The contents of H are loaded into (HL). | — | 1 | 7 |
| ld (hl),l | The contents of L are loaded into (HL). | — | 1 | 7 |
| ld (hl),a | The contents of A are loaded into (HL). | — | 1 | 7 |
| ld a,b | The contents of B are loaded into A. | — | 1 | 4 |
| ld a,c | The contents of C are loaded into A. | — | 1 | 4 |
| ld a,d | The contents of D are loaded into A. | — | 1 | 4 |
| ld a,e | The contents of E are loaded into A. | — | 1 | 4 |
| ld a,h | The contents of H are loaded into A. | — | 1 | 4 |
| ld a,l | The contents of L are loaded into A. | — | 1 | 4 |
| ld a,(hl) | The contents of (HL) are loaded into A. | — | 1 | 7 |
| ld a,a | The contents of A are loaded into A. | — | 1 | 4 |
| ld ix,nnnn | Loads | — | 4 | 14 |
| ld (nnnn),ix | Stores IX into the memory location pointed to by | — | 4 | 20 |
| ld ixh,nn undocumented | Loads | — | 3 | 11 |
| ld ix,(nnnn) | Loads the value pointed to by | — | 4 | 20 |
| ld ixl,nn undocumented | Loads | — | 3 | 11 |
| ld (ix+dd),nn | Stores | — | 4 | 19 |
| ld b,ixh undocumented | The contents of IXH are loaded into B. | — | 2 | 8 |
| ld b,ixl undocumented | The contents of IXL are loaded into B. | — | 2 | 8 |
| ld b,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld c,ixh undocumented | The contents of IXH are loaded into C. | — | 2 | 8 |
| ld c,ixl undocumented | The contents of IXL are loaded into C. | — | 2 | 8 |
| ld c,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld d,ixh undocumented | The contents of IXH are loaded into D. | — | 2 | 8 |
| ld d,ixl undocumented | The contents of IXL are loaded into D. | — | 2 | 8 |
| ld d,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld e,ixh undocumented | The contents of IXH are loaded into E. | — | 2 | 8 |
| ld e,ixl undocumented | The contents of IXL are loaded into E. | — | 2 | 8 |
| ld e,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld ixh,b undocumented | The contents of B are loaded into IXH. | — | 2 | 8 |
| ld ixh,c undocumented | The contents of C are loaded into IXH. | — | 2 | 8 |
| ld ixh,d undocumented | The contents of D are loaded into IXH. | — | 2 | 8 |
| ld ixh,e undocumented | The contents of E are loaded into IXH. | — | 2 | 8 |
| ld ixh,ixh undocumented | The contents of IXH are loaded into IXH. | — | 2 | 8 |
| ld ixh,ixl undocumented | The contents of IXL are loaded into IXH. | — | 2 | 8 |
| ld h,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld ixh,a undocumented | The contents of A are loaded into IXH. | — | 2 | 8 |
| ld ixl,b undocumented | The contents of B are loaded into IXL. | — | 2 | 8 |
| ld ixl,c undocumented | The contents of C are loaded into IXL. | — | 2 | 8 |
| ld ixl,d undocumented | The contents of D are loaded into IXL. | — | 2 | 8 |
| ld ixl,e undocumented | The contents of E are loaded into IXL. | — | 2 | 8 |
| ld ixl,ixh undocumented | The contents of IXH are loaded into IXL. | — | 2 | 8 |
| ld ixl,ixl undocumented | The contents of IXL are loaded into IXL. | — | 2 | 8 |
| ld l,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld ixl,a undocumented | The contents of A are loaded into IXL. | — | 2 | 8 |
| ld (ix+dd),b | Stores B to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),c | Stores C to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),d | Stores D to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),e | Stores E to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),h | Stores H to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),l | Stores L to the memory location pointed to by IX plus | — | 3 | 19 |
| ld (ix+dd),a | Stores A to the memory location pointed to by IX plus | — | 3 | 19 |
| ld a,ixh undocumented | The contents of IXH are loaded into A. | — | 2 | 8 |
| ld a,ixl undocumented | The contents of IXL are loaded into A. | — | 2 | 8 |
| ld a,(ix+dd) | Loads the value pointed to by IX plus | — | 3 | 19 |
| ld sp,ix | Loads the value of IX into SP. | — | 2 | 10 |
| ld (nnnn),bc | Stores BC into the memory location pointed to by | — | 4 | 20 |
| ld i,a | Stores the value of A into register I. | — | 2 | 9 |
| ld bc,(nnnn) | Loads the value pointed to by | — | 4 | 20 |
| ld r,a | Stores the value of A into register R. | — | 2 | 9 |
| ld (nnnn),de | Stores DE into the memory location pointed to by | — | 4 | 20 |
| ld a,i | Stores the value of register I into A. | N=0P/V=*H=0ZS | 2 | 9 |
| ld de,(nnnn) | Loads the value pointed to by | — | 4 | 20 |
| ld a,r | Stores the value of register R into A. | N=0P/V=*H=0ZS | 2 | 9 |
| ld (nnnn),sp | Stores SP into the memory location pointed to by | — | 4 | 20 |
| ld sp,(nnnn) | Loads the value pointed to by | — | 4 | 20 |
| ld sp,hl | Loads the value of HL into SP. | — | 1 | 6 |
| ld iy,nnnn | Loads | — | 4 | 14 |
| ld (nnnn),iy | Stores IY into the memory location pointed to by | — | 4 | 20 |
| ld iyh,nn undocumented | Loads | — | 3 | 11 |
| ld iy,(nnnn) | Loads the value pointed to by | — | 4 | 20 |
| ld iyl,nn undocumented | Loads | — | 3 | 11 |
| ld (iy+dd),nn | Stores | — | 4 | 19 |
| ld b,iyh undocumented | The contents of IYH are loaded into B. | — | 2 | 8 |
| ld b,iyl undocumented | The contents of IYL are loaded into B. | — | 2 | 8 |
| ld b,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld c,iyh undocumented | The contents of IYH are loaded into C. | — | 2 | 8 |
| ld c,iyl undocumented | The contents of IYL are loaded into C. | — | 2 | 8 |
| ld c,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld d,iyh undocumented | The contents of IYH are loaded into D. | — | 2 | 8 |
| ld d,iyl undocumented | The contents of IYL are loaded into D. | — | 2 | 8 |
| ld d,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld e,iyh undocumented | The contents of IYH are loaded into E. | — | 2 | 8 |
| ld e,iyl undocumented | The contents of IYL are loaded into E. | — | 2 | 8 |
| ld e,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld iyh,b undocumented | The contents of B are loaded into IYH. | — | 2 | 8 |
| ld iyh,c undocumented | The contents of C are loaded into IYH. | — | 2 | 8 |
| ld iyh,d undocumented | The contents of D are loaded into IYH. | — | 2 | 8 |
| ld iyh,e undocumented | The contents of E are loaded into IYH. | — | 2 | 8 |
| ld iyh,iyh undocumented | The contents of IYH are loaded into IYH. | — | 2 | 8 |
| ld iyh,iyl undocumented | The contents of IYL are loaded into IYH. | — | 2 | 8 |
| ld h,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld iyh,a undocumented | The contents of A are loaded into IYH. | — | 2 | 8 |
| ld iyl,b undocumented | The contents of B are loaded into IYL. | — | 2 | 8 |
| ld iyl,c undocumented | The contents of C are loaded into IYL. | — | 2 | 8 |
| ld iyl,d undocumented | The contents of D are loaded into IYL. | — | 2 | 8 |
| ld iyl,e undocumented | The contents of E are loaded into IYL. | — | 2 | 8 |
| ld iyl,iyh undocumented | The contents of IYH are loaded into IYL. | — | 2 | 8 |
| ld iyl,iyl undocumented | The contents of IYL are loaded into IYL. | — | 2 | 8 |
| ld l,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld iyl,a undocumented | The contents of A are loaded into IYL. | — | 2 | 8 |
| ld (iy+dd),b | Stores B to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),c | Stores C to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),d | Stores D to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),e | Stores E to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),h | Stores H to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),l | Stores L to the memory location pointed to by IY plus | — | 3 | 19 |
| ld (iy+dd),a | Stores A to the memory location pointed to by IY plus | — | 3 | 19 |
| ld a,iyh undocumented | The contents of IYH are loaded into A. | — | 2 | 8 |
| ld a,iyl undocumented | The contents of IYL are loaded into A. | — | 2 | 8 |
| ld a,(iy+dd) | Loads the value pointed to by IY plus | — | 3 | 19 |
| ld sp,iy | Loads the value of IY into SP. | — | 2 | 10 |