Z80 Complete Documentation

Instructions

adc adc r,r' | adc r | adc r,(rr) | adc (rr) | adc r,nn | adc nn | adc r,(ii+dd) | adc (ii+dd) | adc rr,rr'

Adds B and the carry flag to A.

adc a,b

Adds C and the carry flag to A.

adc a,c

Adds D and the carry flag to A.

adc a,d

Adds E and the carry flag to A.

adc a,e

Adds H and the carry flag to A.

adc a,h

Adds L and the carry flag to A.

adc a,l

Adds (HL) and the carry flag to A.

adc a,(hl)

Adds A and the carry flag to A.

adc a,a

Adds nn and the carry flag to A.

adc a,nn

Adds IXH and the carry flag to A.

adc a,ixh

Adds IXL and the carry flag to A.

adc a,ixl

Adds the value pointed to by IX plus dd and the carry flag to A.

adc a,(ix+dd)

Adds BC and the carry flag to HL.

adc hl,bc

Adds DE and the carry flag to HL.

adc hl,de

Adds HL and the carry flag to HL.

adc hl,hl

Adds SP and the carry flag to HL.

adc hl,sp

Adds IYH and the carry flag to A.

adc a,iyh

Adds IYL and the carry flag to A.

adc a,iyl

Adds the value pointed to by IY plus dd and the carry flag to A.

adc a,(iy+dd)

add add rr,rr' | add r,r' | add r | add r,(rr) | add (rr) | add r,nn | add nn | add r,(ii+dd) | add (ii+dd)

The value of BC is added to HL.

add hl,bc

The value of DE is added to HL.

add hl,de

The value of HL is added to HL.

add hl,hl

The value of SP is added to HL.

add hl,sp

Adds B to A.

add a,b

Adds C to A.

add a,c

Adds D to A.

add a,d

Adds E to A.

add a,e

Adds H to A.

add a,h

Adds L to A.

add a,l

Adds (HL) to A.

add a,(hl)

Adds A to A.

add a,a

Adds nn to A.

add a,nn

The value of BC is added to IX.

add ix,bc

The value of DE is added to IX.

add ix,de

The value of IX is added to IX.

add ix,ix

The value of SP is added to IX.

add ix,sp

Adds IXH to A.

add a,ixh

Adds IXL to A.

add a,ixl

Adds the value pointed to by IX plus dd to A.

add a,(ix+dd)

The value of BC is added to IY.

add iy,bc

The value of DE is added to IY.

add iy,de

The value of IY is added to IY.

add iy,iy

The value of SP is added to IY.

add iy,sp

Adds IYH to A.

add a,iyh

Adds IYL to A.

add a,iyl

Adds the value pointed to by IY plus dd to A.

add a,(iy+dd)

and and r | and r,r' | and (rr) | and r,(rr) | and (ii+dd) | and r,(ii+dd) | and nn | and r,nn

Bitwise AND on A with B.

and b

Bitwise AND on A with C.

and c

Bitwise AND on A with D.

and d

Bitwise AND on A with E.

and e

Bitwise AND on A with H.

and h

Bitwise AND on A with L.

and l

Bitwise AND on A with (HL).

and (hl)

Bitwise AND on A with A.

and a

Bitwise AND on A with IXH.

and ixh

Bitwise AND on A with IXL.

and ixl

Bitwise AND on A with the value pointed to by IX plus dd.

and (ix+dd)

Bitwise AND on A with nn.

and nn

Bitwise AND on A with IYH.

and iyh

Bitwise AND on A with IYL.

and iyl

Bitwise AND on A with the value pointed to by IY plus dd.

and (iy+dd)

bit bit bit,r | bit bit,(rr) | bit bit,(ii+dd)

Tests bit 0 of B.

bit 0,b

Tests bit 0 of C.

bit 0,c

Tests bit 0 of D.

bit 0,d

Tests bit 0 of E.

bit 0,e

Tests bit 0 of H.

bit 0,h

Tests bit 0 of L.

bit 0,l

Tests bit 0 of (HL).

bit 0,(hl)

Tests bit 0 of A.

bit 0,a

Tests bit 1 of B.

bit 1,b

Tests bit 1 of C.

bit 1,c

Tests bit 1 of D.

bit 1,d

Tests bit 1 of E.

bit 1,e

Tests bit 1 of H.

bit 1,h

Tests bit 1 of L.

bit 1,l

Tests bit 1 of (HL).

bit 1,(hl)

Tests bit 1 of A.

bit 1,a

Tests bit 2 of B.

bit 2,b

Tests bit 2 of C.

bit 2,c

Tests bit 2 of D.

bit 2,d

Tests bit 2 of E.

bit 2,e

Tests bit 2 of H.

bit 2,h

Tests bit 2 of L.

bit 2,l

Tests bit 2 of (HL).

bit 2,(hl)

Tests bit 2 of A.

bit 2,a

Tests bit 3 of B.

bit 3,b

Tests bit 3 of C.

bit 3,c

Tests bit 3 of D.

bit 3,d

Tests bit 3 of E.

bit 3,e

Tests bit 3 of H.

bit 3,h

Tests bit 3 of L.

bit 3,l

Tests bit 3 of (HL).

bit 3,(hl)

Tests bit 3 of A.

bit 3,a

Tests bit 4 of B.

bit 4,b

Tests bit 4 of C.

bit 4,c

Tests bit 4 of D.

bit 4,d

Tests bit 4 of E.

bit 4,e

Tests bit 4 of H.

bit 4,h

Tests bit 4 of L.

bit 4,l

Tests bit 4 of (HL).

bit 4,(hl)

Tests bit 4 of A.

bit 4,a

Tests bit 5 of B.

bit 5,b

Tests bit 5 of C.

bit 5,c

Tests bit 5 of D.

bit 5,d

Tests bit 5 of E.

bit 5,e

Tests bit 5 of H.

bit 5,h

Tests bit 5 of L.

bit 5,l

Tests bit 5 of (HL).

bit 5,(hl)

Tests bit 5 of A.

bit 5,a

Tests bit 6 of B.

bit 6,b

Tests bit 6 of C.

bit 6,c

Tests bit 6 of D.

bit 6,d

Tests bit 6 of E.

bit 6,e

Tests bit 6 of H.

bit 6,h

Tests bit 6 of L.

bit 6,l

Tests bit 6 of (HL).

bit 6,(hl)

Tests bit 6 of A.

bit 6,a

Tests bit 7 of B.

bit 7,b

Tests bit 7 of C.

bit 7,c

Tests bit 7 of D.

bit 7,d

Tests bit 7 of E.

bit 7,e

Tests bit 7 of H.

bit 7,h

Tests bit 7 of L.

bit 7,l

Tests bit 7 of (HL).

bit 7,(hl)

Tests bit 7 of A.

bit 7,a

Tests bit 0 of the memory location pointed to by IX plus dd.

bit 0,(ix+dd)

Tests bit 1 of the memory location pointed to by IX plus dd.

bit 1,(ix+dd)

Tests bit 2 of the memory location pointed to by IX plus dd.

bit 2,(ix+dd)

Tests bit 3 of the memory location pointed to by IX plus dd.

bit 3,(ix+dd)

Tests bit 4 of the memory location pointed to by IX plus dd.

bit 4,(ix+dd)

Tests bit 5 of the memory location pointed to by IX plus dd.

bit 5,(ix+dd)

Tests bit 6 of the memory location pointed to by IX plus dd.

bit 6,(ix+dd)

Tests bit 7 of the memory location pointed to by IX plus dd.

bit 7,(ix+dd)

Tests bit 0 of the memory location pointed to by IY plus dd.

bit 0,(iy+dd)

Tests bit 1 of the memory location pointed to by IY plus dd.

bit 1,(iy+dd)

Tests bit 2 of the memory location pointed to by IY plus dd.

bit 2,(iy+dd)

Tests bit 3 of the memory location pointed to by IY plus dd.

bit 3,(iy+dd)

Tests bit 4 of the memory location pointed to by IY plus dd.

bit 4,(iy+dd)

Tests bit 5 of the memory location pointed to by IY plus dd.

bit 5,(iy+dd)

Tests bit 6 of the memory location pointed to by IY plus dd.

bit 6,(iy+dd)

Tests bit 7 of the memory location pointed to by IY plus dd.

bit 7,(iy+dd)

call call cc,nnnn | call nnnn

If the zero flag is unset, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call nz,nnnn

If the zero flag is set, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call z,nnnn

The current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call nnnn

If the carry flag is unset, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call nc,nnnn

If the carry flag is set, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call c,nnnn

If the parity/overflow flag is unset, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call po,nnnn

If the parity/overflow flag is set, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call pe,nnnn

If the sign flag is unset, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call p,nnnn

If the sign flag is set, the current PC value plus three is pushed onto the stack, then is loaded with nnnn.

call m,nnnn

ccf ccf

Inverts the carry flag.

ccf

cp cp r | cp r,r' | cp (rr) | cp r,(rr) | cp (ii+dd) | cp r,(ii+dd) | cp nn | cp r,nn

Subtracts B from A and affects flags according to the result. A is not modified.

cp b

Subtracts C from A and affects flags according to the result. A is not modified.

cp c

Subtracts D from A and affects flags according to the result. A is not modified.

cp d

Subtracts E from A and affects flags according to the result. A is not modified.

cp e

Subtracts H from A and affects flags according to the result. A is not modified.

cp h

Subtracts L from A and affects flags according to the result. A is not modified.

cp l

Subtracts (HL) from A and affects flags according to the result. A is not modified.

cp (hl)

Subtracts A from A and affects flags according to the result. A is not modified.

cp a

Subtracts IXH from A and affects flags according to the result. A is not modified.

cp ixh

Subtracts IXL from A and affects flags according to the result. A is not modified.

cp ixl

Subtracts the value pointed to by IX plus dd from A and affects flags according to the result. A is not modified.

cp (ix+dd)

Subtracts IYH from A and affects flags according to the result. A is not modified.

cp iyh

Subtracts IYL from A and affects flags according to the result. A is not modified.

cp iyl

Subtracts the value pointed to by IY plus dd from A and affects flags according to the result. A is not modified.

cp (iy+dd)

Subtracts nn from A and affects flags according to the result. A is not modified.

cp nn

cpd cpd

Compares the value of the memory location pointed to by HL with A. Then HL and BC are decremented. p/v is reset if BC becomes zero and set otherwise.

cpd

cpdr cpdr

Compares the value of the memory location pointed to by HL with A. Then HL and BC are decremented. If BC is not zero and z is not set, this operation is repeated. p/v is reset if BC becomes zero and set otherwise, acting as an indicator that HL reached a memory location whose value equalled A before the counter went to zero. Interrupts can trigger while this instruction is processing.

cpdr

cpi cpi

Compares the value of the memory location pointed to by HL with A. Then HL is incremented and BC is decremented. p/v is reset if BC becomes zero and set otherwise.

cpi

cpir cpir

Compares the value of the memory location pointed to by HL with A. Then HL is incremented and BC is decremented. If BC is not zero and z is not set, this operation is repeated. p/v is reset if BC becomes zero and set otherwise, acting as an indicator that HL reached a memory location whose value equalled A before the counter went to zero. Interrupts can trigger while this instruction is processing.

cpir

cpl cpl

The contents of A are inverted (one's complement).

cpl

daa daa

Adjusts A for BCD addition and subtraction operations.

daa

dec dec r | dec rr | dec (rr) | dec (ii+dd)

Subtracts one from B.

dec b

Subtracts one from BC.

dec bc

Subtracts one from C.

dec c

Subtracts one from D.

dec d

Subtracts one from DE.

dec de

Subtracts one from E.

dec e

Subtracts one from H.

dec h

Subtracts one from HL.

dec hl

Subtracts one from L.

dec l

Subtracts one from (HL).

dec (hl)

Subtracts one from SP.

dec sp

Subtracts one from A.

dec a

Subtracts one from IXH.

dec ixh

Subtracts one from IX.

dec ix

Subtracts one from IXL.

dec ixl

Subtracts one from the memory location pointed to by IX plus dd.

dec (ix+dd)

Subtracts one from IYH.

dec iyh

Subtracts one from IY.

dec iy

Subtracts one from IYL.

dec iyl

Subtracts one from the memory location pointed to by IY plus dd.

dec (iy+dd)

di di

Resets both interrupt flip-flops, thus preventing maskable interrupts from triggering.

di

djnz djnz offset

The B register is decremented, and if not zero, the signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

djnz offset

ei ei

Sets both interrupt flip-flops, thus allowing maskable interrupts to occur. An interrupt will not occur until after the immediately following instruction.

ei

ex ex rr,rr' | ex (rr),rr | ex rr,(rr)

Exchanges the 16-bit contents of AF and AF'.

ex af,af'

Exchanges (SP) with IXL, and (SP+1) with IXH.

ex (sp),ix

Exchanges (SP) with L, and (SP+1) with H.

ex (sp),hl

Exchanges the 16-bit contents of DE and HL.

ex de,hl

Exchanges (SP) with IYL, and (SP+1) with IYH.

ex (sp),iy

exx exx

Exchanges the 16-bit contents of BC, DE, and HL with BC', DE', and HL'.

exx

halt halt

Suspends CPU operation until an interrupt or reset occurs.

halt

im im 0 | im 1 | im 2

Sets interrupt mode 0.

im 0

Sets interrupt mode 1.

im 1

Sets interrupt mode 2.

im 2

in in r,(nn) | in r,nn | in r,(rr) | in (rr)

A byte from the port whose address is formed by A in the high bits and nn in the low bits is written to A.

in a,(nn)

A byte from the port at the 16-bit address contained in the BC register pair is written to B.

in b,(c)

A byte from the port at the 16-bit address contained in the BC register pair is written to C.

in c,(c)

A byte from the port at the 16-bit address contained in the BC register pair is written to D.

in d,(c)

A byte from the port at the 16-bit address contained in the BC register pair is written to E.

in e,(c)

A byte from the port at the 16-bit address contained in the BC register pair is written to H.

in h,(c)

A byte from the port at the 16-bit address contained in the BC register pair is written to L.

in l,(c)

Inputs a byte from the port at the 16-bit address contained in the BC register pair and affects flags only.

in (c)

A byte from the port at the 16-bit address contained in the BC register pair is written to A.

in a,(c)

inc inc rr | inc r | inc (rr) | inc (ii+dd)

Adds one to BC.

inc bc

Adds one to B.

inc b

Adds one to C.

inc c

Adds one to DE.

inc de

Adds one to D.

inc d

Adds one to E.

inc e

Adds one to HL.

inc hl

Adds one to H.

inc h

Adds one to L.

inc l

Adds one to SP.

inc sp

Adds one to (HL).

inc (hl)

Adds one to A.

inc a

Adds one to IX.

inc ix

Adds one to IXH.

inc ixh

Adds one to IXL.

inc ixl

Adds one to the memory location pointed to by IX plus dd.

inc (ix+dd)

Adds one to IY.

inc iy

Adds one to IYH.

inc iyh

Adds one to IYL.

inc iyl

Adds one to the memory location pointed to by IY plus dd.

inc (iy+dd)

ind ind

A byte from the port at the 16-bit address contained in the BC register pair is written to the memory location pointed to by HL. Then HL and B are decremented. Note that the carry flag may be affected, contrary to documentation. Read More

ind

indr indr

A byte from the port at the 16-bit address contained in the BC register pair is written to the memory location pointed to by HL. Then HL and B are decremented. If B is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing. Note that the carry flag may be affected, contrary to documentation. Read More

indr

ini ini

A byte from the port at the 16-bit address contained in the BC register pair is written to the memory location pointed to by HL. Then HL is incremented and B is decremented. Note that the carry flag may be affected, contrary to documentation. Read More

ini

inir inir

A byte from the port at the 16-bit address contained in the BC register pair is written to the memory location pointed to by HL. Then HL is incremented and B is decremented. If B is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing. Note that the carry flag may be affected, contrary to documentation. Read More

inir

jp jp cc,nnnn | jp nnnn | jp (rr) | jp rr

If the zero flag is unset, nnnn is copied to PC.

jp nz,nnnn

nnnn is copied to PC.

jp nnnn

If the zero flag is set, nnnn is copied to PC.

jp z,nnnn

If the carry flag is unset, nnnn is copied to PC.

jp nc,nnnn

If the carry flag is set, nnnn is copied to PC.

jp c,nnnn

Loads the value of IX into PC.

jp (ix)

If the parity/overflow flag is unset, nnnn is copied to PC.

jp po,nnnn

Loads the value of HL into PC.

jp (hl)

If the parity/overflow flag is set, nnnn is copied to PC.

jp pe,nnnn

If the sign flag is unset, nnnn is copied to PC.

jp p,nnnn

If the sign flag is set, nnnn is copied to PC.

jp m,nnnn

Loads the value of IY into PC.

jp (iy)

jr jr offset | jr cc,offset

The signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

jr offset

If the zero flag is unset, the signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

jr nz,offset

If the zero flag is set, the signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

jr z,offset

If the carry flag is unset, the signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

jr nc,offset

If the carry flag is set, the signed value offset is added to PC. The jump is measured from the start of the instruction opcode.

jr c,offset

ld 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,r

Loads nnnn into BC.

ld bc,nnnn

Stores A into the memory location pointed to by BC.

ld (bc),a

Loads nn into B.

ld b,nn

Loads the value pointed to by BC into A.

ld a,(bc)

Loads nn into C.

ld c,nn

Loads nnnn into DE.

ld de,nnnn

Stores A into the memory location pointed to by DE.

ld (de),a

Loads nn into D.

ld d,nn

Loads the value pointed to by DE into A.

ld a,(de)

Loads nn into E.

ld e,nn

Loads nnnn into HL.

ld hl,nnnn

Stores HL into the memory location pointed to by nnnn.

ld (nnnn),hl

Loads nn into H.

ld h,nn

Loads the value pointed to by nnnn into HL.

ld hl,(nnnn)

Loads nn into L.

ld l,nn

Loads nnnn into SP.

ld sp,nnnn

Stores A into the memory location pointed to by nnnn.

ld (nnnn),a

Loads nn into (HL).

ld (hl),nn

Loads the value pointed to by nnnn into A.

ld a,(nnnn)

Loads nn into A.

ld a,nn

The contents of B are loaded into B.

ld b,b

The contents of C are loaded into B.

ld b,c

The contents of D are loaded into B.

ld b,d

The contents of E are loaded into B.

ld b,e

The contents of H are loaded into B.

ld b,h

The contents of HL are loaded into BC.

ld bc,hl

The contents of L are loaded into B.

ld b,l

The contents of (HL) are loaded into B.

ld b,(hl)

The contents of A are loaded into B.

ld b,a

The contents of B are loaded into C.

ld c,b

The contents of C are loaded into C.

ld c,c

The contents of D are loaded into C.

ld c,d

The contents of E are loaded into C.

ld c,e

The contents of H are loaded into C.

ld c,h

The contents of L are loaded into C.

ld c,l

The contents of (HL) are loaded into C.

ld c,(hl)

The contents of (HL) are loaded into BC.

ld bc,(hl)

The contents of A are loaded into C.

ld c,a

The contents of B are loaded into D.

ld d,b

The contents of BC are loaded into DE.

ld de,bc

The contents of C are loaded into D.

ld d,c

The contents of D are loaded into D.

ld d,d

The contents of E are loaded into D.

ld d,e

The contents of H are loaded into D.

ld d,h

The contents of HL are loaded into DE.

ld de,hl

The contents of L are loaded into D.

ld d,l

The contents of (HL) are loaded into D.

ld d,(hl)

The contents of A are loaded into D.

ld d,a

The contents of B are loaded into E.

ld e,b

The contents of C are loaded into E.

ld e,c

The contents of D are loaded into E.

ld e,d

The contents of E are loaded into E.

ld e,e

The contents of H are loaded into E.

ld e,h

The contents of L are loaded into E.

ld e,l

The contents of (HL) are loaded into E.

ld e,(hl)

The contents of A are loaded into E.

ld e,a

The contents of B are loaded into H.

ld h,b

The contents of BC are loaded into HL.

ld hl,bc

The contents of C are loaded into H.

ld h,c

The contents of D are loaded into H.

ld h,d

The contents of DE are loaded into HL.

ld hl,de

The contents of E are loaded into H.

ld h,e

The contents of H are loaded into H.

ld h,h

The contents of L are loaded into H.

ld h,l

The contents of (HL) are loaded into H.

ld h,(hl)

The contents of A are loaded into H.

ld h,a

The contents of B are loaded into L.

ld l,b

The contents of C are loaded into L.

ld l,c

The contents of D are loaded into L.

ld l,d

The contents of E are loaded into L.

ld l,e

The contents of H are loaded into L.

ld l,h

The contents of L are loaded into L.

ld l,l

The contents of (HL) are loaded into L.

ld l,(hl)

The contents of A are loaded into L.

ld l,a

The contents of B are loaded into (HL).

ld (hl),b

The contents of C are loaded into (HL).

ld (hl),c

The contents of BC are loaded into (HL).

ld (hl),bc

The contents of D are loaded into (HL).

ld (hl),d

The contents of E are loaded into (HL).

ld (hl),e

The contents of DE are loaded into (HL).

ld (hl),de

The contents of H are loaded into (HL).

ld (hl),h

The contents of L are loaded into (HL).

ld (hl),l

The contents of A are loaded into (HL).

ld (hl),a

The contents of B are loaded into A.

ld a,b

The contents of C are loaded into A.

ld a,c

The contents of D are loaded into A.

ld a,d

The contents of E are loaded into A.

ld a,e

The contents of H are loaded into A.

ld a,h

The contents of L are loaded into A.

ld a,l

The contents of (HL) are loaded into A.

ld a,(hl)

The contents of A are loaded into A.

ld a,a

Loads nnnn into register IX.

ld ix,nnnn

Stores IX into the memory location pointed to by nnnn.

ld (nnnn),ix

Loads nn into IXH.

ld ixh,nn

Loads the value pointed to by nnnn into IX.

ld ix,(nnnn)

Loads nn into IXL.

ld ixl,nn

Stores nn to the memory location pointed to by IX plus dd.

ld (ix+dd),nn

The contents of IXH are loaded into B.

ld b,ixh

The contents of IXL are loaded into B.

ld b,ixl

Loads the value pointed to by IX plus dd into B.

ld b,(ix+dd)

The contents of IXH are loaded into C.

ld c,ixh

The contents of IXL are loaded into C.

ld c,ixl

Loads the value pointed to by IX plus dd into C.

ld c,(ix+dd)

The contents of IXH are loaded into D.

ld d,ixh

The contents of IXL are loaded into D.

ld d,ixl

Loads the value pointed to by IX plus dd into D.

ld d,(ix+dd)

The contents of IXH are loaded into E.

ld e,ixh

The contents of IXL are loaded into E.

ld e,ixl

Loads the value pointed to by IX plus dd into E.

ld e,(ix+dd)

The contents of B are loaded into IXH.

ld ixh,b

The contents of C are loaded into IXH.

ld ixh,c

The contents of D are loaded into IXH.

ld ixh,d

The contents of E are loaded into IXH.

ld ixh,e

The contents of IXH are loaded into IXH.

ld ixh,ixh

The contents of IXL are loaded into IXH.

ld ixh,ixl

Loads the value pointed to by IX plus dd into H.

ld h,(ix+dd)

The contents of A are loaded into IXH.

ld ixh,a

The contents of B are loaded into IXL.

ld ixl,b

The contents of C are loaded into IXL.

ld ixl,c

The contents of D are loaded into IXL.

ld ixl,d

The contents of E are loaded into IXL.

ld ixl,e

The contents of IXH are loaded into IXL.

ld ixl,ixh

The contents of IXL are loaded into IXL.

ld ixl,ixl

Loads the value pointed to by IX plus dd into L.

ld l,(ix+dd)

The contents of A are loaded into IXL.

ld ixl,a

Stores B to the memory location pointed to by IX plus dd.

ld (ix+dd),b

Stores C to the memory location pointed to by IX plus dd.

ld (ix+dd),c

Stores D to the memory location pointed to by IX plus dd.

ld (ix+dd),d

Stores E to the memory location pointed to by IX plus dd.

ld (ix+dd),e

Stores H to the memory location pointed to by IX plus dd.

ld (ix+dd),h

Stores L to the memory location pointed to by IX plus dd.

ld (ix+dd),l

Stores A to the memory location pointed to by IX plus dd.

ld (ix+dd),a

The contents of IXH are loaded into A.

ld a,ixh

The contents of IXL are loaded into A.

ld a,ixl

Loads the value pointed to by IX plus dd into A.

ld a,(ix+dd)

Loads the value of IX into SP.

ld sp,ix

Stores BC into the memory location pointed to by nnnn.

ld (nnnn),bc

Stores the value of A into register I.

ld i,a

Loads the value pointed to by nnnn into BC.

ld bc,(nnnn)

Stores the value of A into register R.

ld r,a

Stores DE into the memory location pointed to by nnnn.

ld (nnnn),de

Stores the value of register I into A.

ld a,i

Loads the value pointed to by nnnn into DE.

ld de,(nnnn)

Stores the value of register R into A.

ld a,r

Stores SP into the memory location pointed to by nnnn.

ld (nnnn),sp

Loads the value pointed to by nnnn into SP.

ld sp,(nnnn)

Loads the value of HL into SP.

ld sp,hl

Loads nnnn into register IY.

ld iy,nnnn

Stores IY into the memory location pointed to by nnnn.

ld (nnnn),iy

Loads nn into IYH.

ld iyh,nn

Loads the value pointed to by nnnn into IY.

ld iy,(nnnn)

Loads nn into IYL.

ld iyl,nn

Stores nn to the memory location pointed to by IY plus dd.

ld (iy+dd),nn

The contents of IYH are loaded into B.

ld b,iyh

The contents of IYL are loaded into B.

ld b,iyl

Loads the value pointed to by IY plus dd into B.

ld b,(iy+dd)

The contents of IYH are loaded into C.

ld c,iyh

The contents of IYL are loaded into C.

ld c,iyl

Loads the value pointed to by IY plus dd into C.

ld c,(iy+dd)

The contents of IYH are loaded into D.

ld d,iyh

The contents of IYL are loaded into D.

ld d,iyl

Loads the value pointed to by IY plus dd into D.

ld d,(iy+dd)

The contents of IYH are loaded into E.

ld e,iyh

The contents of IYL are loaded into E.

ld e,iyl

Loads the value pointed to by IY plus dd into E.

ld e,(iy+dd)

The contents of B are loaded into IYH.

ld iyh,b

The contents of C are loaded into IYH.

ld iyh,c

The contents of D are loaded into IYH.

ld iyh,d

The contents of E are loaded into IYH.

ld iyh,e

The contents of IYH are loaded into IYH.

ld iyh,iyh

The contents of IYL are loaded into IYH.

ld iyh,iyl

Loads the value pointed to by IY plus dd into H.

ld h,(iy+dd)

The contents of A are loaded into IYH.

ld iyh,a

The contents of B are loaded into IYL.

ld iyl,b

The contents of C are loaded into IYL.

ld iyl,c

The contents of D are loaded into IYL.

ld iyl,d

The contents of E are loaded into IYL.

ld iyl,e

The contents of IYH are loaded into IYL.

ld iyl,iyh

The contents of IYL are loaded into IYL.

ld iyl,iyl

Loads the value pointed to by IY plus dd into L.

ld l,(iy+dd)

The contents of A are loaded into IYL.

ld iyl,a

Stores B to the memory location pointed to by IY plus dd.

ld (iy+dd),b

Stores C to the memory location pointed to by IY plus dd.

ld (iy+dd),c

Stores D to the memory location pointed to by IY plus dd.

ld (iy+dd),d

Stores E to the memory location pointed to by IY plus dd.

ld (iy+dd),e

Stores H to the memory location pointed to by IY plus dd.

ld (iy+dd),h

Stores L to the memory location pointed to by IY plus dd.

ld (iy+dd),l

Stores A to the memory location pointed to by IY plus dd.

ld (iy+dd),a

The contents of IYH are loaded into A.

ld a,iyh

The contents of IYL are loaded into A.

ld a,iyl

Loads the value pointed to by IY plus dd into A.

ld a,(iy+dd)

Loads the value of IY into SP.

ld sp,iy

ldd ldd

Transfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then HL, DE, and BC are decremented. p/v is reset if BC becomes zero and set otherwise.

ldd

lddr lddr

Transfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then HL, DE, and BC are decremented. If BC is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing.

lddr

ldi ldi

Transfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then HL and DE are incremented and BC is decremented. p/v is reset if BC becomes zero and set otherwise.

ldi

ldir ldir

Transfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then HL and DE are incremented and BC is decremented. If BC is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing.

ldir

neg neg

The contents of A are negated (two's complement). Operation is the same as subtracting A from zero.

neg

nop nop

No operation is performed.

nop

or or r | or r,r' | or (rr) | or r,(rr) | or (ii+dd) | or r,(ii+dd) | or nn | or r,nn

Bitwise OR on A with B.

or b

Bitwise OR on A with C.

or c

Bitwise OR on A with D.

or d

Bitwise OR on A with E.

or e

Bitwise OR on A with H.

or h

Bitwise OR on A with L.

or l

Bitwise OR on A with (HL).

or (hl)

Bitwise OR on A with A.

or a

Bitwise OR on A with IXH.

or ixh

Bitwise OR on A with IXL.

or ixl

Bitwise OR on A with the value pointed to by IX plus dd.

or (ix+dd)

Bitwise OR on A with nn.

or nn

Bitwise OR on A with IYH.

or iyh

Bitwise OR on A with IYL.

or iyl

Bitwise OR on A with the value pointed to by IY plus dd.

or (iy+dd)

otdr otdr

B is decremented. A byte from the memory location pointed to by HL is written to the port at the 16-bit address contained in the BC register pair. Then HL is decremented. If B is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing. Note that the carry flag may be affected, contrary to documentation. Read More

otdr

otir otir

B is decremented. A byte from the memory location pointed to by HL is written to the port at the 16-bit address contained in the BC register pair. Then HL is incremented. If B is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing. Note that the carry flag may be affected, contrary to documentation. Read More

otir

out out (nn),r | out nn,r | out (rr),r | out (rr),0

The value of A is written to the port whose address is formed by A in the high bits and nn in the low bits.

out (nn),a

The value of B is written to the port at the 16-bit address contained in the BC register pair.

out (c),b

The value of C is written to the port at the 16-bit address contained in the BC register pair.

out (c),c

The value of D is written to the port at the 16-bit address contained in the BC register pair.

out (c),d

The value of E is written to the port at the 16-bit address contained in the BC register pair.

out (c),e

The value of H is written to the port at the 16-bit address contained in the BC register pair.

out (c),h

The value of L is written to the port at the 16-bit address contained in the BC register pair.

out (c),l

Outputs a zero (on NMOS Z80s) or 255 (on CMOS Z80s) to the port at the 16-bit address contained in the BC register pair. Read More

out (c),0

The value of A is written to the port at the 16-bit address contained in the BC register pair.

out (c),a

outd outd

B is decremented. A byte from the memory location pointed to by HL is written to the port at the 16-bit address contained in the BC register pair. Then HL is decremented. Note that the carry flag may be affected, contrary to documentation. Read More

outd

outi outi

B is decremented. A byte from the memory location pointed to by HL is written to the port at the 16-bit address contained in the BC register pair. Then HL is incremented. Note that the carry flag may be affected, contrary to documentation. Read More

outi

pop pop rr

The memory location pointed to by SP is stored into C and SP is incremented. The memory location pointed to by SP is stored into B and SP is incremented again.

pop bc

The memory location pointed to by SP is stored into E and SP is incremented. The memory location pointed to by SP is stored into D and SP is incremented again.

pop de

The memory location pointed to by SP is stored into IXL and SP is incremented. The memory location pointed to by SP is stored into IXH and SP is incremented again.

pop ix

The memory location pointed to by SP is stored into L and SP is incremented. The memory location pointed to by SP is stored into H and SP is incremented again.

pop hl

The memory location pointed to by SP is stored into F and SP is incremented. The memory location pointed to by SP is stored into A and SP is incremented again.

pop af

The memory location pointed to by SP is stored into IYL and SP is incremented. The memory location pointed to by SP is stored into IYH and SP is incremented again.

pop iy

push push rr

SP is decremented and B is stored into the memory location pointed to by SP. SP is decremented again and C is stored into the memory location pointed to by SP.

push bc

SP is decremented and D is stored into the memory location pointed to by SP. SP is decremented again and E is stored into the memory location pointed to by SP.

push de

SP is decremented and IXH is stored into the memory location pointed to by SP. SP is decremented again and IXL is stored into the memory location pointed to by SP.

push ix

SP is decremented and H is stored into the memory location pointed to by SP. SP is decremented again and L is stored into the memory location pointed to by SP.

push hl

SP is decremented and A is stored into the memory location pointed to by SP. SP is decremented again and F is stored into the memory location pointed to by SP.

push af

SP is decremented and IYH is stored into the memory location pointed to by SP. SP is decremented again and IYL is stored into the memory location pointed to by SP.

push iy

res res bit,r | res bit,(rr) | res bit,(ii+dd),r | res bit,(ii+dd)

Resets bit 0 of B.

res 0,b

Resets bit 0 of C.

res 0,c

Resets bit 0 of D.

res 0,d

Resets bit 0 of E.

res 0,e

Resets bit 0 of H.

res 0,h

Resets bit 0 of L.

res 0,l

Resets bit 0 of (HL).

res 0,(hl)

Resets bit 0 of A.

res 0,a

Resets bit 1 of B.

res 1,b

Resets bit 1 of C.

res 1,c

Resets bit 1 of D.

res 1,d

Resets bit 1 of E.

res 1,e

Resets bit 1 of H.

res 1,h

Resets bit 1 of L.

res 1,l

Resets bit 1 of (HL).

res 1,(hl)

Resets bit 1 of A.

res 1,a

Resets bit 2 of B.

res 2,b

Resets bit 2 of C.

res 2,c

Resets bit 2 of D.

res 2,d

Resets bit 2 of E.

res 2,e

Resets bit 2 of H.

res 2,h

Resets bit 2 of L.

res 2,l

Resets bit 2 of (HL).

res 2,(hl)

Resets bit 2 of A.

res 2,a

Resets bit 3 of B.

res 3,b

Resets bit 3 of C.

res 3,c

Resets bit 3 of D.

res 3,d

Resets bit 3 of E.

res 3,e

Resets bit 3 of H.

res 3,h

Resets bit 3 of L.

res 3,l

Resets bit 3 of (HL).

res 3,(hl)

Resets bit 3 of A.

res 3,a

Resets bit 4 of B.

res 4,b

Resets bit 4 of C.

res 4,c

Resets bit 4 of D.

res 4,d

Resets bit 4 of E.

res 4,e

Resets bit 4 of H.

res 4,h

Resets bit 4 of L.

res 4,l

Resets bit 4 of (HL).

res 4,(hl)

Resets bit 4 of A.

res 4,a

Resets bit 5 of B.

res 5,b

Resets bit 5 of C.

res 5,c

Resets bit 5 of D.

res 5,d

Resets bit 5 of E.

res 5,e

Resets bit 5 of H.

res 5,h

Resets bit 5 of L.

res 5,l

Resets bit 5 of (HL).

res 5,(hl)

Resets bit 5 of A.

res 5,a

Resets bit 6 of B.

res 6,b

Resets bit 6 of C.

res 6,c

Resets bit 6 of D.

res 6,d

Resets bit 6 of E.

res 6,e

Resets bit 6 of H.

res 6,h

Resets bit 6 of L.

res 6,l

Resets bit 6 of (HL).

res 6,(hl)

Resets bit 6 of A.

res 6,a

Resets bit 7 of B.

res 7,b

Resets bit 7 of C.

res 7,c

Resets bit 7 of D.

res 7,d

Resets bit 7 of E.

res 7,e

Resets bit 7 of H.

res 7,h

Resets bit 7 of L.

res 7,l

Resets bit 7 of (HL).

res 7,(hl)

Resets bit 7 of A.

res 7,a

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 0,(ix+dd),b

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 0,(ix+dd),c

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 0,(ix+dd),d

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 0,(ix+dd),e

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 0,(ix+dd),h

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 0,(ix+dd),l

Resets bit 0 of the memory location pointed to by IX plus dd.

res 0,(ix+dd)

Resets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 0,(ix+dd),a

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 1,(ix+dd),b

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 1,(ix+dd),c

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 1,(ix+dd),d

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 1,(ix+dd),e

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 1,(ix+dd),h

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 1,(ix+dd),l

Resets bit 1 of the memory location pointed to by IX plus dd.

res 1,(ix+dd)

Resets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 1,(ix+dd),a

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 2,(ix+dd),b

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 2,(ix+dd),c

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 2,(ix+dd),d

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 2,(ix+dd),e

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 2,(ix+dd),h

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 2,(ix+dd),l

Resets bit 2 of the memory location pointed to by IX plus dd.

res 2,(ix+dd)

Resets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 2,(ix+dd),a

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 3,(ix+dd),b

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 3,(ix+dd),c

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 3,(ix+dd),d

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 3,(ix+dd),e

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 3,(ix+dd),h

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 3,(ix+dd),l

Resets bit 3 of the memory location pointed to by IX plus dd.

res 3,(ix+dd)

Resets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 3,(ix+dd),a

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 4,(ix+dd),b

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 4,(ix+dd),c

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 4,(ix+dd),d

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 4,(ix+dd),e

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 4,(ix+dd),h

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 4,(ix+dd),l

Resets bit 4 of the memory location pointed to by IX plus dd.

res 4,(ix+dd)

Resets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 4,(ix+dd),a

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 5,(ix+dd),b

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 5,(ix+dd),c

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 5,(ix+dd),d

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 5,(ix+dd),e

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 5,(ix+dd),h

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 5,(ix+dd),l

Resets bit 5 of the memory location pointed to by IX plus dd.

res 5,(ix+dd)

Resets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 5,(ix+dd),a

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 6,(ix+dd),b

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 6,(ix+dd),c

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 6,(ix+dd),d

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 6,(ix+dd),e

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 6,(ix+dd),h

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 6,(ix+dd),l

Resets bit 6 of the memory location pointed to by IX plus dd.

res 6,(ix+dd)

Resets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 6,(ix+dd),a

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in B.

res 7,(ix+dd),b

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in C.

res 7,(ix+dd),c

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in D.

res 7,(ix+dd),d

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in E.

res 7,(ix+dd),e

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in H.

res 7,(ix+dd),h

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in L.

res 7,(ix+dd),l

Resets bit 7 of the memory location pointed to by IX plus dd.

res 7,(ix+dd)

Resets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in A.

res 7,(ix+dd),a

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 0,(iy+dd),b

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 0,(iy+dd),c

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 0,(iy+dd),d

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 0,(iy+dd),e

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 0,(iy+dd),h

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 0,(iy+dd),l

Resets bit 0 of the memory location pointed to by IY plus dd.

res 0,(iy+dd)

Resets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 0,(iy+dd),a

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 1,(iy+dd),b

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 1,(iy+dd),c

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 1,(iy+dd),d

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 1,(iy+dd),e

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 1,(iy+dd),h

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 1,(iy+dd),l

Resets bit 1 of the memory location pointed to by IY plus dd.

res 1,(iy+dd)

Resets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 1,(iy+dd),a

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 2,(iy+dd),b

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 2,(iy+dd),c

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 2,(iy+dd),d

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 2,(iy+dd),e

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 2,(iy+dd),h

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 2,(iy+dd),l

Resets bit 2 of the memory location pointed to by IY plus dd.

res 2,(iy+dd)

Resets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 2,(iy+dd),a

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 3,(iy+dd),b

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 3,(iy+dd),c

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 3,(iy+dd),d

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 3,(iy+dd),e

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 3,(iy+dd),h

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 3,(iy+dd),l

Resets bit 3 of the memory location pointed to by IY plus dd.

res 3,(iy+dd)

Resets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 3,(iy+dd),a

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 4,(iy+dd),b

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 4,(iy+dd),c

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 4,(iy+dd),d

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 4,(iy+dd),e

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 4,(iy+dd),h

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 4,(iy+dd),l

Resets bit 4 of the memory location pointed to by IY plus dd.

res 4,(iy+dd)

Resets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 4,(iy+dd),a

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 5,(iy+dd),b

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 5,(iy+dd),c

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 5,(iy+dd),d

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 5,(iy+dd),e

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 5,(iy+dd),h

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 5,(iy+dd),l

Resets bit 5 of the memory location pointed to by IY plus dd.

res 5,(iy+dd)

Resets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 5,(iy+dd),a

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 6,(iy+dd),b

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 6,(iy+dd),c

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 6,(iy+dd),d

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 6,(iy+dd),e

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 6,(iy+dd),h

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 6,(iy+dd),l

Resets bit 6 of the memory location pointed to by IY plus dd.

res 6,(iy+dd)

Resets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 6,(iy+dd),a

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in B.

res 7,(iy+dd),b

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in C.

res 7,(iy+dd),c

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in D.

res 7,(iy+dd),d

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in E.

res 7,(iy+dd),e

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in H.

res 7,(iy+dd),h

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in L.

res 7,(iy+dd),l

Resets bit 7 of the memory location pointed to by IY plus dd.

res 7,(iy+dd)

Resets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in A.

res 7,(iy+dd),a

ret ret cc | ret

If the zero flag is unset, the top stack entry is popped into PC.

ret nz

If the zero flag is set, the top stack entry is popped into PC.

ret z

The top stack entry is popped into PC.

ret

If the carry flag is unset, the top stack entry is popped into PC.

ret nc

If the carry flag is set, the top stack entry is popped into PC.

ret c

If the parity/overflow flag is unset, the top stack entry is popped into PC.

ret po

If the parity/overflow flag is set, the top stack entry is popped into PC.

ret pe

If the sign flag is unset, the top stack entry is popped into PC.

ret p

If the sign flag is set, the top stack entry is popped into PC.

ret m

reti reti

Used at the end of a maskable interrupt service routine. The top stack entry is popped into PC, and signals an I/O device that the interrupt has finished, allowing nested interrupts (not a consideration on the TI).

reti

retn retn

Used at the end of a non-maskable interrupt service routine (located at 0066h) to pop the top stack entry into PC. The value of IFF2 is copied to IFF1 so that maskable interrupts are allowed to continue as before. NMIs are not enabled on the TI.

retn

rl rl r | rl (rr) | rl (ii+dd),r | rl (ii+dd)

The contents of B are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl b

The contents of C are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl c

The contents of D are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl d

The contents of E are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl e

The contents of H are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl h

The contents of L are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl l

The contents of (HL) are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl (hl)

The contents of A are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl a

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in B.

rl (ix+dd),b

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in C.

rl (ix+dd),c

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in D.

rl (ix+dd),d

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in E.

rl (ix+dd),e

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in H.

rl (ix+dd),h

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in L.

rl (ix+dd),l

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl (ix+dd)

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in A.

rl (ix+dd),a

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in B.

rl (iy+dd),b

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in C.

rl (iy+dd),c

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in D.

rl (iy+dd),d

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in E.

rl (iy+dd),e

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in H.

rl (iy+dd),h

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in L.

rl (iy+dd),l

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rl (iy+dd)

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0. The result is then stored in A.

rl (iy+dd),a

rla rla

The contents of A are rotated left one bit position. The contents of bit 7 are copied to the carry flag and the previous contents of the carry flag are copied to bit 0.

rla

rlc rlc r | rlc (rr) | rlc (ii+dd),r | rlc (ii+dd)

The contents of B are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc b

The contents of C are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc c

The contents of D are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc d

The contents of E are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc e

The contents of H are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc h

The contents of L are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc l

The contents of (HL) are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc (hl)

The contents of A are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc a

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in B.

rlc (ix+dd),b

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in C.

rlc (ix+dd),c

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in D.

rlc (ix+dd),d

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in E.

rlc (ix+dd),e

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in H.

rlc (ix+dd),h

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in L.

rlc (ix+dd),l

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc (ix+dd)

The contents of the memory location pointed to by IX plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in A.

rlc (ix+dd),a

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in B.

rlc (iy+dd),b

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in C.

rlc (iy+dd),c

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in D.

rlc (iy+dd),d

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in E.

rlc (iy+dd),e

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in H.

rlc (iy+dd),h

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in L.

rlc (iy+dd),l

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlc (iy+dd)

The contents of the memory location pointed to by IY plus dd are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0. The result is then stored in A.

rlc (iy+dd),a

rlca rlca

The contents of A are rotated left one bit position. The contents of bit 7 are copied to the carry flag and bit 0.

rlca

rld rld

The contents of the low-order nibble of (HL) are copied to the high-order nibble of (HL). The previous contents are copied to the low-order nibble of A. The previous contents are copied to the low-order nibble of (HL).

rld

rr rr r | rr (rr) | rr (ii+dd),r | rr (ii+dd)

The contents of B are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr b

The contents of C are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr c

The contents of D are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr d

The contents of E are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr e

The contents of H are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr h

The contents of L are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr l

The contents of (HL) are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr (hl)

The contents of A are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr a

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in B.

rr (ix+dd),b

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in C.

rr (ix+dd),c

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in D.

rr (ix+dd),d

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in E.

rr (ix+dd),e

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in H.

rr (ix+dd),h

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in L.

rr (ix+dd),l

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr (ix+dd)

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in A.

rr (ix+dd),a

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in B.

rr (iy+dd),b

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in C.

rr (iy+dd),c

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in D.

rr (iy+dd),d

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in E.

rr (iy+dd),e

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in H.

rr (iy+dd),h

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in L.

rr (iy+dd),l

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rr (iy+dd)

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7. The result is then stored in A.

rr (iy+dd),a

rra rra

The contents of A are rotated right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of the carry flag are copied to bit 7.

rra

rrc rrc r | rrc (rr) | rrc (ii+dd),r | rrc (ii+dd)

The contents of B are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc b

The contents of C are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc c

The contents of D are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc d

The contents of E are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc e

The contents of H are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc h

The contents of L are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc l

The contents of (HL) are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc (hl)

The contents of A are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc a

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in B.

rrc (ix+dd),b

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in C.

rrc (ix+dd),c

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in D.

rrc (ix+dd),d

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in E.

rrc (ix+dd),e

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in H.

rrc (ix+dd),h

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in L.

rrc (ix+dd),l

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc (ix+dd)

The contents of the memory location pointed to by IX plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in A.

rrc (ix+dd),a

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in B.

rrc (iy+dd),b

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in C.

rrc (iy+dd),c

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in D.

rrc (iy+dd),d

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in E.

rrc (iy+dd),e

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in H.

rrc (iy+dd),h

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in L.

rrc (iy+dd),l

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrc (iy+dd)

The contents of the memory location pointed to by IY plus dd are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7. The result is then stored in A.

rrc (iy+dd),a

rrca rrca

The contents of A are rotated right one bit position. The contents of bit 0 are copied to the carry flag and bit 7.

rrca

rrd rrd

The contents of the low-order nibble of (HL) are copied to the low-order nibble of A. The previous contents are copied to the high-order nibble of (HL). The previous contents are copied to the low-order nibble of (HL).

rrd

rst rst 00 | rst 08 | rst 10 | rst 18 | rst 20 | rst 28 | rst 30 | rst 38

The current PC value plus one is pushed onto the stack, then is loaded with 0.

rst 00

The current PC value plus one is pushed onto the stack, then is loaded with 8.

rst 08

The current PC value plus one is pushed onto the stack, then is loaded with 16.

rst 10

The current PC value plus one is pushed onto the stack, then is loaded with 24.

rst 18

The current PC value plus one is pushed onto the stack, then is loaded with 32.

rst 20

The current PC value plus one is pushed onto the stack, then is loaded with 40.

rst 28

The current PC value plus one is pushed onto the stack, then is loaded with 48.

rst 30

The current PC value plus one is pushed onto the stack, then is loaded with 56.

rst 38

sbc sbc r,r' | sbc r | sbc r,(rr) | sbc (rr) | sbc r,(ii+dd) | sbc (ii+dd) | sbc r,nn | sbc nn | sbc rr,rr'

Subtracts B and the carry flag from A.

sbc a,b

Subtracts C and the carry flag from A.

sbc a,c

Subtracts D and the carry flag from A.

sbc a,d

Subtracts E and the carry flag from A.

sbc a,e

Subtracts H and the carry flag from A.

sbc a,h

Subtracts L and the carry flag from A.

sbc a,l

Subtracts (HL) and the carry flag from A.

sbc a,(hl)

Subtracts A and the carry flag from A.

sbc a,a

Subtracts IXH and the carry flag from A.

sbc a,ixh

Subtracts IXL and the carry flag from A.

sbc a,ixl

Subtracts the value pointed to by IX plus dd and the carry flag from A.

sbc a,(ix+dd)

Subtracts nn and the carry flag from A.

sbc a,nn

Subtracts BC and the carry flag from HL.

sbc hl,bc

Subtracts DE and the carry flag from HL.

sbc hl,de

Subtracts HL and the carry flag from HL.

sbc hl,hl

Subtracts SP and the carry flag from HL.

sbc hl,sp

Subtracts IYH and the carry flag from A.

sbc a,iyh

Subtracts IYL and the carry flag from A.

sbc a,iyl

Subtracts the value pointed to by IY plus dd and the carry flag from A.

sbc a,(iy+dd)

scf scf

Sets the carry flag.

scf

set set bit,r | set bit,(rr) | set bit,(ii+dd),r | set bit,(ii+dd)

Sets bit 0 of B.

set 0,b

Sets bit 0 of C.

set 0,c

Sets bit 0 of D.

set 0,d

Sets bit 0 of E.

set 0,e

Sets bit 0 of H.

set 0,h

Sets bit 0 of L.

set 0,l

Sets bit 0 of (HL).

set 0,(hl)

Sets bit 0 of A.

set 0,a

Sets bit 1 of B.

set 1,b

Sets bit 1 of C.

set 1,c

Sets bit 1 of D.

set 1,d

Sets bit 1 of E.

set 1,e

Sets bit 1 of H.

set 1,h

Sets bit 1 of L.

set 1,l

Sets bit 1 of (HL).

set 1,(hl)

Sets bit 1 of A.

set 1,a

Sets bit 2 of B.

set 2,b

Sets bit 2 of C.

set 2,c

Sets bit 2 of D.

set 2,d

Sets bit 2 of E.

set 2,e

Sets bit 2 of H.

set 2,h

Sets bit 2 of L.

set 2,l

Sets bit 2 of (HL).

set 2,(hl)

Sets bit 2 of A.

set 2,a

Sets bit 3 of B.

set 3,b

Sets bit 3 of C.

set 3,c

Sets bit 3 of D.

set 3,d

Sets bit 3 of E.

set 3,e

Sets bit 3 of H.

set 3,h

Sets bit 3 of L.

set 3,l

Sets bit 3 of (HL).

set 3,(hl)

Sets bit 3 of A.

set 3,a

Sets bit 4 of B.

set 4,b

Sets bit 4 of C.

set 4,c

Sets bit 4 of D.

set 4,d

Sets bit 4 of E.

set 4,e

Sets bit 4 of H.

set 4,h

Sets bit 4 of L.

set 4,l

Sets bit 4 of (HL).

set 4,(hl)

Sets bit 4 of A.

set 4,a

Sets bit 5 of B.

set 5,b

Sets bit 5 of C.

set 5,c

Sets bit 5 of D.

set 5,d

Sets bit 5 of E.

set 5,e

Sets bit 5 of H.

set 5,h

Sets bit 5 of L.

set 5,l

Sets bit 5 of (HL).

set 5,(hl)

Sets bit 5 of A.

set 5,a

Sets bit 6 of B.

set 6,b

Sets bit 6 of C.

set 6,c

Sets bit 6 of D.

set 6,d

Sets bit 6 of E.

set 6,e

Sets bit 6 of H.

set 6,h

Sets bit 6 of L.

set 6,l

Sets bit 6 of (HL).

set 6,(hl)

Sets bit 6 of A.

set 6,a

Sets bit 7 of B.

set 7,b

Sets bit 7 of C.

set 7,c

Sets bit 7 of D.

set 7,d

Sets bit 7 of E.

set 7,e

Sets bit 7 of H.

set 7,h

Sets bit 7 of L.

set 7,l

Sets bit 7 of (HL).

set 7,(hl)

Sets bit 7 of A.

set 7,a

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 0,(ix+dd),b

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 0,(ix+dd),c

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 0,(ix+dd),d

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 0,(ix+dd),e

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 0,(ix+dd),h

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 0,(ix+dd),l

Sets bit 0 of the memory location pointed to by IX plus dd.

set 0,(ix+dd)

Sets bit 0 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 0,(ix+dd),a

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 1,(ix+dd),b

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 1,(ix+dd),c

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 1,(ix+dd),d

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 1,(ix+dd),e

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 1,(ix+dd),h

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 1,(ix+dd),l

Sets bit 1 of the memory location pointed to by IX plus dd.

set 1,(ix+dd)

Sets bit 1 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 1,(ix+dd),a

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 2,(ix+dd),b

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 2,(ix+dd),c

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 2,(ix+dd),d

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 2,(ix+dd),e

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 2,(ix+dd),h

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 2,(ix+dd),l

Sets bit 2 of the memory location pointed to by IX plus dd.

set 2,(ix+dd)

Sets bit 2 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 2,(ix+dd),a

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 3,(ix+dd),b

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 3,(ix+dd),c

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 3,(ix+dd),d

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 3,(ix+dd),e

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 3,(ix+dd),h

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 3,(ix+dd),l

Sets bit 3 of the memory location pointed to by IX plus dd.

set 3,(ix+dd)

Sets bit 3 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 3,(ix+dd),a

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 4,(ix+dd),b

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 4,(ix+dd),c

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 4,(ix+dd),d

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 4,(ix+dd),e

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 4,(ix+dd),h

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 4,(ix+dd),l

Sets bit 4 of the memory location pointed to by IX plus dd.

set 4,(ix+dd)

Sets bit 4 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 4,(ix+dd),a

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 5,(ix+dd),b

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 5,(ix+dd),c

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 5,(ix+dd),d

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 5,(ix+dd),e

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 5,(ix+dd),h

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 5,(ix+dd),l

Sets bit 5 of the memory location pointed to by IX plus dd.

set 5,(ix+dd)

Sets bit 5 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 5,(ix+dd),a

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 6,(ix+dd),b

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 6,(ix+dd),c

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 6,(ix+dd),d

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 6,(ix+dd),e

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 6,(ix+dd),h

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 6,(ix+dd),l

Sets bit 6 of the memory location pointed to by IX plus dd.

set 6,(ix+dd)

Sets bit 6 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 6,(ix+dd),a

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in B.

set 7,(ix+dd),b

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in C.

set 7,(ix+dd),c

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in D.

set 7,(ix+dd),d

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in E.

set 7,(ix+dd),e

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in H.

set 7,(ix+dd),h

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in L.

set 7,(ix+dd),l

Sets bit 7 of the memory location pointed to by IX plus dd.

set 7,(ix+dd)

Sets bit 7 of the memory location pointed to by IX plus dd. The result is then stored in A.

set 7,(ix+dd),a

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 0,(iy+dd),b

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 0,(iy+dd),c

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 0,(iy+dd),d

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 0,(iy+dd),e

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 0,(iy+dd),h

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 0,(iy+dd),l

Sets bit 0 of the memory location pointed to by IY plus dd.

set 0,(iy+dd)

Sets bit 0 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 0,(iy+dd),a

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 1,(iy+dd),b

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 1,(iy+dd),c

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 1,(iy+dd),d

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 1,(iy+dd),e

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 1,(iy+dd),h

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 1,(iy+dd),l

Sets bit 1 of the memory location pointed to by IY plus dd.

set 1,(iy+dd)

Sets bit 1 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 1,(iy+dd),a

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 2,(iy+dd),b

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 2,(iy+dd),c

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 2,(iy+dd),d

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 2,(iy+dd),e

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 2,(iy+dd),h

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 2,(iy+dd),l

Sets bit 2 of the memory location pointed to by IY plus dd.

set 2,(iy+dd)

Sets bit 2 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 2,(iy+dd),a

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 3,(iy+dd),b

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 3,(iy+dd),c

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 3,(iy+dd),d

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 3,(iy+dd),e

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 3,(iy+dd),h

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 3,(iy+dd),l

Sets bit 3 of the memory location pointed to by IY plus dd.

set 3,(iy+dd)

Sets bit 3 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 3,(iy+dd),a

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 4,(iy+dd),b

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 4,(iy+dd),c

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 4,(iy+dd),d

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 4,(iy+dd),e

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 4,(iy+dd),h

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 4,(iy+dd),l

Sets bit 4 of the memory location pointed to by IY plus dd.

set 4,(iy+dd)

Sets bit 4 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 4,(iy+dd),a

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 5,(iy+dd),b

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 5,(iy+dd),c

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 5,(iy+dd),d

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 5,(iy+dd),e

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 5,(iy+dd),h

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 5,(iy+dd),l

Sets bit 5 of the memory location pointed to by IY plus dd.

set 5,(iy+dd)

Sets bit 5 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 5,(iy+dd),a

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 6,(iy+dd),b

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 6,(iy+dd),c

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 6,(iy+dd),d

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 6,(iy+dd),e

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 6,(iy+dd),h

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 6,(iy+dd),l

Sets bit 6 of the memory location pointed to by IY plus dd.

set 6,(iy+dd)

Sets bit 6 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 6,(iy+dd),a

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in B.

set 7,(iy+dd),b

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in C.

set 7,(iy+dd),c

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in D.

set 7,(iy+dd),d

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in E.

set 7,(iy+dd),e

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in H.

set 7,(iy+dd),h

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in L.

set 7,(iy+dd),l

Sets bit 7 of the memory location pointed to by IY plus dd.

set 7,(iy+dd)

Sets bit 7 of the memory location pointed to by IY plus dd. The result is then stored in A.

set 7,(iy+dd),a

sla sla r | sla (rr) | sla (ii+dd),r | sla (ii+dd)

The contents of B are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla b

The contents of C are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla c

The contents of D are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla d

The contents of E are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla e

The contents of H are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla h

The contents of L are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla l

The contents of (HL) are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla (hl)

The contents of A are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla a

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in B.

sla (ix+dd),b

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in C.

sla (ix+dd),c

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in D.

sla (ix+dd),d

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in E.

sla (ix+dd),e

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in H.

sla (ix+dd),h

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in L.

sla (ix+dd),l

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla (ix+dd)

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in A.

sla (ix+dd),a

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in B.

sla (iy+dd),b

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in C.

sla (iy+dd),c

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in D.

sla (iy+dd),d

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in E.

sla (iy+dd),e

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in H.

sla (iy+dd),h

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in L.

sla (iy+dd),l

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0.

sla (iy+dd)

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are copied to the carry flag and a zero is put into bit 0. The result is then stored in A.

sla (iy+dd),a

sll sll r | sll (rr) | sll (ii+dd),r | sll (ii+dd)

The contents of B are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll b

The contents of C are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll c

The contents of D are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll d

The contents of E are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll e

The contents of H are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll h

The contents of L are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll l

The contents of (HL) are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll (hl)

The contents of A are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll a

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in B.

sll (ix+dd),b

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in C.

sll (ix+dd),c

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in D.

sll (ix+dd),d

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in E.

sll (ix+dd),e

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in H.

sll (ix+dd),h

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in L.

sll (ix+dd),l

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll (ix+dd)

The contents of the memory location pointed to by IX plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in A.

sll (ix+dd),a

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in B.

sll (iy+dd),b

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in C.

sll (iy+dd),c

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in D.

sll (iy+dd),d

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in E.

sll (iy+dd),e

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in H.

sll (iy+dd),h

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in L.

sll (iy+dd),l

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0.

sll (iy+dd)

The contents of the memory location pointed to by IY plus dd are shifted left one bit position. The contents of bit 7 are put into the carry flag and a one is put into bit 0. The result is then stored in A.

sll (iy+dd),a

sra sra r | sra (rr) | sra (ii+dd),r | sra (ii+dd)

The contents of B are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra b

The contents of C are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra c

The contents of D are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra d

The contents of E are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra e

The contents of H are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra h

The contents of L are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra l

The contents of (HL) are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra (hl)

The contents of A are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra a

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in B.

sra (ix+dd),b

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in C.

sra (ix+dd),c

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in D.

sra (ix+dd),d

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in E.

sra (ix+dd),e

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in H.

sra (ix+dd),h

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in L.

sra (ix+dd),l

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra (ix+dd)

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in A.

sra (ix+dd),a

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in B.

sra (iy+dd),b

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in C.

sra (iy+dd),c

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in D.

sra (iy+dd),d

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in E.

sra (iy+dd),e

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in H.

sra (iy+dd),h

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in L.

sra (iy+dd),l

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged.

sra (iy+dd)

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and the previous contents of bit 7 are unchanged. The result is then stored in A.

sra (iy+dd),a

srl srl r | srl (rr) | srl (ii+dd),r | srl (ii+dd)

The contents of B are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl b

The contents of C are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl c

The contents of D are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl d

The contents of E are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl e

The contents of H are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl h

The contents of L are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl l

The contents of (HL) are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl (hl)

The contents of A are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl a

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in B.

srl (ix+dd),b

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in C.

srl (ix+dd),c

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in D.

srl (ix+dd),d

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in E.

srl (ix+dd),e

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in H.

srl (ix+dd),h

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in L.

srl (ix+dd),l

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl (ix+dd)

The contents of the memory location pointed to by IX plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in A.

srl (ix+dd),a

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in B.

srl (iy+dd),b

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in C.

srl (iy+dd),c

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in D.

srl (iy+dd),d

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in E.

srl (iy+dd),e

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in H.

srl (iy+dd),h

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in L.

srl (iy+dd),l

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.

srl (iy+dd)

The contents of the memory location pointed to by IY plus dd are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored in A.

srl (iy+dd),a

sub sub r | sub r,r' | sub (rr) | sub r,(rr) | sub nn | sub r,nn | sub (ii+dd) | sub r,(ii+dd)

Subtracts B from A.

sub b

Subtracts C from A.

sub c

Subtracts D from A.

sub d

Subtracts E from A.

sub e

Subtracts H from A.

sub h

Subtracts L from A.

sub l

Subtracts (HL) from A.

sub (hl)

Subtracts A from A.

sub a

Subtracts nn from A.

sub nn

Subtracts IXH from A.

sub ixh

Subtracts IXL from A.

sub ixl

Subtracts the value pointed to by IX plus dd from A.

sub (ix+dd)

Subtracts IYH from A.

sub iyh

Subtracts IYL from A.

sub iyl

Subtracts the value pointed to by IY plus dd from A.

sub (iy+dd)

xor xor r | xor r,r' | xor (rr) | xor r,(rr) | xor (ii+dd) | xor r,(ii+dd) | xor nn | xor r,nn

Bitwise XOR on A with B.

xor b

Bitwise XOR on A with C.

xor c

Bitwise XOR on A with D.

xor d

Bitwise XOR on A with E.

xor e

Bitwise XOR on A with H.

xor h

Bitwise XOR on A with L.

xor l

Bitwise XOR on A with (HL).

xor (hl)

Bitwise XOR on A with A.

xor a

Bitwise XOR on A with IXH.

xor ixh

Bitwise XOR on A with IXL.

xor ixl

Bitwise XOR on A with the value pointed to by IX plus dd.

xor (ix+dd)

Bitwise XOR on A with nn.

xor nn

Bitwise XOR on A with IYH.

xor iyh

Bitwise XOR on A with IYL.

xor iyl

Bitwise XOR on A with the value pointed to by IY plus dd.

xor (iy+dd)

Directives

Directives are not executed by the CPU: they tell the assembler where to put the code, what data to emit, which names stand for which values, and when to expand a macro.

.title

Set the title of the program, as a string.

error

Force an error.

defb

Define a sequence of bytes, text, or strings.

Also written as db.db.bytedefmdm.dm.text.ascii.asciz

defw

Define a sequence of 16-bit words.

Also written as dw.dw.word

.long

Define a sequence of 32-bit longs.

equ

Assign a value to a symbol.

Also written as .equdefl=

org

Specify address of next instruction.

Also written as .org.loc

align

Add fill bytes until address is multiple of specified value.

Also written as .align

defs

Fill memory with repeated bytes.

Also written as ds.ds.block.blkbdatadc

macro

Start a macro definition.

Also written as .macro

endm

End a macro definition.

Also written as .endm

if

If conditional.

Also written as cond

else

Else conditional.

endif

End of if conditional.

Also written as endc

end

End of file, optionally followed by entry address or label.

#target

Specify whether targeting bin or rom.

#code

Start a new code segment.

#include

Include an assembly file or library directory.

#local

Start a local scope.

#endlocal

End a local scope.

#insert

Insert a binary file.

Registers & Flags

Registers

a 8 bit

Accumulator. The destination of every 8 bit arithmetic and logic instruction, and the only register that can be loaded from or stored to a bare address.

f 8 bit

Flags. Holds the sign, zero, half carry, parity/overflow, add/subtract and carry bits; it is read and written only as part of af (push af, pop af, ex af,af').

b 8 bit

General purpose register, and the counter used by djnz, the block instructions (ldir, cpir, …) and the (c) port instructions.

c 8 bit

General purpose register, and the port number used by in r,(c) and out (c),r.

d 8 bit

General purpose register, the high half of de.

e 8 bit

General purpose register, the low half of de.

h 8 bit

General purpose register, the high half of hl.

l 8 bit

General purpose register, the low half of hl.

af 16 bit

The accumulator and the flags as one 16 bit register. Only push, pop and ex af,af' use it as a pair.

bc 16 bit

The b and c registers as a pair. Used as a byte counter by the block instructions and as the port address by the (c) forms.

de 16 bit

The d and e registers as a pair. The destination pointer of the block copy instructions.

hl 16 bit

The h and l registers as a pair. The Z80's main pointer: (hl) can stand in for any 8 bit register operand, and add hl,rr is the only 16 bit addition.

ix 16 bit

Index register. Addressed as (ix+dd) with a signed 8 bit displacement, which costs an extra prefix byte and several clock cycles per access.

iy 16 bit

Index register, identical to ix but with its own prefix.

sp 16 bit

Stack pointer. push decrements it by two before writing, so the stack grows downwards; it starts at the top of memory.

pc 16 bit

Program counter: the address of the next instruction to execute.

af' 16 bit

The alternate accumulator and flags, swapped in by ex af,af'. Traditionally reserved for interrupt handlers.

bc' 16 bit

The alternate bc, swapped in by exx together with de' and hl'.

de' 16 bit

The alternate de, swapped in by exx.

hl' 16 bit

The alternate hl, swapped in by exx.

i 8 bit

Interrupt vector register: the high byte of the vector table address in interrupt mode 2. Nothing raises interrupts in this emulator.

r 8 bit

Memory refresh register. The low 7 bits increment on every instruction fetch, which is why it is sometimes used as a cheap random number.

ixh 8 bit undocumented

The high half of ix.

ixl 8 bit undocumented

The low half of ix.

iyh 8 bit undocumented

The high half of iy.

iyl 8 bit undocumented

The low half of iy.

Flags

The flags live in the F register, which is only reachable as the high half of af. Every arithmetic and logic instruction updates some of them; the instruction pages list which.

S bit 7

Sign: set when the result is negative (bit 7 of the result).

Z bit 6

Zero: set when the result is zero.

H bit 4

Half carry: carry from bit 3 to bit 4, used by daa for BCD arithmetic.

P/V bit 2

Parity/overflow: parity of the result for logical and rotate instructions (set when even), signed overflow for arithmetic instructions.

N bit 1

Add/subtract: set when the last operation was a subtraction, used by daa.

C bit 0

Carry: carry out of bit 7 (or 15), borrow for subtractions, and the bit shifted out by rotates and shifts.

Condition codes

Written after jp, call and ret to run them only when the flags say so, as in jp nz, loop. jr understands only the first four.

nz

Not zero: the Z flag is reset.

z

Zero: the Z flag is set.

nc

No carry: the C flag is reset.

c

Carry: the C flag is set. Not to be confused with the c register.

po

Parity odd / no overflow: the P/V flag is reset.

pe

Parity even / overflow: the P/V flag is set.

p

Plus: the S flag is reset, i.e. the result was not negative.

m

Minus: the S flag is set, i.e. the result was negative.

nv

No overflow: a synonym of po, kept for other assemblers.

v

Overflow: a synonym of pe, kept for other assemblers.

Operand placeholders

The instruction tables write operands with these placeholders: ld (ix+dd), nn is written in a program as ld (ix+2), 42.

nn

8 bit value: a number from 0 to 255 (or -128 to 127), a character constant, or a symbol.

nnnn

16 bit value or address, from 0 to 65535. Labels are 16 bit values.

dd

Signed 8 bit displacement, -128 to 127, added to ix or iy to form the address.

offset

Target of a relative jump. Write a label or an address: the assembler computes the -128 to 127 displacement and reports an error when the target is out of reach.

(hl)

The byte in memory at the address in hl. Usable wherever an 8 bit register is, at the cost of one extra memory access.

(ix+dd)

The byte in memory at ix plus the signed displacement, e.g. ld a,(ix+2). iy works the same way.

cc

A condition code, tested against the flags by jp, call, ret and (for the first four only) jr.

Input/Output

A Z80 has no system calls. Programs reach the outside world with in and out, which address one of 256 ports: out (n), a sends A to port n, in a, (n) reads a byte back. The (c) forms (out (c), r and in r, (c)) take the port number from C, which lets a program compute it, and put B on the high byte of the address bus, which is how a read carries a parameter: the key code, the mouse view, the byte of the clock, the length of a wait.

The emulator connects the ports below to the terminal, the screen, the keyboard, the mouse and the clock. Every other port behaves like an empty bus: writes are dropped and reads answer 0xFF. Reading a connected port with nothing to read pauses the program until there is something, so in never fails, it only waits.

Console 0x00 - 0x04

The Terminal: one port per output format, and the input reads that pause the program until a line (or a keystroke on the Screen) is available. What is printed here is also drawn at the Screen’s text cursor, in 8 by 8 cells.

0x00 Character

out

Prints the byte as a character (Latin-1) and draws it at the Screen’s text cursor. 0x0A prints a newline.

in

Returns the next character of the input line, pausing for input when the line has been consumed. The line ends with a newline character (0x0A). Once the program has touched a Screen, Keyboard or Mouse port the characters come from the focused Screen instead, one keystroke at a time, and are echoed at the text cursor.

        .org 0x8000
        ld hl, msg
loop:   ld a, (hl)
        or a
        jr z, done
        out (0), a
        inc hl
        jr loop
done:   halt
msg:    .asciz "Hello!", 10   ; 10 is the newline: strings keep \n literally
prints Hello!

0x01 Unsigned number

out

Prints the byte as an unsigned decimal number, 0 to 255.

in

Reads a line, parses it as a decimal number and returns its low byte. Stops the program with an error when the line is not a number.

        .org 0x8000
        in a, (1)       ; ask for a number
        add a, a        ; double it
        out (1), a      ; print it
        halt
input 21
prints 42

0x02 Signed number

out

Prints the byte as a signed decimal number, -128 to 127.

in

Same as the unsigned number port.

        .org 0x8000
        ld a, 5
        sub 10
        out (2), a
        halt
prints -5

0x03 Hexadecimal

out

Prints the byte as two upper case hexadecimal digits.

in

Reads a line, parses it as a hexadecimal number (0x, $ prefix or h suffix accepted) and returns its low byte.

        .org 0x8000
        ld a, 255
        out (3), a
        halt
prints FF

0x04 16 bit number

out

Prints the 16 bit number made of the high byte of the port address (register B when using out (c),r) and the byte written, as an unsigned decimal number.

in

Same as the unsigned number port.

        .org 0x8000
        ld hl, 1000
        ld b, h         ; high byte goes on the address bus
        ld c, 4         ; port number
        out (c), l      ; prints HL
        halt
prints 1000

Screen 0x10 - 0x1A

Drawing. Set the colors and the coordinates, then write one command to the command port; every coordinate is a byte, so the Screen is at most 256 by 256 pixels and is 256 by 192 until the program resizes it. Colors are one 3-3-2 byte.

Commands

Written to the command port, 0x17. One write runs one operation on the coordinates and colors already set.

0

One pixel at (X, Y) in the pen color. The pen width does not apply.

1

A line from (X, Y) to (X2, Y2) in the pen color, leaving the drawing position at (X2, Y2).

2

A line from the drawing position to (X, Y), which becomes the new position: a polyline costs one command per point.

3

Moves the drawing position to (X, Y) without drawing.

4

A rectangle from (X, Y) to (X2, Y2), filled with the fill color and outlined with the pen. The right and bottom edges are excluded, as they are in EASy68K.

5

The same rectangle, outline only.

6

The ellipse inscribed in that rectangle, filled and outlined like it.

7

The same ellipse, outline only.

8

Spreads the fill color from (X, Y) over every pixel of the color that was there, four ways.

9

Fills the whole Screen with the fill color, homes the text cursor, and adopts that color as the background, so scrolled text rows and a later resize match what is on screen.

10

Resizes the Screen to X by Y pixels and clears it; a coordinate of 0 means 256, the largest size a byte cannot hold.

11

Double buffering on: drawing goes to an off-screen copy of the visible image until PRESENT, so an animation never shows a half-drawn frame.

12

Double buffering off: drawing appears immediately. The off-screen image is dropped without being shown.

13

Shows the off-screen image. With double buffering off it only asks for a repaint.

Colors

A color is one byte: three bits of red in bits 7-5, three of green in bits 4-2 and two of blue in bits 1-0. Each field is stretched over the screen's eight bits by repeating it, so 0xFF is white and 0xE0 pure red.

0x00 black
0x03 blue
0x1C green
0x1F cyan
0xE0 red
0xE3 magenta
0xFC yellow
0xFF white
0xF0 orange
0x92 gray
0x49 dark gray

0x10 Pen color

out

Sets the color of pixels, lines, outlines and text, as one 3-3-2 byte (RRRGGGBB).

in

The current pen color, back in 3-3-2.

        .org 0x8000
        ld a, 0xE0      ; 111 000 00: pure red
        out (0x10), a   ; pen color
        ld a, 100
        out (0x13), a   ; X
        ld a, 50
        out (0x14), a   ; Y
        xor a           ; command 0: pixel
        out (0x17), a
        halt
shows one red pixel at (100, 50).

0x11 Fill color

out

Sets the color the inside of a filled shape, a flood fill and a clear use, as one 3-3-2 byte.

in

The current fill color, back in 3-3-2.

        .org 0x8000
        ld a, 0x1C      ; 000 111 00: pure green
        out (0x11), a   ; fill color
        ld a, 0xFF
        out (0x10), a   ; white pen for the outline
        ld a, 20
        out (0x13), a
        out (0x14), a   ; from (20, 20)
        ld a, 80
        out (0x15), a
        out (0x16), a   ; to (80, 80), right and bottom excluded
        ld a, 4         ; command 4: filled rectangle
        out (0x17), a
        halt
shows a green square with a white outline, 60 by 60 pixels, at (20, 20).

0x12 Pen width

out

Sets how many pixels wide lines and outlines are, at least 1. A width of 0 is read as 1.

in

The current pen width.

        .org 0x8000
        ld a, 5
        out (0x12), a   ; five pixels wide
        ld a, 10
        out (0x13), a
        out (0x14), a   ; from (10, 10)
        ld a, 200
        out (0x15), a
        ld a, 150
        out (0x16), a   ; to (200, 150)
        ld a, 1         ; command 1: line
        out (0x17), a
        halt
shows a thick white diagonal line across the Screen.

0x13 X

out

The first X coordinate: the pixel, the start of a line, the left edge of a shape, the width of a resize.

in

The byte last written.

        .org 0x8000
        ld a, 128
        out (0x13), a
        ld a, 96
        out (0x14), a   ; (128, 96), the middle of the default Screen
        ld a, 3         ; command 3: move to
        out (0x17), a
        ld a, 200
        out (0x13), a
        ld a, 20
        out (0x14), a
        ld a, 2         ; command 2: line to
        out (0x17), a
        halt
shows a line from the middle of the Screen to (200, 20).

0x14 Y

out

The first Y coordinate, the companion of the X port, and the height of a resize.

in

The byte last written.

0x15 X2

out

The second X coordinate: the end of a line, the right edge of a shape. Unused by the one-point commands.

in

The byte last written.

0x16 Y2

out

The second Y coordinate, the companion of the X2 port.

in

The byte last written.

0x17 Command

out

Runs one drawing operation on the coordinates, colors and pen width already set. The commands are listed above.

in

The number of the last command run, 0 before the first one.

        .org 0x8000
        ld a, 0x03      ; 000 000 11: pure blue
        out (0x11), a   ; fill color
        ld a, 9         ; command 9: clear to the fill color
        out (0x17), a
        ld a, 0xFC      ; 111 111 00: yellow
        out (0x11), a
        ld a, 60
        out (0x13), a
        ld a, 40
        out (0x14), a
        ld a, 196
        out (0x15), a
        ld a, 152
        out (0x16), a
        ld a, 6         ; command 6: filled ellipse
        out (0x17), a
        halt
shows a yellow ellipse with a white outline on a blue Screen.

0x18 Pixel color

out

Ignored: the pixel is drawn with command 0, in the pen color.

in

The color of the pixel at (X, Y) as a 3-3-2 byte, read from the image being drawn on — the off-screen one while double buffering. Outside the Screen it reads as the background color.

        .org 0x8000
        ld a, 0xE0
        out (0x10), a   ; red pen
        ld a, 8
        out (0x13), a
        out (0x14), a   ; (8, 8)
        xor a           ; command 0: pixel
        out (0x17), a
        in a, (0x18)    ; read the color back
        out (3), a      ; print it as hexadecimal
        halt
prints E0

0x19 Text cursor column

out

Moves the text cursor to a column, in 8 by 8 character cells: 0 to 31 on the default Screen. Out of range values are clamped.

in

The column the text cursor is on.

        .org 0x8000
        ld a, 12
        out (0x19), a   ; column 12
        ld a, 8
        out (0x1A), a   ; row 8
        ld hl, msg
loop:   ld a, (hl)
        or a
        jr z, done
        out (0), a      ; the character port draws at the cursor
        inc hl
        jr loop
done:   halt
msg:    .asciz "HELLO"
prints HELLO
shows the same text on the Screen, at the eighth row.

0x1A Text cursor row

out

Moves the text cursor to a row, in 8 by 8 character cells: 0 to 23 on the default Screen. Out of range values are clamped.

in

The row the text cursor is on. Text scrolls the whole Screen up one cell row at the bottom, graphics included.

Keyboard 0x20 - 0x23

Input from the focused Screen, polled: whether a typed character is waiting (read it from the character port), whether a given key is held, and the last key pressed and released. Key codes are EASy68K’s, the same table every environment here uses: letters and digits are the ASCII code of their capital, 0x25 to 0x28 are the arrows left, up, right and down, 0x20 is the space bar and 0x0D is Enter.

0x20 Typed input available

out

Ignored.

in

1 when a character typed on the focused Screen is waiting to be read from the character port, else 0. During a testcase it answers for the scripted input instead, so a program that polls before reading works in both.

        .org 0x8000
wait:   in a, (0x20)    ; anything typed?
        or a
        jr z, wait      ; poll until there is
        in a, (0x00)    ; take the character
        out (0x00), a   ; print it
        halt
input hi
shows the first character typed on the Screen, echoed back. Click the Screen first: that is where the keys go.

0x21 Key state

out

Ignored.

in

1 while the key whose code is in B is held down, else 0. This is how a game reads WASD or the arrows: it never consumes anything, and a key held over several reads answers 1 every time.

        .org 0x8000
        ld c, 0x21      ; the key state port
        ld b, 0x27      ; the right arrow
wait:   in a, (c)
        or a
        jr z, wait      ; poll until it is held
        ld a, 'R'
        out (0), a
        halt
shows an R printed once the right arrow is held down on the focused Screen.

0x22 Last key pressed

out

Ignored.

in

The code of the last key pressed on the Screen, 0 before the first press. It persists, so a program that polls slowly still sees the key.

        .org 0x8000
loop:   in a, (0x22)    ; the last key pressed
        or a
        jr z, loop
        out (3), a      ; print its code in hexadecimal
        halt
shows the code of the first key pressed on the focused Screen, in hexadecimal.

0x23 Last key released

out

Ignored.

in

The code of the last key released, 0 before the first release. With the last-pressed port it is the pair EASy68K’s task 19 answers with.

Mouse 0x30 - 0x33

Pointing input over the Screen, polled, in the same logical pixels drawing uses. B selects which of the three views a read answers with: the current state, the state at the last button release, or the state at the last button press.

Views

Put one of these in B before reading a mouse port.

0 the pointer and the buttons right now
1 the state at the last button release
2 the state at the last button press, with the double-click flag

0x30 Mouse X

out

Ignored.

in

The X of the view selected by B (0 current, 1 last release, 2 last press), in logical Screen pixels from the left edge, independently of how the panel is zoomed.

        .org 0x8000
        ld c, 0x32      ; the buttons port
        ld b, 0         ; view 0: the current state
wait:   in a, (c)
        and 1           ; the left button
        jr z, wait
        ld c, 0x30
        in a, (c)       ; X
        out (1), a
        ld a, ','
        out (0), a
        ld c, 0x31
        in a, (c)       ; Y
        out (1), a
        halt
shows the pointer position printed as "x,y" as soon as the left button is held over the Screen.

0x31 Mouse Y

out

Ignored.

in

The Y of the view selected by B, in logical Screen pixels from the top edge.

0x32 Mouse buttons

out

Ignored.

in

The buttons and modifiers of the view selected by B: bit 0 left, bit 1 right, bit 2 middle, bit 3 the double-click flag (only in the last-press view), bit 4 Shift, bit 5 Alt, bit 6 Ctrl.

0x33 Mouse event count

out

Ignored.

in

For the current view, how many mouse events have happened, as a byte that wraps around; for the two snapshot views, the count at the moment of the snapshot, 0 when it has not happened yet. Comparing it with the previous read is how a program tells a new click from the one it already handled.

Program time 0x40 - 0x42

Waiting and elapsed time. A wait and a frame sync are reads that suspend the program without blocking the editor: the machine re-executes the in when the time has passed, so Stop still answers and the Screen still repaints. Testcases run on a virtual clock, where waits complete at once and time starts at zero.

0x40 Wait

out

Ignored.

in

Waits B hundredths of a second, then answers 0. The editor stays responsive and Stop still works: the machine simply re-executes the in when the time is up. In a testcase the wait completes at once.

        .org 0x8000
        ld c, 0x40
        ld b, 25        ; a quarter of a second
        in a, (c)
        ld a, '!'
        out (0), a
        halt
prints !

0x41 Frame sync

out

Ignored.

in

Waits for the next animation frame, then answers 0. One read per frame is how an animation runs at the display’s own pace instead of as fast as the host can go; with double buffering, present the frame first and sync afterwards.

        .org 0x8000
        ld b, 10        ; ten frames
loop:   push bc
        in a, (0x41)    ; wait for the next frame
        ld a, '.'
        out (0), a
        pop bc
        djnz loop
        halt
prints ..........

0x42 Elapsed time

out

Ignored.

in

One byte of the number of hundredths of a second since the run started, selected by B: 0 the lowest byte, 3 the highest. A testcase reads a virtual clock that starts at zero and only moves when the program waits, so a test is reproducible.

        .org 0x8000
        ld c, 0x40
        ld b, 10        ; wait a tenth of a second
        in a, (c)
        ld c, 0x42
        ld b, 0         ; the lowest byte of the elapsed hundredths
        in a, (c)
        out (1), a
        halt
shows the hundredths of a second the program has been running, about 10.