Unknown Z80-INSTRUCTIONS found by me ------------------------------------ When the opcode #DD is prior to an instruction and it is followed by an opcode that performs an operation without the opcode #DD with HL, H or L, then this is also possible with IX, I or X and IY, I or Y. To avoid misunderstandings with the I of IX and the I of IY, I named them as follows: HIX => The I of IX HIY => The I of IY LIX => The X of IX LIY => The Y of IY H and L then stand for the High and Low byte for the register concerned. Here follows a list of the instructions found by me: OPCODES INS DESCRIPTION INST. OPCODES INS. DESCRIPTION. ----------- ----------------- ------------ ------------- #DD #24 INC HIX #FD #24 INC HIY #DD #25 DEC HIX #FD #25 DEC HIY #DD #26 nn LD HIX,nn #FD #26 nn LD HIY,nn #DD #2C INC LIX #FD #2C INC LIY #DD #2D DEC LIX #FD #2D DEC LIY #DD #2E nn LD LIX,nn #FD #2E nn LD LIY,nn #DD #44 LD B,HIX #FD #44 LD B,HIY #DD #45 LD B,LIX #FD #45 LD B,LIY #DD #4C LD C,HIX #FD #4C LD C,HIY #DD #4D LD C,LIX #FD #4D LD C,LIY #DD #54 LD D,HIX #FD #54 LD D,HIY #DD #55 LD D,LIX #FD #55 LD D,LIY #DD #5C LD E,HIX #FD #5C LD E,HIY #DD #5D LD E,LIX #FD #5D LD E,LIY #DD #60 LD HIX,B #FD #60 LD HIY,B #DD #61 LD HIX,C #FD #61 LD HIY,C #DD #62 LD HIX,D #FD #62 LD HIY,D #DD #63 LD HIX,E #FD #63 LD HIY,E #DD #64 LD HIX,HIX #FD #64 LD HIY,HIY #DD #65 LD HIX,LIX #FD #65 LD HIY,LIY #DD #67 LD HIX,A #FD #67 LD HIY,A #DD #68 LD LIX,B #FD #68 LD LIY,B #DD #69 LD LIX,C #FD #69 LD LIY,C #DD #6A LD LIX,D #FD #6A LD LIY,D #DD #6B LD LIX,E #FD #6B LD LIY,E #DD #6C LD LIX,HIX #FD #6C LD LIY,HIY #DD #6D LD LIX,LIX #FD #6D LD LIY,LIY #DD #6F LD LIX,A #FD #6F LD LIY,A #DD #7C LD A,HIX #FD #7C LD A,HIY #DD #7D LD A,LIX #FD #7D LD A,LIY #DD #84 ADD A,HIX #FD #84 ADD A,HIY #DD #85 ADD A,LIX #FD #85 ADD A,LIY #DD #8C ADC A,HIX #FD #8C ADC A,HIY #DD #8D ADC A,LIX #FD #8D ADC A,LIY #DD #94 SUB HIX #FD #94 SUB HIY #DD #95 SUB LIX #FD #95 SUB LIY #DD #9C SBC A,HIX #FD #9C SBC A,HIY #DD #9D SBC A,LIX #FD #9D SBC A,LIY #DD #A4 AND HIX #FD #A4 AND HIY #DD #A5 AND LIX #FD #A5 AND LIY #DD #AC XOR HIX #FD #AC XOR HIY #DD #AD XOR LIX #FD #AD XOR LIY #DD #B4 OR HIX #FD #B4 OR HIY #DD #B5 OR LIX #FD #B5 OR LIY #DD #BC CP HIX #FD #BC CP HIY #DD #BD CP LIX #FD #BD CP LIY #DD #CB nn #00 RLC (IX+nn) & LD B,(IX+nn) #DD #CB nn #01 RLC (IX+nn) & LD C,(IX+nn) #DD #CB nn #02 RLC (IX+nn) & LD D,(IX+nn) #DD #CB nn #03 RLC (IX+nn) & LD E,(IX+nn) #DD #CB nn #04 RLC (IX+nn) & LD H,(IX+nn) #DD #CB nn #05 RLC (IX+nn) & LD L,(IX+nn) #DD #CB nn #06 RLC (IX+nn) & LD F,(IX+nn) 1) #DD #CB nn #07 RLC (IX+nn) & LD A,(IX+nn) #DD #CB nn #08 RRC (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #10 RL (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #18 RR (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #20 SLA (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #28 SRA (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #30 SLL (IX+nn) & LD B,(IX+nn) etc. 2) #DD #CB nn #38 SRL (IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #80 RES 0,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #88 RES 1,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #90 RES 2,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #98 RES 3,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #A0 RES 4,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #A8 RES 5,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #B0 RES 6,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #B8 RES 7,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #C0 SET 0,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #C8 SET 1,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #D0 SET 2,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #D8 SET 3,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #E0 SET 4,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #E8 SET 5,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #F0 SET 6,(IX+nn) & LD B,(IX+nn) etc. #DD #CB nn #F8 SET 7,(IX+nn) & LD B,(IX+nn) etc. #CB #30 SLL B 2) #CB #31 SLL C #CB #32 SLL D #CB #33 SLL E #CB #34 SLL H #CB #35 SLL L #CB #36 SLL (HL) #CB #37 SLL A #ED #70 IN F,(C) 3) #ED #71 OUT F,(C) 4) All functions working on IX are also possible with IY, the opcode then becomes #FD in stead of #DD (see also the first series of instructions). ad 1) #DD #CB nn #06 is the 'known' instruction. This one is actually also such a 'double one', but because the flags are changed in the other ones, this one is abbreviated to RLC (IX+nn). ad 2) SLL (IX+nn), a special case. At first sight one should say that this one performs the opposite operation of SRL (IX+nn), but when the actual operation is investigated, it is discovered that there is indeed a shift to the left, but also that there is set a 1 in the leftover-bit instead of a 0. So, SLL shifts like this: [carry] <- [bit 7 <- bit 0] <- [1] ad 3) IN F,(C) performs the same instruction as all other IN x,(C) instructions, but in this case no register is used, so only the flags are changed. ad 4) OUT F,(C) yes, a problem, because I don't know what this does. Since IN F,(C) exists, OUT F,(C) is very likely to exist, but I do NOT know what operation this instruction performs. Finally I wanted to say that it seems that there are also really instructions missing, like: LD HIX,(IX+nn), since LD H,(HL) also exists. And I also cannot find IN HIX,(C) anywhere, while HIX is also just an 8-bit register. Now I have some questions: why are these instructions completely unknown in Z80-ML books? Isn't this standard or what? Does it only work on certain Z80-types of certain manufacturers? On my TOSHIBA MSX1 with Z80B, NMS 8235 with a normal Z80A, NMS 8250 with Z80H and on my SONY HB F700P with also a Z80H everything works perfectly, so I guess it won't be that. But what is it then? I'm sure it's not the misunderstandings that could arise with the I of IX and the I of IY, because they should have called them differently then. So here still stands a big question-mark... If someone does have an idea, then PLEASE let me know! Good luck with it and let's hope that programs can be speeded up with it or something, because now one can use more 8-bits registers at the same time, so the stack-pointer has to be used less than before. (c) 1992 ricosoftware by of course Richard Spijkers Tel 04242-83946 (speech) -------------- Translation from Dutch to English by Manuel Bilderbeek (manuelbi@sci.kun.nl, homepage: http://www.sci.kun.nl/marie/home/manuelbi). The original document can be found on: http://users.castel.nl/msx/docs/extraz80.txt. Request to translation was made by Jin Soo Shin and Jakob Eriksson. The translation was done on 2nd February 1998.