;-------------------------------------------------
;Z80 DISASSEMBLER LISTING
;Label  Instruction
;-------------------------------------------------

        LD HL,0000H
        LD (100EH),HL
        XOR A
        LD (100DH),A
L0029:  LD SP,17FFH
        IN A,(04H)
        AND 80H
        PUSH AF
        CALL Z,L0001
        POP AF
        CALL NZ,L0002
L0006:  IN A,(04H)
        CPL
        AND 02H
        CALL NZ,L0003
        LD A,(100DH)
        AND 0FH
        CALL NZ,L0004
        IN A,(02H)
        OR A
        CALL M,L0005
        JP L0006
        LD (HL),A
        LD D,B
        LD H,H
        INC BC
        INC D
        INC B
        DEC C
        LD (DE),A
        INC BC
        DEC BC
        NOP
        LD A,(BC)
        NOP
        NOP
        NOP
        NOP
        LD (HL),A
        LD D,B
        LD H,H
        INC BC
        INC D
        INC B
        LD (DE),A
        INC DE
        NOP
        DEC BC
        NOP
        LD A,(BC)
        NOP
        NOP
        NOP
        NOP
L0004:  IN A,(04H)
        CPL
        AND 04H
        RET NZ
        LD HL,(100EH)
        LD A,H
        CP L
        JP NZ,L0007
        LD A,(100DH)
        AND 0F0H
        LD (100DH),A
        RET
L0007:  INC A
        LD (100FH),A
        LD H,11H
        LD L,A
        LD A,(HL)
        OUT (00H),A
        LD A,(100DH)
        AND 0FH
        LD (100DH),A
        RET
L0005:  LD A,(100DH)
        AND 0F0H
        RET NZ
        LD HL,(100EH)
        LD A,L
        INC A
        CP H
        JP Z,L0008
        LD (100EH),A
        LD H,11H
        LD L,A
        CALL L0009
        LD (HL),A
        LD A,(100DH)
        OR 0FH
        LD (100DH),A
        IN A,(04H)
        AND 40H
        LD A,(HL)
        JP Z,L0010
        RET
L0008:  LD A,(100DH)
        OR 0F0H
        LD (100DH),A
        RET
L0002:  LD A,1AH
        LD (100AH),A
        LD HL,0820H
        LD (100BH),HL
        LD HL,0032H
        JP L0011
L0001:  LD A,12H
        LD (100AH),A
        LD HL,05A0H
        LD (100BH),HL
        LD HL,0042H
L0011:  LD B,00H
L0012:  LD A,B
        OUT (06H),A
        LD A,(HL)
        OUT (07H),A
        INC HL
        INC B
        LD A,10H
        CP B
        JP NZ,L0012
        XOR A
        OUT (02H),A
        LD HL,0000H
        LD (1000H),HL
        LD (1002H),HL
        LD (1004H),HL
        LD (1008H),HL
        LD BC,1000H
        LD HL,2000H
L0052:  INC B
        LD DE,3000H
        LD A,(1009H)
        AND 01H
        JP NZ,L0013
        XOR A
        OUT (02H),A
L0015:  LD (HL),20H
        INC HL
        PUSH HL
        XOR A
        SBC HL,DE
        JP NZ,L0014
        POP HL
        LD HL,2000H
        PUSH HL
L0014:  POP HL
        DEC C
        JP NZ,L0015
        DEC B
        JP NZ,L0015
        LD A,(1009H)
        OUT (02H),A
        RET
L0013:  LD (HL),00H
        INC HL
        PUSH HL
        XOR A
        SBC HL,DE
        JP NZ,L0016
        POP HL
        LD HL,2000H
        PUSH HL
L0016:  POP HL
        DEC C
        JP NZ,L0013
        DEC B
        JP NZ,L0013
        RET
L0003:  IN A,(00H)
L0010:  LD C,A
        LD A,(1004H)
        OR A
        JP NZ,L0017
        LD A,C
        CP 1BH
        JP Z,L0018
        LD A,(1009H)
        AND 01H
        JP NZ,L0019
        LD A,C
        AND 7FH
        LD C,A
        LD A,1FH
        CP C
        JP NC,L0020
L0019:  XOR A
        LD (1007H),A
        CALL L0021
        LD A,H
        AND 0FH
        OR 20H
        LD H,A
        LD (HL),C
        CALL L0022
        RET
L0020:  LD A,C
        OR C
        RET Z
        CP 0AH
        JP NZ,L0023
        CALL L0024
        LD A,(1007H)
        OR A
        RET Z
        CALL L0025
        RET
L0023:  LD HL,1007H
        LD (HL),00H
        CP 0DH
        JP NZ,L0026
        LD A,0FFH
        LD (HL),A
        LD HL,1002H
        LD C,(HL)
        LD (HL),00H
        LD B,00H
        CALL L0021
        SBC HL,BC
        JP L0027
L0026:  CP 1FH
        JP NZ,L0028
        LD C,0DH
        CALL L0020
        LD C,0AH
        JP L0020
L0028:  CP 1AH
        JP Z,L0029
        CP 08H
        JP Z,L0030
        CP 0CH
        JP Z,L0022
        CP 1EH
        JP NZ,L0031
        XOR A
        LD (1002H),A
        LD HL,(1000H)
        JP L0027
L0031:  CP 0BH
        JP Z,L0032
        CP 09H
        JP NZ,L0033
        LD A,(1002H)
        AND 0F8H
        ADD A,08H
        CP 50H
        JP NZ,L0034
        LD C,1FH
        JP L0020
L0034:  LD HL,1002H
        SUB (HL)
        LD C,A
L0035:  CALL L0022
        DEC C
        JP NZ,L0035
        RET
L0033:  RET
L0018:  XOR A
        LD (1007H),A
        CPL
        LD (1004H),A
        RET
L0017:  LD A,(1005H)
        OR A
        JP NZ,L0036
        LD A,3DH
        CP C
        JP NZ,L0037
        LD A,02H
        LD (1005H),A
        RET
L0037:  LD A,(1008H)
        OR A
        JP NZ,L0038
        LD A,C
        CP 47H
        JP NZ,L0039
        LD A,0FFH
        LD (1008H),A
        RET
L0038:  LD A,C
        LD (1009H),A
        OUT (02H),A
        XOR A
        LD (1008H),A
        LD (1004H),A
        RET
L0039:  XOR A
        LD (1004H),A
        LD A,C
        CP 54H
        JP Z,L0025
        CP 59H
        JP Z,L0040
        CP 2AH
        JP Z,L0029
        CP 44H
        JP Z,L0041
        RET
L0041:  LD A,(1009H)
        OR 01H
        LD (1009H),A
        RET
L0036:  LD A,(1005H)
        DEC A
        LD (1005H),A
        JP Z,L0042
        LD A,(100AH)
        ADD A,20H
        DEC A
        SUB C
        JP NC,L0043
L0044:  LD C,20H
L0043:  LD A,1FH
        SUB C
        JP NC,L0044
        CALL L0045
        LD A,C
        LD (1006H),A
        RET
L0042:  LD A,1FH
        SUB C
        JP NC,L0046
        LD A,6FH
        SUB C
        JP NC,L0047
L0046:  LD C,20H
L0047:  CALL L0045
        LD HL,0000H
        LD A,(1006H)
        OR A
        JP Z,L0048
        LD DE,0050H
L0049:  ADD HL,DE
        DEC A
        JP NZ,L0049
L0048:  LD B,00H
        ADD HL,BC
        EX DE,HL
        LD HL,(1000H)
        ADD HL,DE
        XOR A
        LD (1004H),A
        LD (1005H),A
        LD A,C
        LD (1002H),A
        JP L0027
L0045:  LD A,C
        AND 7FH
        SUB 20H
        LD C,A
        RET
L0040:  CALL L0021
        CALL L0050
        LD HL,0000H
        XOR A
        SBC HL,DE
        PUSH HL
        POP BC
        JP L0051
L0024:  CALL L0021
        LD DE,0050H
        ADD HL,DE
        CALL L0027
        CALL L0050
        RET
L0025:  LD A,(1002H)
        LD B,A
        LD A,50H
        SUB B
        LD C,A
        LD B,00H
L0051:  CALL L0021
L0058:  LD A,H
        AND 0FH
        OR 20H
        LD H,A
        CALL L0052
        RET
L0021:  LD A,0EH
        OUT (06H),A
        IN A,(07H)
        LD H,A
        LD A,0FH
        OUT (06H),A
        IN A,(07H)
        LD L,A
        RET
L0022:  CALL L0021
        INC HL
        PUSH HL
        LD HL,1002H
        INC (HL)
        LD A,50H
        CP (HL)
        JP NZ,L0053
        LD (HL),00H
L0053:  POP HL
        CALL L0027
        JP L0050
L0027:  LD A,3FH
        AND H
        LD H,A
        LD A,0EH
        OUT (06H),A
        LD A,H
        OUT (07H),A
        LD A,0FH
        OUT (06H),A
        LD A,L
        OUT (07H),A
        RET
L0050:  PUSH HL
L0055:  EX DE,HL
        LD HL,(1000H)
        EX DE,HL
        XOR A
        SBC HL,DE
        JP NC,L0054
        LD DE,4000H
        POP HL
        PUSH HL
        ADD HL,DE
        JP L0055
L0056:  PUSH HL
        LD HL,(100BH)
        EX DE,HL
        POP HL
        RET
L0054:  CALL L0056
        XOR A
        SBC HL,DE
        EX DE,HL
        POP HL
        RET C
        CALL L0057
        LD HL,(1000H)
        PUSH HL
        LD HL,(100BH)
        LD DE,0FFB0H
        ADD HL,DE
        EX DE,HL
        POP HL
        ADD HL,DE
        LD BC,0050H
        CALL L0058
        RET
L0032:  CALL L0021
        LD DE,0050H
        XOR A
        SBC HL,DE
        CALL L0027
        PUSH HL
L0060:  EX DE,HL
        LD HL,(1000H)
        EX DE,HL
        XOR A
        SBC HL,DE
        JP NC,L0059
        LD DE,4000H
        POP HL
        PUSH HL
        ADD HL,DE
        JP L0060
L0059:  CALL L0056
        XOR A
        SBC HL,DE
        POP HL
        RET C
        CALL L0061
        RET
L0030:  CALL L0021
        EX DE,HL
        LD HL,(1000H)
        XOR A
        SBC HL,DE
        CALL Z,L0061
        EX DE,HL
        DEC HL
        CALL L0027
        LD A,(1002H)
        DEC A
        CP 0FFH
        JP NZ,L0062
        LD A,4FH
L0062:  LD (1002H),A
        RET
L0061:  LD HL,(1000H)
        LD BC,0050H
        XOR A
        SBC HL,BC
        JP L0063
L0057:  LD HL,(1000H)
        LD DE,0050H
        ADD HL,DE
L0063:  LD A,3FH
        AND H
        LD H,A
        LD (1000H),HL
        LD A,0CH
        OUT (06H),A
        LD A,H
        OUT (07H),A
        LD A,0DH
        OUT (06H),A
        LD A,L
        OUT (07H),A
        RET
L0009:  PUSH BC
        PUSH AF
L0065:  IN A,(02H)
        CALL L0064
        OR A
        JP P,L0065
        LD B,A
        IN A,(02H)
        CP B
        JP NZ,L0065
L0066:  IN A,(02H)
        OR A
        JP M,L0066
        LD A,B
        AND 7FH
        LD B,A
        POP AF
        LD A,B
        POP BC
        RET
L0064:  PUSH DE
        LD E,64H
        PUSH AF
L0068:  LD D,0AH
L0067:  DEC D
        JR NZ,L0067
        DEC E
        JR NZ,L0068
        POP AF
        POP DE
        RET
 
;--------------------------------------------
;LIST OF LABELS
;Sorted by address:      Sorted by name:
;--------------------------------------------

;L0029:  000A            L0001:  00C0
;L0006:  0019            L0002:  00AF
;L0004:  0052            L0003:  013C
;L0007:  0069            L0004:  0052
;L0005:  007C            L0005:  007C
;L0008:  00A6            L0006:  0019
;L0002:  00AF            L0007:  0069
;L0001:  00C0            L0008:  00A6
;L0011:  00CE            L0009:  03DF
;L0012:  00D0            L0010:  013E
;L0052:  00F6            L0011:  00CE
;L0015:  0105            L0012:  00D0
;L0014:  0114            L0013:  0123
;L0013:  0123            L0014:  0114
;L0016:  0132            L0015:  0105
;L0003:  013C            L0016:  0132
;L0010:  013E            L0017:  0200
;L0019:  015E            L0018:  01F7
;L0020:  0170            L0019:  015E
;L0023:  0184            L0020:  0170
;L0026:  01A1            L0021:  02F1
;L0028:  01B0            L0022:  0300
;L0031:  01CE            L0023:  0184
;L0034:  01E9            L0024:  02CC
;L0035:  01EE            L0025:  02DA
;L0033:  01F6            L0026:  01A1
;L0018:  01F7            L0027:  0318
;L0017:  0200            L0028:  01B0
;L0037:  0213            L0029:  000A
;L0038:  0226            L0030:  0395
;L0039:  0234            L0031:  01CE
;L0041:  024E            L0032:  0368
;L0036:  0257            L0033:  01F6
;L0044:  026B            L0034:  01E9
;L0043:  026D            L0035:  01EE
;L0042:  027B            L0036:  0257
;L0046:  0287            L0037:  0213
;L0047:  0289            L0038:  0226
;L0049:  0299            L0039:  0234
;L0048:  029E            L0040:  02BB
;L0045:  02B4            L0041:  024E
;L0040:  02BB            L0042:  027B
;L0024:  02CC            L0043:  026D
;L0025:  02DA            L0044:  026B
;L0051:  02E4            L0045:  02B4
;L0058:  02E7            L0046:  0287
;L0021:  02F1            L0047:  0289
;L0022:  0300            L0048:  029E
;L0053:  0311            L0049:  0299
;L0027:  0318            L0050:  032B
;L0050:  032B            L0051:  02E4
;L0055:  032C            L0052:  00F6
;L0056:  0340            L0053:  0311
;L0054:  0347            L0054:  0347
;L0032:  0368            L0055:  032C
;L0060:  0375            L0056:  0340
;L0059:  0389            L0057:  03C2
;L0030:  0395            L0058:  02E7
;L0062:  03B2            L0059:  0389
;L0061:  03B6            L0060:  0375
;L0057:  03C2            L0061:  03B6
;L0063:  03C9            L0062:  03B2
;L0009:  03DF            L0063:  03C9
;L0065:  03E1            L0064:  03FF
;L0066:  03F1            L0065:  03E1
;L0064:  03FF            L0066:  03F1
;L0068:  0403            L0067:  0405
;L0067:  0405            L0068:  0403
