Wishlist of extended instructions for the Z80 ============================================= mdfs.net/Docs/Comp/Z80/WishLong J.G.Harston - 26-Jun-2004 Sometime in about 1985 or 1986, Greg Heslington and I put together a list of additional instructions that it would be useful if the Z80 had, mainly by treating all the Z80's registers are completely generic registers. All 16-bit registers treated as completely generic registers, AF, BC, DE, HL, IX, IY, SP, PC. Any 16-bit register usable for any 16-bit operation including as an index register, any 8-bit half of any 16-bit register usable for any 8-bit operation. We worked out that almost all of them could be actually assembled to Z80 code by an assembler that understood the additional instructions, for instance, by defining macros. 8-bit data movement ------------------- LD A,A LD A,F LD A,B LD A,C LD A,D LD A,E LD F,A LD F,F LD F,B LD F,C LD F,D LD F,E LD B,A LD B,F LD B,B LD B,C LD B,D LD B,E LD C,A LD C,F LD C,B LD C,C LD C,D LD C,E LD D,A LD D,F LD D,B LD D,C LD D,D LD D,E LD E,A LD E,F LD E,B LD E,C LD E,D LD E,E LD H,A LD H,F LD H,B LD H,C LD H,D LD H,E LD L,A LD L,F LD L,B LD L,C LD L,D LD L,E LD IXL,A LD IXL,F LD IXL,B LD IXL,C LD IXL,D LD IXL,E LD IXH,A LD IXH,F LD IXH,B LD IXH,C LD IXH,D LD IXH,E LD IYL,A LD IYL,F LD IYL,B LD IYL,C LD IYL,D LD IYL,E LD IYH,A LD IYH,F LD IYH,B LD IYH,C LD IYH,D LD IYH,E LD A,H LD A,L LD A,IXL LD A,IXH LD A,IYL LD A,IYH LD F,H LD F,L LD F,IXL LD F,IXH LD F,IYL LD F,IYH LD B,H LD B,L LD B,IXL LD B,IXH LD B,IYL LD B,IYH LD C,H LD C,L LD C,IXL LD C,IXH LD C,IYL LD C,IYH LD D,H LD D,L LD D,IXL LD D,IXH LD D,IYL LD D,IYH LD E,H LD E,L LD E,IXL LD E,IXH LD E,IYL LD E,IYH LD H,H LD H,L LD H,IXL LD H,IXH LD H,IYL LD H,IYH LD L,H LD L,L LD L,IXL LD L,IXH LD L,IYL LD L,IYH LD IXL,H LD IXL,L LD IXL,IXL LD IXL,IXH LD IXL,IYL LD IXL,IYH LD IXH,H LD IXH,L LD IXH,IXL LD IXH,IXH LD IXH,IYL LD IXH,IYH LD IYL,H LD IYL,L LD IYL,IXL LD IYL,IXH LD IYL,IYL LD IYL,IYH LD IYH,H LD IYH,L LD IYH,IXL LD IYH,IXH LD IYH,IYL LD IYH,IYH LD A,nn LD F,nn LD B,nn LD C,nn LD D,nn LD E,nn LD H,nn LD L,nn LD IXL,nn LD IXH,nn LD IYL,nn LD IYH,nn LD A,(AF+nn) LD A,(BC+nn) LD A,(DE+nn) LD A,(HL+nn) LD F,(AF+nn) LD F,(BC+nn) LD F,(DE+nn) LD F,(HL+nn) LD B,(AF+nn) LD B,(BC+nn) LD B,(DE+nn) LD B,(HL+nn) LD C,(AF+nn) LD C,(BC+nn) LD C,(DE+nn) LD C,(HL+nn) LD D,(AF+nn) LD D,(BC+nn) LD D,(DE+nn) LD D,(HL+nn) LD E,(AF+nn) LD E,(BC+nn) LD E,(DE+nn) LD E,(HL+nn) LD H,(AF+nn) LD H,(BC+nn) LD H,(DE+nn) LD H,(HL+nn) LD L,(AF+nn) LD L,(BC+nn) LD L,(DE+nn) LD L,(HL+nn) LD IXL,(AF+nn) LD IXL,(BC+nn) LD IXL,(DE+nn) LD IXL,(HL+nn) LD IXH,(AF+nn) LD IXH,(BC+nn) LD IXH,(DE+nn) LD IXH,(HL+nn) LD IYL,(AF+nn) LD IYL,(BC+nn) LD IYL,(DE+nn) LD IYL,(HL+nn) LD IYH,(AF+nn) LD IYH,(BC+nn) LD IYH,(DE+nn) LD IYH,(HL+nn) LD A,(IX+nn) LD A,(IY+nn) LD A,(SP+nn) LD A,(PC+nn) LD F,(IX+nn) LD F,(IY+nn) LD F,(SP+nn) LD F,(PC+nn) LD B,(IX+nn) LD B,(IY+nn) LD B,(SP+nn) LD B,(PC+nn) LD C,(IX+nn) LD C,(IY+nn) LD C,(SP+nn) LD C,(PC+nn) LD D,(IX+nn) LD D,(IY+nn) LD D,(SP+nn) LD D,(PC+nn) LD E,(IX+nn) LD E,(IY+nn) LD E,(SP+nn) LD E,(PC+nn) LD H,(IX+nn) LD H,(IY+nn) LD H,(SP+nn) LD H,(PC+nn) LD L,(IX+nn) LD L,(IY+nn) LD L,(SP+nn) LD L,(PC+nn) LD IXL,(IX+nn) LD IXL,(IY+nn) LD IXL,(SP+nn) LD IXL,(PC+nn) LD IXH,(IX+nn) LD IXH,(IY+nn) LD IXH,(SP+nn) LD IXH,(PC+nn) LD IYL,(IX+nn) LD IYL,(IY+nn) LD IYL,(SP+nn) LD IYL,(PC+nn) LD IYH,(IX+nn) LD IYH,(IY+nn) LD IYH,(SP+nn) LD IYH,(PC+nn) LD (AF+nn),A LD (BC+nn),A LD (DE+nn),A LD (HL+nn),A LD (AF+nn),F LD (BC+nn),F LD (DE+nn),F LD (HL+nn),F LD (AF+nn),B LD (BC+nn),B LD (DE+nn),B LD (HL+nn),B LD (AF+nn),C LD (BC+nn),C LD (DE+nn),C LD (HL+nn),C LD (AF+nn),D LD (BC+nn),D LD (DE+nn),D LD (HL+nn),D LD (AF+nn),E LD (BC+nn),E LD (DE+nn),E LD (HL+nn),E LD (AF+nn),H LD (BC+nn),H LD (DE+nn),H LD (HL+nn),H LD (AF+nn),L LD (BC+nn),L LD (DE+nn),L LD (HL+nn),L LD (AF+nn),IXL LD (BC+nn),IXL LD (DE+nn),IXL LD (HL+nn),IXL LD (AF+nn),IXH LD (BC+nn),IXH LD (DE+nn),IXH LD (HL+nn),IXH LD (AF+nn),IYL LD (BC+nn),IYL LD (DE+nn),IYL LD (HL+nn),IYL LD (AF+nn),IYH LD (BC+nn),IYH LD (DE+nn),IYH LD (HL+nn),IYH LD (IX+nn),A LD (IY+nn),A LD (SP+nn),A LD (PC+nn),A LD (IX+nn),F LD (IY+nn),F LD (SP+nn),F LD (PC+nn),F LD (IX+nn),B LD (IY+nn),B LD (SP+nn),B LD (PC+nn),B LD (IX+nn),C LD (IY+nn),C LD (SP+nn),C LD (PC+nn),C LD (IX+nn),D LD (IY+nn),D LD (SP+nn),D LD (PC+nn),D LD (IX+nn),E LD (IY+nn),E LD (SP+nn),E LD (PC+nn),E LD (IX+nn),H LD (IY+nn),H LD (SP+nn),H LD (PC+nn),H LD (IX+nn),L LD (IY+nn),L LD (SP+nn),L LD (PC+nn),L LD (IX+nn),IXL LD (IY+nn),IXL LD (SP+nn),IXL LD (PC+nn),IXL LD (IX+nn),IXH LD (IY+nn),IXH LD (SP+nn),IXH LD (PC+nn),IXH LD (IX+nn),IYL LD (IY+nn),IYL LD (SP+nn),IYL LD (PC+nn),IYL LD (IX+nn),IYH LD (IY+nn),IYH LD (SP+nn),IYH LD (PC+nn),IYH LD A,(nnnn) LD F,(nnnn) LD B,(nnnn) LD C,(nnnn) LD D,(nnnn) LD E,(nnnn) LD H,(nnnn) LD L,(nnnn) LD IXL,(nnnn) LD IXH,(nnnn) LD IYL,(nnnn) LD IYH,(nnnn) LD (nnnn),A LD (nnnn),F LD (nnnn),B LD (nnnn),C LD (nnnn),D LD (nnnn),E LD (nnnn),H LD (nnnn),L LD (nnnn),IXL LD (nnnn),IXH LD (nnnn),IYL LD (nnnn),IYH 16-bit data movement -------------------- LD AF,AF LD AF,BC LD AF,DE LD AF,HL LD AF,IX LD AF,IY LD AF,SP LD AF,PC LD BC,AF LD BC,BC LD BC,DE LD BC,HL LD BC,IX LD BC,IY LD BC,SP LD BC,PC LD DE,AF LD DE,BC LD DE,DE LD DE,HL LD DE,IX LD DE,IY LD DE,SP LD DE,PC LD HL,AF LD HL,BC LD HL,DE LD HL,HL LD HL,IX LD HL,IY LD HL,SP LD HL,PC LD IX,AF LD IX,BC LD IX,DE LD IX,HL LD IX,IX LD IX,IY LD IX,SP LD IX,PC LD IY,AF LD IY,BC LD IY,DE LD IY,HL LD IY,IX LD IY,IY LD IY,SP LD IY,PC LD SP,AF LD SP,BC LD SP,DE LD SP,HL LD SP,IX LD SP,IY LD SP,SP LD SP,PC LD PC,AF LD PC,BC LD PC,DE LD PC,HL LD PC,IX LD PC,IY LD PC,SP LD PC,PC LD AF,nnnn LD BC,nnnn LD DE,nnnn LD HL,nnnn LD IX,nnnn LD IY,nnnn LD SP,nnnn LD PC,nnnn LD AF,(nnnn) LD BC,(nnnn) LD DE,(nnnn) LD HL,(nnnn) LD IX,(nnnn) LD IY,(nnnn) LD SP,(nnnn) LD PC,(nnnn) LD (nnnn),AF LD (nnnn),BC LD (nnnn),DE LD (nnnn),HL LD (nnnn),IX LD (nnnn),IY LD (nnnn),SP LD (nnnn),PC LD AF,(AF+nn) LD AF,(BC+nn) LD AF,(DE+nn) LD AF,(HL+nn) LD BC,(AF+nn) LD BC,(BC+nn) LD BC,(DE+nn) LD BC,(HL+nn) LD DE,(AF+nn) LD DE,(BC+nn) LD DE,(DE+nn) LD DE,(HL+nn) LD HL,(AF+nn) LD HL,(BC+nn) LD HL,(DE+nn) LD HL,(HL+nn) LD IX,(AF+nn) LD IX,(BC+nn) LD IX,(DE+nn) LD IX,(HL+nn) LD IY,(AF+nn) LD IY,(BC+nn) LD IY,(DE+nn) LD IY,(HL+nn) LD SP,(AF+nn) LD SP,(BC+nn) LD SP,(DE+nn) LD SP,(HL+nn) LD PC,(AF+nn) LD PC,(BC+nn) LD PC,(DE+nn) LD PC,(HL+nn) LD AF,(IX+nn) LD AF,(IY+nn) LD AF,(SP+nn) LD AF,(PC+nn) LD BC,(IX+nn) LD BC,(IY+nn) LD BC,(SP+nn) LD BC,(PC+nn) LD DE,(IX+nn) LD DE,(IY+nn) LD DE,(SP+nn) LD DE,(PC+nn) LD HL,(IX+nn) LD HL,(IY+nn) LD HL,(SP+nn) LD HL,(PC+nn) LD IX,(IX+nn) LD IX,(IY+nn) LD IX,(SP+nn) LD IX,(PC+nn) LD IY,(IX+nn) LD IY,(IY+nn) LD IY,(SP+nn) LD IY,(PC+nn) LD SP,(IX+nn) LD SP,(IY+nn) LD SP,(SP+nn) LD SP,(PC+nn) LD PC,(IX+nn) LD PC,(IY+nn) LD PC,(SP+nn) LD PC,(PC+nn) LD (AF+nn),AF LD (BC+nn),AF LD (DE+nn),AF LD (HL+nn),AF LD (AF+nn),BC LD (BC+nn),BC LD (DE+nn),BC LD (HL+nn),BC LD (AF+nn),DE LD (BC+nn),DE LD (DE+nn),DE LD (HL+nn),DE LD (AF+nn),HL LD (BC+nn),HL LD (DE+nn),HL LD (HL+nn),HL LD (AF+nn),IX LD (BC+nn),IX LD (DE+nn),IX LD (HL+nn),IX LD (AF+nn),IY LD (BC+nn),IY LD (DE+nn),IY LD (HL+nn),IY LD (AF+nn),SP LD (BC+nn),SP LD (DE+nn),SP LD (HL+nn),SP LD (AF+nn),PC LD (BC+nn),PC LD (DE+nn),PC LD (HL+nn),PC LD (IX+nn),AF LD (IY+nn),AF LD (SP+nn),AF LD (PC+nn),AF LD (IX+nn),BC LD (IY+nn),BC LD (SP+nn),BC LD (PC+nn),BC LD (IX+nn),DE LD (IY+nn),DE LD (SP+nn),DE LD (PC+nn),DE LD (IX+nn),HL LD (IY+nn),HL LD (SP+nn),HL LD (PC+nn),HL LD (IX+nn),IX LD (IY+nn),IX LD (SP+nn),IX LD (PC+nn),IX LD (IX+nn),IY LD (IY+nn),IY LD (SP+nn),IY LD (PC+nn),IY LD (IX+nn),SP LD (IY+nn),SP LD (SP+nn),SP LD (PC+nn),SP LD (IX+nn),PC LD (IY+nn),PC LD (SP+nn),PC LD (PC+nn),PC PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX PUSH IY PUSH SP PUSH PC POP AF POP BC POP DE POP HL POP IX POP IY POP SP POP PC 8-bit arithmetic ---------------- ADD A,A ADD A,F ADD A,B ADD A,C ADD A,D ADD A,E ADD F,A ADD F,F ADD F,B ADD F,C ADD F,D ADD F,E ADD B,A ADD B,F ADD B,B ADD B,C ADD B,D ADD B,E ADD C,A ADD C,F ADD C,B ADD C,C ADD C,D ADD C,E ADD D,A ADD D,F ADD D,B ADD D,C ADD D,D ADD D,E ADD E,A ADD E,F ADD E,B ADD E,C ADD E,D ADD E,E ADD H,A ADD H,F ADD H,B ADD H,C ADD H,D ADD H,E ADD L,A ADD L,F ADD L,B ADD L,C ADD L,D ADD L,E ADD IXL,A ADD IXL,F ADD IXL,B ADD IXL,C ADD IXL,D ADD IXL,E ADD IXH,A ADD IXH,F ADD IXH,B ADD IXH,C ADD IXH,D ADD IXH,E ADD IYL,A ADD IYL,F ADD IYL,B ADD IYL,C ADD IYL,D ADD IYL,E ADD IYH,A ADD IYH,F ADD IYH,B ADD IYH,C ADD IYH,D ADD IYH,E ADD A,H ADD A,L ADD A,IXL ADD A,IXH ADD A,IYL ADD A,IYH ADD F,H ADD F,L ADD F,IXL ADD F,IXH ADD F,IYL ADD F,IYH ADD B,H ADD B,L ADD B,IXL ADD B,IXH ADD B,IYL ADD B,IYH ADD C,H ADD C,L ADD C,IXL ADD C,IXH ADD C,IYL ADD C,IYH ADD D,H ADD D,L ADD D,IXL ADD D,IXH ADD D,IYL ADD D,IYH ADD E,H ADD E,L ADD E,IXL ADD E,IXH ADD E,IYL ADD E,IYH ADD H,H ADD H,L ADD H,IXL ADD H,IXH ADD H,IYL ADD H,IYH ADD L,H ADD L,L ADD L,IXL ADD L,IXH ADD L,IYL ADD L,IYH ADD IXL,H ADD IXL,L ADD IXL,IXL ADD IXL,IXH ADD IXL,IYL ADD IXL,IYH ADD IXH,H ADD IXH,L ADD IXH,IXL ADD IXH,IXH ADD IXH,IYL ADD IXH,IYH ADD IYL,H ADD IYL,L ADD IYL,IXL ADD IYL,IXH ADD IYL,IYL ADD IYL,IYH ADD IYH,H ADD IYH,L ADD IYH,IXL ADD IYH,IXH ADD IYH,IYL ADD IYH,IYH ADC A,A ADC A,F ADC A,B ADC A,C ADC A,D ADC A,E ADC F,A ADC F,F ADC F,B ADC F,C ADC F,D ADC F,E ADC B,A ADC B,F ADC B,B ADC B,C ADC B,D ADC B,E ADC C,A ADC C,F ADC C,B ADC C,C ADC C,D ADC C,E ADC D,A ADC D,F ADC D,B ADC D,C ADC D,D ADC D,E ADC E,A ADC E,F ADC E,B ADC E,C ADC E,D ADC E,E ADC H,A ADC H,F ADC H,B ADC H,C ADC H,D ADC H,E ADC L,A ADC L,F ADC L,B ADC L,C ADC L,D ADC L,E ADC IXL,A ADC IXL,F ADC IXL,B ADC IXL,C ADC IXL,D ADC IXL,E ADC IXH,A ADC IXH,F ADC IXH,B ADC IXH,C ADC IXH,D ADC IXH,E ADC IYL,A ADC IYL,F ADC IYL,B ADC IYL,C ADC IYL,D ADC IYL,E ADC IYH,A ADC IYH,F ADC IYH,B ADC IYH,C ADC IYH,D ADC IYH,E ADC A,H ADC A,L ADC A,IXL ADC A,IXH ADC A,IYL ADC A,IYH ADC F,H ADC F,L ADC F,IXL ADC F,IXH ADC F,IYL ADC F,IYH ADC B,H ADC B,L ADC B,IXL ADC B,IXH ADC B,IYL ADC B,IYH ADC C,H ADC C,L ADC C,IXL ADC C,IXH ADC C,IYL ADC C,IYH ADC D,H ADC D,L ADC D,IXL ADC D,IXH ADC D,IYL ADC D,IYH ADC E,H ADC E,L ADC E,IXL ADC E,IXH ADC E,IYL ADC E,IYH ADC H,H ADC H,L ADC H,IXL ADC H,IXH ADC H,IYL ADC H,IYH ADC L,H ADC L,L ADC L,IXL ADC L,IXH ADC L,IYL ADC L,IYH ADC IXL,H ADC IXL,L ADC IXL,IXL ADC IXL,IXH ADC IXL,IYL ADC IXL,IYH ADC IXH,H ADC IXH,L ADC IXH,IXL ADC IXH,IXH ADC IXH,IYL ADC IXH,IYH ADC IYL,H ADC IYL,L ADC IYL,IXL ADC IYL,IXH ADC IYL,IYL ADC IYL,IYH ADC IYH,H ADC IYH,L ADC IYH,IXL ADC IYH,IXH ADC IYH,IYL ADC IYH,IYH SUB A,A SUB A,F SUB A,B SUB A,C SUB A,D SUB A,E SUB F,A SUB F,F SUB F,B SUB F,C SUB F,D SUB F,E SUB B,A SUB B,F SUB B,B SUB B,C SUB B,D SUB B,E SUB C,A SUB C,F SUB C,B SUB C,C SUB C,D SUB C,E SUB D,A SUB D,F SUB D,B SUB D,C SUB D,D SUB D,E SUB E,A SUB E,F SUB E,B SUB E,C SUB E,D SUB E,E SUB H,A SUB H,F SUB H,B SUB H,C SUB H,D SUB H,E SUB L,A SUB L,F SUB L,B SUB L,C SUB L,D SUB L,E SUB IXL,A SUB IXL,F SUB IXL,B SUB IXL,C SUB IXL,D SUB IXL,E SUB IXH,A SUB IXH,F SUB IXH,B SUB IXH,C SUB IXH,D SUB IXH,E SUB IYL,A SUB IYL,F SUB IYL,B SUB IYL,C SUB IYL,D SUB IYL,E SUB IYH,A SUB IYH,F SUB IYH,B SUB IYH,C SUB IYH,D SUB IYH,E SUB A,H SUB A,L SUB A,IXL SUB A,IXH SUB A,IYL SUB A,IYH SUB F,H SUB F,L SUB F,IXL SUB F,IXH SUB F,IYL SUB F,IYH SUB B,H SUB B,L SUB B,IXL SUB B,IXH SUB B,IYL SUB B,IYH SUB C,H SUB C,L SUB C,IXL SUB C,IXH SUB C,IYL SUB C,IYH SUB D,H SUB D,L SUB D,IXL SUB D,IXH SUB D,IYL SUB D,IYH SUB E,H SUB E,L SUB E,IXL SUB E,IXH SUB E,IYL SUB E,IYH SUB H,H SUB H,L SUB H,IXL SUB H,IXH SUB H,IYL SUB H,IYH SUB L,H SUB L,L SUB L,IXL SUB L,IXH SUB L,IYL SUB L,IYH SUB IXL,H SUB IXL,L SUB IXL,IXL SUB IXL,IXH SUB IXL,IYL SUB IXL,IYH SUB IXH,H SUB IXH,L SUB IXH,IXL SUB IXH,IXH SUB IXH,IYL SUB IXH,IYH SUB IYL,H SUB IYL,L SUB IYL,IXL SUB IYL,IXH SUB IYL,IYL SUB IYL,IYH SUB IYH,H SUB IYH,L SUB IYH,IXL SUB IYH,IXH SUB IYH,IYL SUB IYH,IYH SBC A,A SBC A,F SBC A,B SBC A,C SBC A,D SBC A,E SBC F,A SBC F,F SBC F,B SBC F,C SBC F,D SBC F,E SBC B,A SBC B,F SBC B,B SBC B,C SBC B,D SBC B,E SBC C,A SBC C,F SBC C,B SBC C,C SBC C,D SBC C,E SBC D,A SBC D,F SBC D,B SBC D,C SBC D,D SBC D,E SBC E,A SBC E,F SBC E,B SBC E,C SBC E,D SBC E,E SBC H,A SBC H,F SBC H,B SBC H,C SBC H,D SBC H,E SBC L,A SBC L,F SBC L,B SBC L,C SBC L,D SBC L,E SBC IXL,A SBC IXL,F SBC IXL,B SBC IXL,C SBC IXL,D SBC IXL,E SBC IXH,A SBC IXH,F SBC IXH,B SBC IXH,C SBC IXH,D SBC IXH,E SBC IYL,A SBC IYL,F SBC IYL,B SBC IYL,C SBC IYL,D SBC IYL,E SBC IYH,A SBC IYH,F SBC IYH,B SBC IYH,C SBC IYH,D SBC IYH,E SBC A,H SBC A,L SBC A,IXL SBC A,IXH SBC A,IYL SBC A,IYH SBC F,H SBC F,L SBC F,IXL SBC F,IXH SBC F,IYL SBC F,IYH SBC B,H SBC B,L SBC B,IXL SBC B,IXH SBC B,IYL SBC B,IYH SBC C,H SBC C,L SBC C,IXL SBC C,IXH SBC C,IYL SBC C,IYH SBC D,H SBC D,L SBC D,IXL SBC D,IXH SBC D,IYL SBC D,IYH SBC E,H SBC E,L SBC E,IXL SBC E,IXH SBC E,IYL SBC E,IYH SBC H,H SBC H,L SBC H,IXL SBC H,IXH SBC H,IYL SBC H,IYH SBC L,H SBC L,L SBC L,IXL SBC L,IXH SBC L,IYL SBC L,IYH SBC IXL,H SBC IXL,L SBC IXL,IXL SBC IXL,IXH SBC IXL,IYL SBC IXL,IYH SBC IXH,H SBC IXH,L SBC IXH,IXL SBC IXH,IXH SBC IXH,IYL SBC IXH,IYH SBC IYL,H SBC IYL,L SBC IYL,IXL SBC IYL,IXH SBC IYL,IYL SBC IYL,IYH SBC IYH,H SBC IYH,L SBC IYH,IXL SBC IYH,IXH SBC IYH,IYL SBC IYH,IYH AND A,A AND A,F AND A,B AND A,C AND A,D AND A,E AND F,A AND F,F AND F,B AND F,C AND F,D AND F,E AND B,A AND B,F AND B,B AND B,C AND B,D AND B,E AND C,A AND C,F AND C,B AND C,C AND C,D AND C,E AND D,A AND D,F AND D,B AND D,C AND D,D AND D,E AND E,A AND E,F AND E,B AND E,C AND E,D AND E,E AND H,A AND H,F AND H,B AND H,C AND H,D AND H,E AND L,A AND L,F AND L,B AND L,C AND L,D AND L,E AND IXL,A AND IXL,F AND IXL,B AND IXL,C AND IXL,D AND IXL,E AND IXH,A AND IXH,F AND IXH,B AND IXH,C AND IXH,D AND IXH,E AND IYL,A AND IYL,F AND IYL,B AND IYL,C AND IYL,D AND IYL,E AND IYH,A AND IYH,F AND IYH,B AND IYH,C AND IYH,D AND IYH,E AND A,H AND A,L AND A,IXL AND A,IXH AND A,IYL AND A,IYH AND F,H AND F,L AND F,IXL AND F,IXH AND F,IYL AND F,IYH AND B,H AND B,L AND B,IXL AND B,IXH AND B,IYL AND B,IYH AND C,H AND C,L AND C,IXL AND C,IXH AND C,IYL AND C,IYH AND D,H AND D,L AND D,IXL AND D,IXH AND D,IYL AND D,IYH AND E,H AND E,L AND E,IXL AND E,IXH AND E,IYL AND E,IYH AND H,H AND H,L AND H,IXL AND H,IXH AND H,IYL AND H,IYH AND L,H AND L,L AND L,IXL AND L,IXH AND L,IYL AND L,IYH AND IXL,H AND IXL,L AND IXL,IXL AND IXL,IXH AND IXL,IYL AND IXL,IYH AND IXH,H AND IXH,L AND IXH,IXL AND IXH,IXH AND IXH,IYL AND IXH,IYH AND IYL,H AND IYL,L AND IYL,IXL AND IYL,IXH AND IYL,IYL AND IYL,IYH AND IYH,H AND IYH,L AND IYH,IXL AND IYH,IXH AND IYH,IYL AND IYH,IYH XOR A,A XOR A,F XOR A,B XOR A,C XOR A,D XOR A,E XOR F,A XOR F,F XOR F,B XOR F,C XOR F,D XOR F,E XOR B,A XOR B,F XOR B,B XOR B,C XOR B,D XOR B,E XOR C,A XOR C,F XOR C,B XOR C,C XOR C,D XOR C,E XOR D,A XOR D,F XOR D,B XOR D,C XOR D,D XOR D,E XOR E,A XOR E,F XOR E,B XOR E,C XOR E,D XOR E,E XOR H,A XOR H,F XOR H,B XOR H,C XOR H,D XOR H,E XOR L,A XOR L,F XOR L,B XOR L,C XOR L,D XOR L,E XOR IXL,A XOR IXL,F XOR IXL,B XOR IXL,C XOR IXL,D XOR IXL,E XOR IXH,A XOR IXH,F XOR IXH,B XOR IXH,C XOR IXH,D XOR IXH,E XOR IYL,A XOR IYL,F XOR IYL,B XOR IYL,C XOR IYL,D XOR IYL,E XOR IYH,A XOR IYH,F XOR IYH,B XOR IYH,C XOR IYH,D XOR IYH,E XOR A,H XOR A,L XOR A,IXL XOR A,IXH XOR A,IYL XOR A,IYH XOR F,H XOR F,L XOR F,IXL XOR F,IXH XOR F,IYL XOR F,IYH XOR B,H XOR B,L XOR B,IXL XOR B,IXH XOR B,IYL XOR B,IYH XOR C,H XOR C,L XOR C,IXL XOR C,IXH XOR C,IYL XOR C,IYH XOR D,H XOR D,L XOR D,IXL XOR D,IXH XOR D,IYL XOR D,IYH XOR E,H XOR E,L XOR E,IXL XOR E,IXH XOR E,IYL XOR E,IYH XOR H,H XOR H,L XOR H,IXL XOR H,IXH XOR H,IYL XOR H,IYH XOR L,H XOR L,L XOR L,IXL XOR L,IXH XOR L,IYL XOR L,IYH XOR IXL,H XOR IXL,L XOR IXL,IXL XOR IXL,IXH XOR IXL,IYL XOR IXL,IYH XOR IXH,H XOR IXH,L XOR IXH,IXL XOR IXH,IXH XOR IXH,IYL XOR IXH,IYH XOR IYL,H XOR IYL,L XOR IYL,IXL XOR IYL,IXH XOR IYL,IYL XOR IYL,IYH XOR IYH,H XOR IYH,L XOR IYH,IXL XOR IYH,IXH XOR IYH,IYL XOR IYH,IYH OR A,A OR A,F OR A,B OR A,C OR A,D OR A,E OR F,A OR F,F OR F,B OR F,C OR F,D OR F,E OR B,A OR B,F OR B,B OR B,C OR B,D OR B,E OR C,A OR C,F OR C,B OR C,C OR C,D OR C,E OR D,A OR D,F OR D,B OR D,C OR D,D OR D,E OR E,A OR E,F OR E,B OR E,C OR E,D OR E,E OR H,A OR H,F OR H,B OR H,C OR H,D OR H,E OR L,A OR L,F OR L,B OR L,C OR L,D OR L,E OR IXL,A OR IXL,F OR IXL,B OR IXL,C OR IXL,D OR IXL,E OR IXH,A OR IXH,F OR IXH,B OR IXH,C OR IXH,D OR IXH,E OR IYL,A OR IYL,F OR IYL,B OR IYL,C OR IYL,D OR IYL,E OR IYH,A OR IYH,F OR IYH,B OR IYH,C OR IYH,D OR IYH,E OR A,H OR A,L OR A,IXL OR A,IXH OR A,IYL OR A,IYH OR F,H OR F,L OR F,IXL OR F,IXH OR F,IYL OR F,IYH OR B,H OR B,L OR B,IXL OR B,IXH OR B,IYL OR B,IYH OR C,H OR C,L OR C,IXL OR C,IXH OR C,IYL OR C,IYH OR D,H OR D,L OR D,IXL OR D,IXH OR D,IYL OR D,IYH OR E,H OR E,L OR E,IXL OR E,IXH OR E,IYL OR E,IYH OR H,H OR H,L OR H,IXL OR H,IXH OR H,IYL OR H,IYH OR L,H OR L,L OR L,IXL OR L,IXH OR L,IYL OR L,IYH OR IXL,H OR IXL,L OR IXL,IXL OR IXL,IXH OR IXL,IYL OR IXL,IYH OR IXH,H OR IXH,L OR IXH,IXL OR IXH,IXH OR IXH,IYL OR IXH,IYH OR IYL,H OR IYL,L OR IYL,IXL OR IYL,IXH OR IYL,IYL OR IYL,IYH OR IYH,H OR IYH,L OR IYH,IXL OR IYH,IXH OR IYH,IYL OR IYH,IYH CP A,A CP A,F CP A,B CP A,C CP A,D CP A,E CP F,A CP F,F CP F,B CP F,C CP F,D CP F,E CP B,A CP B,F CP B,B CP B,C CP B,D CP B,E CP C,A CP C,F CP C,B CP C,C CP C,D CP C,E CP D,A CP D,F CP D,B CP D,C CP D,D CP D,E CP E,A CP E,F CP E,B CP E,C CP E,D CP E,E CP H,A CP H,F CP H,B CP H,C CP H,D CP H,E CP L,A CP L,F CP L,B CP L,C CP L,D CP L,E CP IXL,A CP IXL,F CP IXL,B CP IXL,C CP IXL,D CP IXL,E CP IXH,A CP IXH,F CP IXH,B CP IXH,C CP IXH,D CP IXH,E CP IYL,A CP IYL,F CP IYL,B CP IYL,C CP IYL,D CP IYL,E CP IYH,A CP IYH,F CP IYH,B CP IYH,C CP IYH,D CP IYH,E CP A,H CP A,L CP A,IXL CP A,IXH CP A,IYL CP A,IYH CP F,H CP F,L CP F,IXL CP F,IXH CP F,IYL CP F,IYH CP B,H CP B,L CP B,IXL CP B,IXH CP B,IYL CP B,IYH CP C,H CP C,L CP C,IXL CP C,IXH CP C,IYL CP C,IYH CP D,H CP D,L CP D,IXL CP D,IXH CP D,IYL CP D,IYH CP E,H CP E,L CP E,IXL CP E,IXH CP E,IYL CP E,IYH CP H,H CP H,L CP H,IXL CP H,IXH CP H,IYL CP H,IYH CP L,H CP L,L CP L,IXL CP L,IXH CP L,IYL CP L,IYH CP IXL,H CP IXL,L CP IXL,IXL CP IXL,IXH CP IXL,IYL CP IXL,IYH CP IXH,H CP IXH,L CP IXH,IXL CP IXH,IXH CP IXH,IYL CP IXH,IYH CP IYL,H CP IYL,L CP IYL,IXL CP IYL,IXH CP IYL,IYL CP IYL,IYH CP IYH,H CP IYH,L CP IYH,IXL CP IYH,IXH CP IYH,IYL CP IYH,IYH ADD A,nn ADD F,nn ADD B,nn ADD C,nn ADD D,nn ADD E,nn ADD H,nn ADD L,nn ADD IXL,nn ADD IXH,nn ADD IYL,nn ADD IYH,nn ADC A,nn ADC F,nn ADC B,nn ADC C,nn ADC D,nn ADC E,nn ADC H,nn ADC L,nn ADC IXL,nn ADC IXH,nn ADC IYL,nn ADC IYH,nn SUB A,nn SUB F,nn SUB B,nn SUB C,nn SUB D,nn SUB E,nn SUB H,nn SUB L,nn SUB IXL,nn SUB IXH,nn SUB IYL,nn SUB IYH,nn SBC A,nn SBC F,nn SBC B,nn SBC C,nn SBC D,nn SBC E,nn SBC H,nn SBC L,nn SBC IXL,nn SBC IXH,nn SBC IYL,nn SBC IYH,nn AND A,nn AND F,nn AND B,nn AND C,nn AND D,nn AND E,nn AND H,nn AND L,nn AND IXL,nn AND IXH,nn AND IYL,nn AND IYH,nn XOR A,nn XOR F,nn XOR B,nn XOR C,nn XOR D,nn XOR E,nn XOR H,nn XOR L,nn XOR IXL,nn XOR IXH,nn XOR IYL,nn XOR IYH,nn OR A,nn OR F,nn OR B,nn OR C,nn OR D,nn OR E,nn OR H,nn OR L,nn OR IXL,nn OR IXH,nn OR IYL,nn OR IYH,nn CP A,nn CP F,nn CP B,nn CP C,nn CP D,nn CP E,nn CP H,nn CP L,nn CP IXL,nn CP IXH,nn CP IYL,nn CP IYH,nn ADD A,(AF+nn) ADD A,(BC+nn) ADD A,(DE+nn) ADD A,(HL+nn) ADD F,(AF+nn) ADD F,(BC+nn) ADD F,(DE+nn) ADD F,(HL+nn) ADD B,(AF+nn) ADD B,(BC+nn) ADD B,(DE+nn) ADD B,(HL+nn) ADD C,(AF+nn) ADD C,(BC+nn) ADD C,(DE+nn) ADD C,(HL+nn) ADD D,(AF+nn) ADD D,(BC+nn) ADD D,(DE+nn) ADD D,(HL+nn) ADD E,(AF+nn) ADD E,(BC+nn) ADD E,(DE+nn) ADD E,(HL+nn) ADD H,(AF+nn) ADD H,(BC+nn) ADD H,(DE+nn) ADD H,(HL+nn) ADD L,(AF+nn) ADD L,(BC+nn) ADD L,(DE+nn) ADD L,(HL+nn) ADD IXL,(AF+nn) ADD IXL,(BC+nn) ADD IXL,(DE+nn) ADD IXL,(HL+nn) ADD IXH,(AF+nn) ADD IXH,(BC+nn) ADD IXH,(DE+nn) ADD IXH,(HL+nn) ADD IYL,(AF+nn) ADD IYL,(BC+nn) ADD IYL,(DE+nn) ADD IYL,(HL+nn) ADD IYH,(AF+nn) ADD IYH,(BC+nn) ADD IYH,(DE+nn) ADD IYH,(HL+nn) ADD A,(IX+nn) ADD A,(IY+nn) ADD A,(SP+nn) ADD A,(PC+nn) ADD F,(IX+nn) ADD F,(IY+nn) ADD F,(SP+nn) ADD F,(PC+nn) ADD B,(IX+nn) ADD B,(IY+nn) ADD B,(SP+nn) ADD B,(PC+nn) ADD C,(IX+nn) ADD C,(IY+nn) ADD C,(SP+nn) ADD C,(PC+nn) ADD D,(IX+nn) ADD D,(IY+nn) ADD D,(SP+nn) ADD D,(PC+nn) ADD E,(IX+nn) ADD E,(IY+nn) ADD E,(SP+nn) ADD E,(PC+nn) ADD H,(IX+nn) ADD H,(IY+nn) ADD H,(SP+nn) ADD H,(PC+nn) ADD L,(IX+nn) ADD L,(IY+nn) ADD L,(SP+nn) ADD L,(PC+nn) ADD IXL,(IX+nn) ADD IXL,(IY+nn) ADD IXL,(SP+nn) ADD IXL,(PC+nn) ADD IXH,(IX+nn) ADD IXH,(IY+nn) ADD IXH,(SP+nn) ADD IXH,(PC+nn) ADD IYL,(IX+nn) ADD IYL,(IY+nn) ADD IYL,(SP+nn) ADD IYL,(PC+nn) ADD IYH,(IX+nn) ADD IYH,(IY+nn) ADD IYH,(SP+nn) ADD IYH,(PC+nn) ----------------------- alu r,(AF+nn) alu r,(BC+nn) alu r,(DE+nn) alu r,(HL+n) alu r,(IX+nn) alu r,(IY+nn) alu r,(SP+nn) alu r,(PC+n) alu A,(nnnn) alu F,(nnnn) alu B,(nnnn) alu C,(nnnn) alu D,(nnnn) alu E,(nnnn) alu H,(nnnn) alu L,(nnnn) alu IXL,(nnnn) alu IXH,(nnnn) alu IYL,(nnnn) alu IYH,(nnnn) rot A rot F rot B rot C rot D rot E rot H rot L rot IXL rot IXH rot IYL rot IYH rot (AF+nn) rot (BC+nn) rot (DE+nn) rot (HL+n) rot (IX+nn) rot (IY+nn) rot (SP+nn) rot (PC+n) rot (nnnn) INC/DEC A INC/DEC F INC/DEC B INC/DEC C INC/DEC D INC/DEC E INC/DEC H INC/DEC L INC/DEC IXL INC/DEC IXH INC/DEC IYL INC/DEC IYH INC/DEC (AF+nn) INC/DEC (BC+nn) INC/DEC (DE+nn) INC/DEC (HL+n) INC/DEC (IX+nn) INC/DEC (IY+nn) INC/DEC (SP+nn) INC/DEC (PC+n) INC/DEC (nnnn) 16-bit arithmetic ----------------- alu rr,AF alu rr,BC alu rr,DE alu rr,HL alu rr,IX alu rr,IY alu rr,SP alu rr,PC alu AF,nn alu BC,nn alu DE,nn alu HL,nn alu IX,nn alu IY,nn alu SP,nn alu PC,nn alu rr,(AF) alu rr,(BC) alu rr,(DE) alu rr,(HL) alu rr,(IX) alu rr,(IY) alu rr,(SP) alu rr,(PC) alu AF,(nnnn) alu BC,(nnnn) alu DE,(nnnn) alu HL,(nnnn) alu IX,(nnnn) alu IY,(nnnn) alu SP,(nnnn) alu PC,(nnnn) rot AF rot BC rot DE rot HL rot IX rot IY rot SP rot PC rot (AF) rot (BC) rot (DE) rot (HL) rot (IX) rot (IY) rot (SP) rot (PC) rot (nnnn) INC/DEC AF INC/DEC BC INC/DEC DE INC/DEC HL INC/DEC IX INC/DEC IY INC/DEC SP INC/DEC PC INC/DEC (AF) INC/DEC (BC) INC/DEC (DE) INC/DEC (HL) INC/DEC (IX) INC/DEC (IY) INC/DEC (SP) INC/DEC (PC) INC/DEC (nnnn) Bit operations -------------- bit b,A bit b,F bit b,B bit b,C bit b,D bit b,E bit b,H bit b,L bit b,IXL bit b,IXH bit b,IYL bit b,IYH bit b,(AF+nn) bit b,(BC+nn) bit b,(DE+nn) bit b,(HL+n) bit b,(IX+nn) bit b,(IY+nn) bit b,(SP+nn) bit b,(PC+n) bit b,(nnnn) Exchanges --------- EX r,A EX r,F EX r,B EX r,C EX r,D EX r,E EX r,H EX r,L EX r,IXL EX r,IXH EX r,IYL EX r,IYH EX r,(AF+nn) EX r,(BC+nn) EX r,(DE+nn) EX r,(HL+n) EX r,(IX+nn) EX r,(IY+nn) EX r,(SP+nn) EX r,(PC+n) EX r,(nnnn) EX rr,AF EX rr,BC EX rr,DE EX rr,HL EX rr,IX EX rr IY EX rr,SP EX rr,PC EX rr,(AF+nn) EX rr,(BC+nn) EX rr,(DE+nn) EX rr,(HL+n) EX rr,(IX+nn) EX rr,(IY+nn) EX rr,(SP+nn) EX rr,(PC+n) EX rr,(nnnn) Program control --------------- CALL cc,AF CALL cc,BC CALL cc,DE CALL cc,HL CALL cc,IX CALL cc,IY CALL cc,SP CALL cc,PC CALL cc,(AF+nn) CALL cc,(BC+nn) CALL cc,(DE+nn) CALL cc,(HL+n) CALL cc,(IX+nn) CALL cc,(IY+nn) CALL cc,(SP+nn) CALL cc,(PC+n) CALL cc,nn CALL cc,(nnnn) CALL AF CALL BC CALL DE CALL HL CALL IX CALL IY CALL SP CALL PC CALL (AF+nn) CALL (BC+nn) CALL (DE+nn) CALL (HL+n) CALL (IX+nn) CALL (IY+nn) CALL (SP+nn) CALL (PC+n) CALL nn CALL (nnnn) JP cc,AF JP cc,BC JP cc,DE JP cc,HL JP cc,IX JP cc,IY JP cc,SP JP cc,PC JP cc,(AF+nn) JP cc,(BC+nn) JP cc,(DE+nn) JP cc,(HL+n) JP cc,(IX+nn) JP cc,(IY+nn) JP cc,(SP+nn) JP cc,(PC+n) JP cc,nn JP cc,(nnnn) JP rr - alias for LD PC,rr JP (rr) - alias for LD PC,(rr) JP nn - alias for LD PC,nn JP (nnnn) - alias for LD PC,(nnnn) JR cc,nn JR nn RET cc RET - alias for POP PC Block Copy/Search ----------------- LDI LDD LDIR LDDR CPI CPD CPIR CPDR Input/Output ------------ IN r,(AF) IN r,(BC) IN r,(DE) IN r,(HL) IN r,(IX) IN r,(IY) IN r,(SP) IN r,(PC) OUT (AF),r OUT (BC),r OUT (DE),r OUT (HL),r OUT (IX),r OUT (IY),r OUT (SP),r OUT (PC),r IN A,(nnnn) IN F,(nnnn) IN B,(nnnn) IN C,(nnnn) IN D,(nnnn) IN E,(nnnn) IN H,(nnnn) IN L,(nnnn) IN IXL,(nnnn) IN IXH,(nnnn) IN IYL,(nnnn) IN IYH,(nnnn) OUT (nnnn),A OUT (nnnn),F OUT (nnnn),B OUT (nnnn),C OUT (nnnn),D OUT (nnnn),E OUT (nnnn),H OUT (nnnn),L OUT (nnnn),IXL OUT (nnnn),IXH OUT (nnnn),IYL OUT (nnnn),IYH INI IND INIR INDR OTI OTD OTIR OTDR Misc ---- SCF CCF NEG CPL LD r,R LD R,r LD r,I LD I,r DJNZ RST nn RETN RETI RLD RRD EX AF,AF' EXX EI DI IM m DAA NOP Registers ALU Operations Bit Operations ========= ============== ============== r rr (rr) alu rot bit ---------------- ------------- ------ A AF (AF+nn) ADD RLC BIT F BC (BC+nn) ADC RRC RES B DE (DE+nn) SUB RL SET C HL (HL+nn) SBC RR D IX (IX+nn) AND SLA E IY (IY+nn) XOR SRA H SP (SP+nn) OR SLS L PC (PC+nn) CP SRL IXL IXH XYL XYH