; Disassembly of the file "mz5z009.bin"
; 
; CPU Type: Z80
; 
; Created with dZ80 2.1
; 
; on Tuesday, 17 of March 2026 at 05:34 PM
; 
LSWF        EQU     0CCH
LSRF        EQU     0CDH
LSDMD       EQU     0CEH
LSSCR       EQU     0CFH
LSD0        EQU     0D0H
LSD1        EQU     0D1H
LSD2        EQU     0D2H
LSD3        EQU     0D3H
LSE0        EQU     0E0H
LSE1        EQU     0E1H
LSE2        EQU     0E2H
LSE3        EQU     0E3H
LSE4        EQU     0E4H
LSE5        EQU     0E5H
LSPAL       EQU     0F0H
PSGA        EQU     0F2H
SIOAD       EQU     0F4H
SIOBD       EQU     0F5H
SIOBC       EQU     0F7H
LSFC        EQU     0FCH
ELMD        EQU     01000H
ELMD1       EQU     01001H
ELMD18      EQU     01012H
ELMD20      EQU     01014H
ELMD22      EQU     01016H
ELMD24      EQU     01018H
ELMD26      EQU     0101AH
ELMD30      EQU     0101EH
ELMD32      EQU     01020H
ZTOP        EQU     01040H
ZLOG        EQU     01042H
ZRWX        EQU     01043H
ZEQT        EQU     01044H
ZCH         EQU     01046H
ZEOF        EQU     01047H
ZWRK1       EQU     01048H
ZWRK2       EQU     01049H
ZNXT        EQU     0104AH
ZDEVNM      EQU     0104CH
ZFLAG1      EQU     01050H
ZFLAG2      EQU     01051H
ZDIRMX      EQU     01052H
ZINIT       EQU     01053H
ZRO         EQU     01055H
ZWO         EQU     01057H
ZCL         EQU     01059H
ZKL         EQU     0105BH
ZINP        EQU     0105DH
ZOUT        EQU     0105FH
ZDELT       EQU     01061H
ZWDIR       EQU     01063H
ZFREE       EQU     01065H
DCHAN       EQU     01069H
DDEV        EQU     0106AH
.$CRT       EQU     0106CH
.$LPT       EQU     0106EH
TEXTST      EQU     01070H
TEXTED      EQU     01072H
VARST       EQU     01074H
STRST       EQU     01076H
VARED       EQU     01078H
TMPEND      EQU     0107AH
INTFAC      EQU     0107CH
MEMLMT      EQU     0107EH
MEMMAX      EQU     01080H
CURXY       EQU     01082H
POSADR      EQU     01084H
BITADR      EQU     01086H
POINTX      EQU     01088H
POINTY      EQU     0108AH
CURFLG      EQU     0108CH
CURMAK      EQU     0108DH
CMTMSG      EQU     0108EH
INPFLG      EQU     0108FH
DISPX       EQU     01090H
FILOUT      EQU     01091H
PSEL        EQU     01092H
PCRLF       EQU     01093H
DMD         EQU     01098H
GMODE       EQU     0109FH
APTS        EQU     010F0H
NAME        EQU     010F1H
SIZE        EQU     01102H
DTADR       EQU     01104H
EXADR       EQU     01106H
COMNT       EQU     01108H
DTEFG       EQU     01171H
DTEFGX      EQU     01172H
TMCNT       EQU     01195H
KEYBUF      EQU     011A4H
INBUFC      EQU     01352H
INBUF       EQU     01354H
TIMST       EQU     00033H
XS          EQU     01369H
CWIDTH      EQU     0136BH
YS          EQU     0136FH
YE          EQU     01370H
SOF         EQU     01372H
CRTMD1      EQU     01379H
CRTMD2      EQU     0137AH
SELCOL      EQU     0137BH
SCRNT0      EQU     013A9H
EMFLG       EQU     013C3H
HERRF       EQU     013D9H
CTABLE      EQU     013DAH
FONTBF      EQU     01000H
TEXTBF      EQU     02000H
BITBUF      EQU     08000H
IBUFE       EQU     010F0H
ERRTXT      EQU     0FDA0H
VRAM        EQU     0D000H
ARAM        EQU     0D800H
MMIO        EQU     0E000H
ATRB        EQU     010F0H
PRGSTART    EQU     00000H
TAPECOPY    EQU     01200H
BUILD_ORIG  EQU     1
BUILD_RFS   EQU     0

            ; Create an MZF Tape header.
            ORG     ATRB

            ; Declare the MZF header to bootstrap BASIC from tape/SD.
BOOTATRB:   DB      01h                                                  ; Code Type, 01 = Machine Code.
BOOTNAME:   IF BUILD_ORIG = 1
              DB    "BASIC 5Z-009A   ", 0Dh                              ; Title/Name (17 bytes).
            ENDIF
            IF BUILD_RFS = 1
              DB    "BASIC 5Z-009ARFS", 0Dh                              ; Title/Name (17 bytes).
            ENDIF
BOOTSIZE:   DW      BASICEND - L0000                                  ; Size of program.
BOOTDTADR:  DW      TAPECOPY                                             ; Load address of program.
BOOTEXADR:  DW      EXECSTART + TAPECOPY                                            ; Exec address of program.
BOOTCOMNT:  DS      104

            ORG     PRGSTART

L0000:      JP      L0EF9               ; Cold start entry - JP to initialization

L0003:      JP      GETL

L0006:      JP      L09AB

L0009:      JP      L099B

L000C:      JP      L0E5F

            JP      PRNTT

L0012:      JP      L0E61

L0015:      JP      L0E50

SVC_ENTRY:  JP      L022C               ; RST 18H - SVC (Supervisor Call) dispatcher

            JP      INKEY0

BRKCHK:     JP      L0D22

            JP      L382E

            JP      L3832

            JP      L386C

            JP      L3870

            JP      L38A6

            JP      .RET

            JP      L149E

            NOP     
            NOP     
            JP      .RET

            JP      L14A2

L003E:      JP      L44F3

L0041:      JP      04520H

            JP      L447B

L0047:      JP      L447B

            JP      GETL

L004D:      DB      000H                ; System status / work area
            DB      058H
L004F:      DB      000H
L0050:      DB      000H
            JP      L0E50

            DS      4, 000H
L0058:      JP      INKEY$

            DW      .RET                ; CONTTB - CRT control code dispatch table
L005D:      DW      .RET
            DW      .RET
            DW      L09B0
            DW      .RET
            DW      00A1BH
            DW      L0A19
            DW      .RET
            DW      .RET
            DW      L0A24
            DW      .RET
            DW      .RET
            DW      .RET
            DW      L09B0
            DW      L1500
            DW      .RET
            DW      L06BE
            DW      L09CF
            DW      L09F9
L0081:      DW      L09D4
            DW      L09FE
            DW      L0992
            DW      HCLSW
            DW      00A1EH
            DW      L0776
            DW      L0A19
            DW      .RET
            DW      L09B0
            DW      .RET
            DW      .RET
            DW      .RET
            DW      .RET
L009B:      DB      087H
            DB      021H
            DB      05BH
            DB      000H
            DB      LSRF
L00A0:      DB      058H
            DB      001H
            DB      LSRF
            DB      051H
            DB      001H
            DB      0E9H
.NOP:       NOP     
.HL:        JP      (HL)

L00A8:      EI      
            PUSH    AF
            CALL    L44A3
            CALL    014F8H
            POP     AF
            DI      
.RET:       RET     

L00B3:      PUSH    AF
            CALL    L14FC
            POP     AF
            EI      
            RET     

PUSHRA:     EX      (SP),IX
            PUSH    HL
            PUSH    BC
            PUSH    DE
            PUSH    AF
            PUSH    HL
            LD      HL,L00D3
            EX      (SP),HL
            JP      (IX)

PUSHR:      EX      (SP),IX
            PUSH    HL
            PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      HL,L00D4
L00D0:      EX      (SP),HL
            JP      (IX)

L00D3:      POP     AF
L00D4:      POP     DE
            POP     BC
            POP     HL
            POP     IX
            RET     

L00DA:      DI      
            LD      SP,L0000
            IM      2
            OUT     (LSE1),A
            LD      HL,(L004D)
            JP      (HL)

BREAKX:     XOR     A
            DB      021H
BREAKZ:     LD      A,080H
            DB      021H
IOERR:      OR      080H
ERRORJ:     PUSH    AF
            CALL    L447B
            POP     AF
            LD      HL,(L004F)
            JP      (HL)

COUNT:      PUSH    DE
            LD      B,000H
L00F9:      LD      A,(DE)
            OR      A
            JR      Z,L0102             ; (+005H)
            INC     DE
            INC     B
            JR      NZ,L00F9            ; (-008H)
L0101:      DEC     B
L0102:      POP     DE
L0103:      RET     

IOOUT:      LD      A,(HL)
            INC     HL
            LD      C,(HL)
            INC     HL
            OUT     (C),A
            DJNZ    IOOUT               ; (-008H)
            RET     

DEVASC:     RST     018H
            DB      013H
            LD      A,D
            OR      A
            JP      NZ,L1F7F
            LD      A,E
            CP      B
            RET     C
            JP      L1F7F

            NOP     
CHKACC:     EX      (SP),HL
            PUSH    BC
            LD      B,(HL)
L011E:      INC     HL
            CP      (HL)
            JR      Z,L0127             ; (+005H)
            DJNZ    L011E               ; (-006H)
            INC     HL
            JR      L012A               ; (+003H)

L0127:      INC     HL
            DJNZ    L0127               ; (-003H)
L012A:      POP     BC
            EX      (SP),HL
            RET     

LDDEMI:     LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            RET     

LDDEMD:     LD      E,(HL)
            INC     HL
            LD      D,(HL)
            DEC     HL
            RET     

?CLRHL:     XOR     A
?SETHL:     LD      (HL),A
            INC     HL
            DJNZ    ?SETHL              ; (-004H)
            RET     

?CLRDE:     XOR     A
?SETDE:     LD      (DE),A
L013F:      INC     DE
L0140:      DJNZ    ?SETDE              ; (-004H)
            RET     

LDDEHL:     LD      A,(HL)
            LD      (DE),A
            INC     HL
            INC     DE
            DJNZ    LDDEHL              ; (-006H)
            RET     

LDHLDE:     LD      A,(DE)
            LD      (HL),A
            INC     HL
            INC     DE
            DJNZ    LDHLDE              ; (-006H)
            RET     

INDRCT:     PUSH    AF
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            POP     AF
            RET     

ADDHLA:     ADD     A,L
            LD      L,A
            RET     NC
            INC     H
            RET     

INCHLF:     INC     HL
HLFTCH:     LD      A,(HL)
            CP      020H
            JR      Z,INCHLF            ; (-006H)
            RET     

TEST1:      CALL    HLFTCH
            EX      (SP),HL
L0168:      CP      (HL)
            INC     HL
            EX      (SP),HL
            RET     NZ
            INC     HL
            RET     

TESTX:      CALL    HLFTCH
            EX      (SP),HL
            CP      (HL)
            INC     HL
            EX      (SP),HL
            INC     HL
            RET     Z
            LD      A,001H
            JP      ERRORJ

IOSVCT:     DW      L1587               ; IOSVCT - SVC dispatch table
            DW      L09AB
            DW      L099B
            DW      L0E61
            DW      L0EA2
            DW      L0D94
            DW      014F0H
            DW      L14B9
            DW      L0E2A
            DW      L0E2C
            DW      L0E3A
            DW      L0E48
            DW      GETL
            DW      INKEY$
            DW      L0D22
            DW      MHALT
            DW      L00A8
            DW      L00B3
            DW      CURMOV
            DW      DEASC
            DW      DEHEX
            DW      CKHEX
            DW      ASCHL
            DW      COUNT
            DW      ADDP0
            DW      ADDP1
            DW      ADDP2
            DW      ERRX
            DW      L3C1C
            DW      L3C00
            DW      014A6H
            DW      L14AA
            DW      L44F3
            DW      L4422
            DW      L437A
            DW      L44AF
            DW      IOOUT
            DW      L14A2
            DW      L149E
            DW      L1989
            DW      L1BFA
            DW      L1EF0
            DW      L1F32
            DW      L1F06
            DW      L1A45
            DW      L1AC0
            DW      L19E8
            DW      L1B83
            DW      L1CC6
            DW      L1CEA
L01E0:      DW      L1CDB
            DW      L1AE9
            DW      L18D0
            DW      L18E4
            DW      L194C
            DW      L180F
            DW      L1BB9
            DW      L1D2D
            DW      SETDFL
            DW      L34DE
            DW      L1E6D
            DW      L3BA6
            DW      L3BBD
            DW      L3BA3
            DW      L3BA1
            DW      L3BA1
L0200:      DW      L3BA1
            DW      L1FC0
            DW      L3BA3
            DW      HCLS
            DW      L4D08
            DW      L4D13
            DW      L4694
            DW      L46CE
            DW      L4F52
            DW      L4BE9
            DW      L5036
            DW      L47E7
            DW      L4629
            DW      L14AE
            DW      DSMODE
            DW      DPALBK
            DW      DPALST
            DW      DWIND
            DW      DCOLOR
            DW      DGCOL
            DW      L458E
            DW      L4D2D
L022C:      DW      0F5E3H
            DW      L237E
            DW      L21E5
            DW      IOSVCT
            ADD     A,A
            ADD     A,L
            JR      NC,L0239            ; (+001H)
            INC     H
L0239:      LD      L,A
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
L023E:      LD      (00245H),HL
            POP     HL
            POP     AF
            EX      (SP),HL
            JP      L0000

_IOCALL:    PUSH    HL
            PUSH    DE
            LD      (00253H),IX
            LD      IX,IOERR
            OR      A
            CALL    L0000
            POP     DE
            POP     HL
            RET     NC
L0258:      OR      A
            SCF     
            RET     Z
            JP      IOERR

ASCHL:      PUSH    HL
            PUSH    BC
            PUSH    DE
            LD      DE,L2710
            CALL    L0284
            LD      DE,003E8H
            CALL    L0284
            LD      DE,00064H
            CALL    L0284
            LD      DE,0000AH
            CALL    L0284
            LD      A,L
            POP     DE
            OR      030H
            LD      (DE),A
            INC     DE
L027F:      XOR     A
            LD      (DE),A
            POP     BC
            POP     HL
            RET     

L0284:      LD      A,0FFH
L0286:      INC     A
            OR      A
            SBC     HL,DE
            JR      NC,L0286            ; (-006H)
            ADD     HL,DE
            OR      A
            JR      NZ,L0293            ; (+003H)
            OR      B
            RET     Z
            XOR     A
L0293:      LD      B,001H
            OR      030H
            POP     DE
            EX      (SP),HL
            LD      (HL),A
            INC     HL
            EX      (SP),HL
            PUSH    DE
            RET     

DEASC:      CALL    TEST1
            DB      024H
            JR      Z,DEHEX             ; (+02aH)
            LD      DE,L0000
L02A7:      CALL    HLFTCH
            SUB     030H
            CP      00AH
            RET     NC
            INC     HL
            PUSH    HL
            LD      H,D
            LD      L,E
            ADD     HL,HL
            JR      C,L02C9             ; (+013H)
            ADD     HL,HL
            JR      C,L02C9             ; (+010H)
            ADD     HL,DE
            JR      C,L02C9             ; (+00dH)
            ADD     HL,HL
            JR      C,L02C9             ; (+00aH)
            LD      E,A
            LD      D,000H
            ADD     HL,DE
            JR      C,L02C9             ; (+004H)
            EX      DE,HL
            POP     HL
            JR      L02A7               ; (-022H)

L02C9:      LD      A,002H
            JP      ERRORJ

DEHEX:      LD      DE,L0000
L02D1:      LD      A,(HL)
            CALL    CKHEX
            RET     C
            INC     HL
            EX      DE,HL
            ADD     HL,HL
            JR      C,L02C9             ; (-012H)
            ADD     HL,HL
            JR      C,L02C9             ; (-015H)
            ADD     HL,HL
            JR      C,L02C9             ; (-018H)
            ADD     HL,HL
            JR      C,L02C9             ; (-01bH)
            ADD     A,L
            LD      L,A
            EX      DE,HL
            JR      L02D1               ; (-018H)

CKHEX:      SUB     030H
            CP      00AH
            CCF     
            RET     NC
            SUB     011H
            CP      006H
            CCF     
            RET     C
            ADD     A,00AH
            RET     

MHALT:      CALL    L0305
            CP      020H
            RET     NZ
L02FE:      CALL    L0305
            OR      A
            JR      Z,L02FE             ; (-006H)
            RET     

L0305:      RST     018H
            DB      00EH
            JR      Z,L0310             ; (+007H)
            LD      A,0FFH
            RST     018H
            DB      00DH
            CP      01BH
            RET     NZ
L0310:      JP      BREAKZ

            RET     

SETDFL:     LD      (DDEV),DE
            LD      (L1069),A
            RET     

ADDP0:      LD      HL,(L1072)
            ADD     HL,DE
            LD      (L1072),HL
ADDP1:      LD      HL,(L1074)
            ADD     HL,DE
            LD      (L1074),HL
ADDP2:      LD      HL,(L1076)
            ADD     HL,DE
            LD      (L1076),HL
            LD      HL,(L1078)
            ADD     HL,DE
            LD      (L1078),HL
            LD      HL,(L107A)
            ADD     HL,DE
            LD      (L107A),HL
            RET     

ERRX:       LD      C,A
            RST     018H
            DB      020H
            RST     018H
            DB      002H
            BIT     7,C
            JR      Z,L0353             ; (+00aH)
            LD      HL,L11A4
            PUSH    HL
            CALL    SETDNM
            POP     DE
            RST     018H
            DB      005H
L0353:      LD      A,C
            AND     07FH
            LD      C,A
            RST     018H
            DB      010H
            OUT     (LSE3),A
            JR      L035F               ; (+002H)

L035D:      LD      C,045H
L035F:      LD      DE,ERRTXT
L0362:      DEC     C
            JR      Z,L036F             ; (+00aH)
L0365:      LD      A,(DE)
            INC     DE
            OR      A
            JP      P,L0365
            JR      Z,L035D             ; (-010H)
            JR      L0362               ; (-00dH)

L036F:      LD      A,(DE)
            CP      080H
            JR      Z,L035D             ; (-017H)
            EX      DE,HL
            LD      DE,L11A4
L0378:      LD      A,(HL)
            OR      A
            JP      M,L0381
            LDI     
            JR      L0378               ; (-009H)

L0381:      AND     07FH
            LD      (DE),A
            OUT     (LSE1),A
            RST     018H
            DB      011H
            INC     DE
            LD      HL,L03B6
            LD      B,008H
            CALL    LDDEHL
            LD      DE,L11A4
            RST     018H
            DB      005H
            RET     

SETDNM:     LD      DE,(ZEQT)
            INC     DE
            INC     DE
            RST     018H
            DB      017H
            CALL    LDHLDE
            LD      A,(L1046)
            ADD     A,031H
            LD      (HL),A
            LD      A,(L1051)
            AND     00FH
            JR      Z,L03B0             ; (+001H)
            INC     HL
L03B0:      LD      (HL),03AH
            INC     HL
            LD      (HL),000H
            RET     

L03B6:      JR      NZ,L03BD            ; (+005H)
            LD      B,L
            LD      D,D
            LD      D,D
            LD      C,A
            LD      D,D
L03BD:      NOP     
DSMODE:     CALL    PUSHR
            LD      B,A
            LD      A,(L1099)
            OR      A
            LD      A,B
            JR      NZ,L03D1            ; (+008H)
            CP      002H
            JR      Z,L0417             ; (+04aH)
            CP      004H
            JR      Z,L0417             ; (+046H)
L03D1:      PUSH    AF
            DEC     A
            LD      D,0FFH
            LD      HL,L1389
            LD      BC,00403H
            JR      Z,L03F7             ; (+01aH)
            DEC     A
            LD      HL,L138D
            LD      BC,L100F
            JR      Z,L03F7             ; (+011H)
            DEC     A
L03E7:      LD      HL,L1385
            LD      BC,00201H
            JR      Z,L03F7             ; (+008H)
            LD      HL,L1389
L03F2:      LD      BC,L0805
            LD      D,0FDH
L03F7:      LD      (0109CH),BC
            LD      A,D
            LD      (L109E),A
            LD      (L137F),HL
            CALL    PALOFF
            POP     AF
            DEC     A
            RLCA    
            LD      (L1098),A
            OUT     (LSDMD),A
            AND     004H
            CALL    DWIDTH
            CALL    L0419
            OR      A
            RET     

L0417:      SCF     
            RET     

L0419:      LD      HL,$IOCS
            CALL    DWIND
            LD      A,(0109CH)
            LD      (L109B),A
            XOR     A
            CALL    DPALBK
            LD      HL,L137F
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            EX      DE,HL
            LD      DE,L1381
            PUSH    DE
            LD      BC,00004H
            LDIR    
            POP     HL
L043A:      LD      B,004H
            LD      C,LSPAL
L043E:      OTIR    
            RET     

PALOFF:     PUSH    BC
            XOR     A
            LD      B,005H
            LD      C,LSPAL
L0447:      OUT     (C),A
            ADD     A,010H
            DJNZ    L0447               ; (-006H)
            POP     BC
            RET     

DPALBK:     CALL    PUSHR
            LD      (L137E),A
            LD      E,A
            LD      A,(L1098)
            CP      002H
            JR      NZ,L0470            ; (+013H)
            LD      A,E
            RLCA    
            RLCA    
            LD      HL,L1381
            LD      B,004H
            PUSH    HL
L0466:      LD      (HL),A
            ADD     A,011H
            INC     HL
            DJNZ    L0466               ; (-006H)
            POP     HL
            CALL    L043A
L0470:      LD      A,E
            OR      040H
            OUT     (LSPAL),A
            RET     

DPALST:     CALL    PUSHR
            LD      HL,L1381
            LD      D,000H
            LD      E,A
            ADD     HL,DE
            OR      A
            RLCA    
            RLCA    
            RLCA    
            RLCA    
            OR      B
            LD      (HL),A
            OUT     (LSPAL),A
            RET     

DCOLOR:     PUSH    AF
            CALL    COLS
            LD      (L109B),A
            POP     AF
            RET     

DGCOL:      PUSH    AF
            CALL    COLS
            LD      (L109F),A
            POP     AF
            RET     

COLS:       PUSH    BC
            LD      B,A
            LD      A,(L1098)
            CP      006H
            LD      A,B
            JR      NZ,L04AC            ; (+006H)
            CP      002H
            JR      C,L04AC             ; (+002H)
            ADD     A,002H
L04AC:      POP     BC
            RET     

DWIND:      CALL    PUSHR
            LD      (L136F),HL
            LD      A,H
            SUB     L
            INC     A
            LD      (L1371),A
            LD      B,A
            ADD     A,A
            ADD     A,A
            ADD     A,B
            LD      (L1374),A
            EX      DE,HL
            LD      H,000H
            LD      L,A
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      (L1377),HL
            EX      DE,HL
            INC     H
            LD      A,H
            ADD     A,A
            ADD     A,A
            ADD     A,H
            LD      (L1376),A
            LD      A,L
            ADD     A,A
            ADD     A,A
            ADD     A,L
            LD      (L1375),A
            LD      HL,L0000
            LD      (L1372),HL
            LD      HL,L1376
            LD      BC,L06CF
            OTDR    
            CALL    HCLS
            JP      L0992

DWIDTH:     CALL    PUSHR
L04F2:      OR      A
            LD      A,028H
            LD      DE,L2300
            JR      Z,L04FE             ; (+004H)
            ADD     A,A
            LD      DE,00023H
L04FE:      LD      (L136B),A
            LD      H,000H
            LD      L,A
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      (L136D),HL
            DEC     A
            LD      (L136A),A
            LD      A,D
            LD      (L0535),A
            LD      (L0536),A
            LD      (L0547),A
            LD      A,E
            LD      (L053E),A
            LD      (L053F),A
            LD      (L054B),A
            LD      BC,00B07H
            LD      HL,L054F
            CALL    PATCH
            CALL    L45D0
            JP      HCLS

PATCH:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
L0535:      INC     HL
L0536:      INC     HL
            LD      A,(HL)
            INC     HL
            LD      (DE),A
            INC     DE
            LD      A,(HL)
            INC     HL
            LD      (DE),A
L053E:      NOP     
L053F:      NOP     
            DJNZ    PATCH               ; (-011H)
            LD      B,C
L0543:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
L0547:      INC     HL
            LD      A,(HL)
            INC     HL
            LD      (DE),A
L054B:      NOP     
            DJNZ    L0543               ; (-00bH)
            RET     

L054F:      DB      0E6H,005H,050H,000H,028H,000H,03DH,006H,0CBH,021H ; CHTBL - CRT driver 40/80-column patch table
            DS      2, 000H
            DB      067H,006H,090H,001H,0C8H,000H,06AH,006H,080H,0BEH,040H,09FH,020H,007H,050H,000H,028H,000H,048H,007H,030H,002H,018H,001H,0C3H,007H,050H,000H,028H,000H,0E9H,007H,0B0H,0FFH,0D8H,0FFH,015H,008H
            DB      LSD0
            DB      0FDH,0E8H,0FEH,02AH,008H,050H,000H,028H,000H,0D5H,008H,07FH,002H,03FH,001H
            DB      LSE5
            DB      006H,04FH,027H,00EH,007H,04FH,027H,0B4H,007H,"O'%",008H,"O'Y",008H,"P(r",009H,029H,000H,089H,009H,029H,000H
ACCDI:      CALL    PUSHRA
            LD      HL,(L1084)
            LD      C,A
            CP      020H
            JR      NZ,L05B9            ; (+001H)
            XOR     A
L05B9:      LD      (HL),A
            LD      HL,(L1086)
            LD      A,C
            CALL    BITMAP
            XOR     A
            LD      (009E2H),A
            CALL    L09D4
            LD      A,007H
            LD      (009E2H),A
            RET     

BITMAP:     RST     018H
            DB      01DH
            DI      
            EXX     
            PUSH    HL
            LD      H,000H
            LD      L,A
            LD      A,(L109B)
            OR      080H
            OUT     (LSWF),A
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            SET     4,H
            EXX     
            LD      B,008H
            LD      DE,00028H
            IN      A,(LSE0)
L05EA:      EXX     
            LD      A,(HL)
            INC     HL
            EXX     
            LD      (HL),A
            ADD     HL,DE
            DJNZ    L05EA               ; (-008H)
            IN      A,(LSE1)
            EI      
            EXX     
            POP     HL
            EXX     
            RET     

LBOUND:     CALL    TBCALC
L05FC:      LD      A,(HL)
            OR      A
            JR      Z,L0608             ; (+008H)
            DEC     HL
            DEC     E
            LD      A,(L136F)
            CP      E
            JR      C,L05FC             ; (-00cH)
L0608:      LD      D,E
L0609:      INC     E
            INC     HL
            LD      A,(HL)
            OR      A
            RET     Z
            LD      A,(YE)
            CP      E
            JR      NC,L0609            ; (-00bH)
            RET     

TBCALC:     LD      E,H
            LD      D,000H
            LD      HL,L13A9
            ADD     HL,DE
            RET     

HCLSW:      CALL    PUSHR
            LD      A,(L136F)
            LD      H,A
            CALL    TBCALC
            LD      A,(L1371)
            LD      B,A
            LD      E,A
            CALL    ?CLRHL
            LD      C,E
            LD      A,(YE)
            INC     A
            LD      L,000H
            LD      H,A
            PUSH    HL
            CALL    PONT
            LD      B,000H
            NOP     
L063E:      NOP     
            PUSH    BC
            CALL    PUSHW
            POP     HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      C,L
            LD      B,H
            POP     HL
            CALL    PONTB
            CALL    PUSHW
            JR      L06AC               ; (+05aH)

HCLS:       CALL    PUSHRA
            LD      HL,L27D0
            LD      BC,00032H
            CALL    PUSHW
            LD      B,019H
            LD      HL,L13A9
            CALL    ?CLRHL
            LD      BC,000C8H
            LD      HL,L9F40
            CALL    PUSHW
            JR      L06AC               ; (+03bH)

PUSHW:      LD      (006A3H),SP
            LD      (00684H),HL
            LD      HL,L0000
            LD      A,(0109CH)
            OR      080H
            OUT     (LSWF),A
L0682:      DI      
            LD      SP,L0000
            IN      A,(LSE0)
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            PUSH    HL
            IN      A,(LSE1)
            LD      (00684H),SP
            LD      SP,L0000
            EI      
            DEC     BC
            LD      A,C
            OR      B
            JR      NZ,L0682            ; (-029H)
            RET     

L06AC:      LD      HL,L0000
            LD      (L1372),HL
            LD      B,002H
            LD      C,LSSCR
            OUT     (C),H
            DEC     B
            OUT     (C),L
            JP      L0992

L06BE:      EXX     
            PUSH    HL
            PUSH    DE
            PUSH    BC
            EXX     
            CALL    L06CC
            EXX     
            POP     BC
            POP     DE
            POP     HL
            EXX     
            RET     

L06CC:      LD      HL,(L1082)
L06CF:      DEC     L
            JP      P,L06E6
            CALL    TBCALC
            LD      A,(HL)
            LD      H,E
            LD      L,000H
            OR      A
            JR      Z,L06E6             ; (+009H)
            LD      A,(L136F)
            CP      H
            JR      Z,L06E6             ; (+003H)
            DEC     H
            LD      L,027H
L06E6:      LD      (L1082),HL
            CALL    L0822
            CALL    PONTC
            PUSH    BC
            LD      D,H
            LD      E,L
            INC     HL
            EXX     
            PUSH    HL
            EXX     
            POP     BC
            LDIR    
            XOR     A
            LD      (DE),A
            POP     BC
            LD      HL,(L1082)
            INC     HL
            CALL    PONTB
L0703:      EXX     
            LD      D,009H
            LD      HL,(0109DH)
            DEC     D
            EXX     
            JR      L0723               ; (+016H)

L070D:      LD      C,027H
            DEC     B
            JR      Z,L0755             ; (+043H)
            INC     DE
            INC     DE
            LD      H,D
            LD      L,E
            JR      L0703               ; (-015H)

L0718:      LD      HL,(0109DH)
            DEC     D
            EXX     
            JR      Z,L070D             ; (-012H)
            LD      DE,00028H
            ADD     HL,DE
L0723:      EXX     
            RRC     L
            JR      C,L0718             ; (-010H)
            LD      A,L
            AND     H
            EXX     
            JR      Z,L0723             ; (-00aH)
            DI      
            PUSH    HL
            PUSH    BC
            OUT     (LSRF),A
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
            LD      D,H
            LD      E,L
            DEC     DE
            LD      A,C
            OR      A
            JR      Z,L0747             ; (+008H)
            LD      A,B
            LD      B,000H
            LDIR    
            DEC     A
            JR      Z,L074D             ; (+006H)
L0747:      LD      BC,00118H
            ADD     HL,BC
            LD      A,(HL)
            LD      (DE),A
L074D:      IN      A,(LSE1)
            EI      
            POP     BC
            POP     HL
            JP      L0723

L0755:      EX      DE,HL
            INC     C
            LD      E,C
            LD      D,B
            LD      B,008H
            DI      
            IN      A,(LSE0)
            OUT     (LSE0),A
            LD      A,(0109CH)
            OR      080H
            OUT     (LSWF),A
L0767:      XOR     A
            LD      (HL),A
            SBC     HL,DE
            DJNZ    L0767               ; (-006H)
            IN      A,(LSE1)
            EI      
            LD      HL,(L1082)
            JP      CURMOV

L0776:      EXX     
            PUSH    HL
            PUSH    DE
            PUSH    BC
            EXX     
            CALL    L0784
            EXX     
            POP     BC
            POP     DE
            POP     HL
            EXX     
            RET     

L0784:      LD      HL,(L1082)
            CALL    L0822
            PUSH    HL
            CALL    PONT
            DEC     HL
            LD      A,(HL)
            OR      A
            JR      NZ,L07AE            ; (+01bH)
            PUSH    BC
            LD      D,H
            LD      E,L
            DEC     HL
            EXX     
            PUSH    HL
            EXX     
            POP     BC
            LDDR    
            XOR     A
            LD      (DE),A
            POP     BC
            POP     HL
            CALL    PONTB
            DEC     HL
            LD      A,C
            LD      (007BBH),A
            DEC     B
            JR      Z,L07BC             ; (+010H)
            JR      L07B3               ; (+005H)

L07AE:      POP     HL
            RET     

L07B0:      DEC     B
            JR      Z,L07BA             ; (+007H)
L07B3:      LD      C,027H
            CALL    L07DC
            JR      L07B0               ; (-00aH)

L07BA:      LD      C,000H
L07BC:      CALL    L07DC
            CALL    PONTCB
            LD      DE,00028H
            LD      B,008H
            DI      
            LD      A,(0109CH)
            OR      080H
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
L07D3:      XOR     A
            LD      (HL),A
            ADD     HL,DE
            DJNZ    L07D3               ; (-005H)
            IN      A,(LSE1)
            EI      
            RET     

L07DC:      EXX     
            LD      D,009H
L07DF:      LD      HL,(0109DH)
            DEC     D
            EXX     
            RET     Z
            CALL    L07EF
            LD      DE,0FFD8H
            ADD     HL,DE
            EXX     
            JR      L07DF               ; (-010H)

L07EF:      EXX     
            RRC     L
            LD      A,L
            EXX     
            RET     C
            EXX     
            AND     H
            EXX     
            JR      Z,L07EF             ; (-00bH)
            PUSH    HL
            PUSH    BC
            DI      
            OUT     (LSRF),A
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
L0805:      LD      D,H
            LD      E,L
            DEC     HL
L0808:      LD      A,C
            OR      A
            JR      Z,L0814             ; (+008H)
            LD      A,B
            LD      B,000H
            LDDR    
            OR      A
            JR      Z,L081A             ; (+006H)
L0814:      LD      BC,0FEE8H
            ADD     HL,BC
            LD      A,(HL)
            LD      (DE),A
L081A:      IN      A,(LSE1)
            EI      
            POP     BC
            POP     HL
            JP      L07EF

L0822:      LD      B,001H
            LD      A,027H
            SUB     L
            LD      C,A
            EXX     
            LD      DE,00028H
            LD      H,000H
            LD      L,A
            EXX     
L0830:      INC     H
            LD      A,(YE)
            CP      H
            JR      C,L0845             ; (+00eH)
            CALL    TBCALC
            LD      A,(HL)
            OR      A
            LD      H,E
            JR      Z,L0845             ; (+006H)
            INC     B
            EXX     
            ADD     HL,DE
            EXX     
            JR      L0830               ; (-015H)

L0845:      LD      L,000H
            RET     

L0848:      CALL    PUSHRA
            LD      A,(L136F)
            LD      H,A
            LD      L,000H
            CALL    PONT
            LD      D,H
            LD      E,L
            LD      B,000H
            LD      C,028H
            ADD     HL,BC
            LD      A,(L1371)
            DEC     A
            JR      Z,L0870             ; (+00fH)
            PUSH    BC
            PUSH    HL
            LD      HL,L0000
L0866:      ADD     HL,BC
            DEC     A
            JR      NZ,L0866            ; (-004H)
            LD      B,H
            LD      C,L
            POP     HL
            LDIR    
            POP     BC
L0870:      LD      B,C
            CALL    ?CLRDE
            LD      A,(L136F)
            LD      H,A
            CALL    TBCALC
            LD      A,(L1371)
            DEC     A
            LD      B,A
            LD      (HL),000H
            INC     HL
            LD      D,H
            LD      E,L
            INC     DE
            CALL    NZ,LDHLDE
            LD      (HL),000H
            LD      A,(YE)
            LD      H,A
            LD      L,000H
            CALL    PONTB
            LD      (008CDH),HL
            LD      DE,00028H
            LD      HL,(L1372)
            ADD     HL,DE
            PUSH    HL
            LD      DE,(01377H)
            OR      A
            SBC     HL,DE
            POP     HL
            JR      NZ,L08AC            ; (+003H)
            LD      HL,L0000
L08AC:      LD      (L1372),HL
L08AF:      IN      A,(LSDMD)
            AND     040H
            JR      NZ,L08AF            ; (-006H)
            DI      
            LD      C,LSSCR
            LD      B,002H
            OUT     (C),H
            DEC     B
            OUT     (C),L
            LD      A,(L109B)
            OUT     (LSRF),A
            OR      080H
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
            LD      HL,L0000
            LD      (HL),000H
            LD      D,H
            LD      E,L
            INC     DE
            LD      BC,L013F
            LDIR    
            IN      A,(LSE1)
            EI      
            LD      A,(YE)
            LD      H,A
            LD      L,000H
            JP      CURMOV

L08E5:      CALL    PUSHRA
            EXX     
            PUSH    HL
            LD      HL,L1391
            LD      A,(L108D)
            OR      A
            JR      Z,L08FC             ; (+009H)
            LD      HL,L1399
            DEC     A
            JR      Z,L08FC             ; (+003H)
            LD      HL,L13A1
L08FC:      EXX     
            DI      
            LD      A,(L108C)
            XOR     001H
            LD      (L108C),A
            LD      HL,(L1086)
            LD      D,000H
            LD      A,(L136B)
            LD      E,A
            LD      B,008H
            LD      A,(L109B)
            OR      020H
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
L091C:      EXX     
            LD      A,(HL)
            INC     HL
            EXX     
            LD      (HL),A
            ADD     HL,DE
            DJNZ    L091C               ; (-008H)
            IN      A,(LSE1)
            EXX     
            POP     HL
            EXX     
            EI      
            RET     

HCURON:     CALL    PUSHRA
            XOR     A
            OUT     (LSD0),A
            CPL     
            OUT     (LSD0),A
            LD      A,(L108C)
            OR      A
            RET     NZ
            JR      L08E5               ; (-056H)

HCUROF:     CALL    PUSHRA
            LD      A,(L108C)
            OR      A
            RET     Z
            JR      L08E5               ; (-060H)

FLASH:      IN      A,(LSD2)
            RLCA    
            RLCA    
            JR      NC,HCURON           ; (-020H)
            JR      HCUROF              ; (-012H)

CURMOV:     CALL    PUSHR
            LD      (L1082),HL
            CALL    PONT
            LD      (L1084),HL
            CALL    PONTCB
            LD      (L1086),HL
            RET     

PONTC:      LD      HL,(L1082)
PONT:       PUSH    DE
            PUSH    AF
            LD      D,020H
            LD      E,L
            LD      A,H
            ADD     A,A
            ADD     A,A
            ADD     A,H
            LD      L,A
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            NOP     
            ADD     HL,DE
            POP     AF
            POP     DE
            RET     

PONTCB:     LD      HL,(L1082)
PONTB:      PUSH    DE
            PUSH    AF
            LD      D,H
            LD      E,000H
            LD      A,L
            LD      L,H
            LD      H,E
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,DE
            NOP     
            CALL    ADDHLA
            SET     7,H
            POP     AF
            POP     DE
            RET     

L0992:      LD      L,000H
            LD      A,(L136F)
            LD      H,A
            JP      L09F6

L099B:      CALL    PUSHR
            LD      HL,(L1082)
            LD      A,L
            OR      A
            JR      NZ,L09AB            ; (+006H)
            CALL    TBCALC
            LD      A,(HL)
            OR      A
            RET     Z
L09AB:      LD      A,00DH
            JP      L0E61

L09B0:      XOR     A
            LD      (00DABH),A
            LD      HL,(L1082)
            PUSH    HL
            INC     H
            CALL    TBCALC
            LD      A,(YE)
            LD      D,A
L09C0:      LD      A,(HL)
            OR      A
            JR      Z,L09CA             ; (+006H)
            INC     HL
            INC     E
            LD      A,D
            CP      E
            JR      NC,L09C0            ; (-00aH)
L09CA:      DEC     E
            POP     HL
            LD      H,E
            JR      L09DE               ; (+00fH)

L09CF:      LD      HL,(L1082)
            JR      L09E0               ; (+00cH)

L09D4:      LD      HL,(L1082)
            INC     L
            LD      A,(L136A)
            CP      L
            JR      NC,L09F6            ; (+018H)
L09DE:      LD      L,000H
L09E0:      INC     H
            JR      L09EA               ; (+007H)

            PUSH    HL
            CALL    TBCALC
            LD      (HL),001H
            POP     HL
L09EA:      LD      A,(YE)
            CP      H
            JR      NC,L09F6            ; (+006H)
            LD      H,A
            PUSH    HL
L09F2:      CALL    L0848
            POP     HL
L09F6:      JP      CURMOV

L09F9:      LD      HL,(L1082)
            JR      L0A09               ; (+00bH)

L09FE:      LD      HL,(L1082)
            LD      A,L
            OR      A
            JR      NZ,00A14H            ; (+00fH)
            LD      A,(L136A)
            LD      L,A
L0A09:      LD      A,(L136F)
            CP      H
            JR      C,00A16H             ; (+007H)
            LD      A,(L136F)
            LD      H,A
            LD      A,02DH
            LD      A,025H
            JR      L09F6               ; (-023H)

L0A19:      XOR     A
            LD      HL,?SETDE
            LD      HL,L023E
            LD      (L108D),A
            RET     

L0A24:      LD      B,000H
            LD      HL,(L1082)
            INC     L
            LD      A,L
L0A2B:      INC     B
            SUB     00AH
            JR      NC,L0A2B            ; (-005H)
            XOR     A
L0A31:      ADD     A,00AH
            DJNZ    L0A31               ; (-004H)
            LD      L,A
            LD      A,(L136A)
            CP      L
            RET     C
            PUSH    HL
            LD      A,(L108F)
            OR      A
            JR      Z,L0A54             ; (+012H)
            LD      A,(L1082)
            LD      H,A
            LD      A,L
            SUB     H
            JR      Z,L0A54             ; (+00aH)
            LD      B,A
L0A4B:      PUSH    BC
            LD      A,020H
            CALL    L0EBF
            POP     BC
            DJNZ    L0A4B               ; (-009H)
L0A54:      POP     HL
            JP      CURMOV

PRNTT:      CALL    L0E5F
            LD      A,(L1082)
L0A5E:      SUB     00AH
            JR      NC,L0A5E            ; (-004H)
            ADD     A,00AH
            RET     Z
            JR      PRNTT               ; (-00fH)

BINPUT:     PUSH    HL
            LD      HL,(L1082)
            PUSH    HL
            PUSH    DE
            CALL    TBCALC
            POP     DE
            LD      (HL),000H
            POP     HL
            CALL    GETL
            JR      C,L0A82             ; (+009H)
            LD      A,L
            OR      A
            JR      Z,L0A82             ; (+005H)
            LD      H,000H
            ADD     HL,DE
            EX      DE,HL
            OR      A
L0A82:      POP     HL
            RET     

GETL:       PUSH    BC
            PUSH    HL
            PUSH    DE
L0A87:      CALL    INKEY1
            CP      00DH
            JP      Z,L0ABB
            CP      01BH
            JR      Z,L0AB4             ; (+021H)
            PUSH    AF
            LD      A,(L108D)
            CP      002H
            JR      NZ,L0AAF            ; (+014H)
            POP     AF
            CP      017H
            JR      NC,L0AB0            ; (+010H)
            CP      011H
            JR      C,L0AB0             ; (+00cH)
            LD      HL,(00D31H)
            BIT     6,L
            JR      Z,L0AB0             ; (+005H)
            RST     018H
            DB      004H
            JR      L0A87               ; (-028H)

L0AAF:      POP     AF
L0AB0:      RST     018H
            DB      003H
            JR      L0A87               ; (-02dH)

L0AB4:      SCF     
L0AB5:      RST     018H
            DB      001H
            POP     DE
            POP     HL
            POP     BC
            RET     

L0ABB:      LD      HL,(L1082)
            CALL    LBOUND
            LD      A,E
            SUB     D
            LD      E,A
            LD      H,D
            LD      L,000H
            CALL    PONT
            LD      A,(L136B)
            LD      D,A
            POP     BC
            PUSH    BC
            EXX     
            PUSH    HL
            LD      HL,(L1364)
            EXX     
L0AD6:      LD      A,(HL)
            INC     HL
            LD      (BC),A
            INC     BC
            EXX     
            DEC     L
            JR      Z,L0AEA             ; (+00cH)
            EXX     
            DEC     D
            JR      NZ,L0AD6            ; (-00cH)
            LD      A,(L136B)
            LD      D,A
            DEC     E
            JR      NZ,L0AD6            ; (-013H)
            EXX     
L0AEA:      POP     HL
            EXX     
            XOR     A
            LD      (BC),A
            LD      L,C
            LD      H,B
            POP     DE
            PUSH    DE
            PUSH    HL
            OR      A
            SBC     HL,DE
            LD      B,L
            POP     HL
            LD      A,020H
            LD      D,A
            JP      Z,L0AB5
            DEC     HL
L0AFF:      LD      A,(HL)
            OR      A
            JR      Z,L0B08             ; (+005H)
            CP      D
            JR      NZ,L0B0D            ; (+007H)
            LD      (HL),000H
L0B08:      DEC     HL
            DJNZ    L0AFF               ; (-00cH)
            JR      L0B16               ; (+009H)

L0B0D:      LD      A,(HL)
            OR      A
            JR      NZ,L0B13            ; (+002H)
            LD      (HL),020H
L0B13:      DEC     HL
            DJNZ    L0B0D               ; (-009H)
L0B16:      OR      A
            JP      L0AB5

INKEY$:     INC     A
            JR      Z,INKEYF            ; (+06eH)
            DEC     A
            JP      Z,INKEY0
INKEY1:     CALL    L0BAB
            CALL    PUSHR
            CALL    HCURON
            EX      AF,AF'
            PUSH    AF
            CALL    L0BC1
            LD      A,(L0D44)
L0B32:      EX      AF,AF'
L0B33:      LD      B,010H
L0B35:      CALL    FLASH
            CALL    L0BC1
            BIT     1,A
            JR      NZ,L0B33            ; (-00cH)
            DJNZ    L0B35               ; (-00cH)
            BIT     0,A
            JR      Z,L0B51             ; (+00cH)
            BIT     2,A
            JR      NZ,L0B62            ; (+019H)
            EX      AF,AF'
            DEC     A
            JR      NZ,L0B32            ; (-01bH)
            LD      A,006H
            JR      L0B64               ; (+013H)

L0B51:      PUSH    HL
            PUSH    DE
            PUSH    BC
            LD      HL,L0D3A
            LD      DE,L0D30
            LD      BC,0000AH
            LDIR    
            POP     BC
            POP     DE
            POP     HL
L0B62:      LD      A,040H
L0B64:      LD      (L0D44),A
L0B67:      CALL    FLASH
            CALL    L0BF6
            OR      A
            JR      Z,L0B7B             ; (+00bH)
            LD      (L1365),A
            LD      C,A
            CALL    HCUROF
            POP     AF
            EX      AF,AF'
            LD      A,C
            RET     

L0B7B:      PUSH    HL
            PUSH    BC
            LD      B,00AH
            LD      HL,L0D30
L0B82:      LD      (HL),0FFH
            INC     HL
            DJNZ    L0B82               ; (-005H)
            POP     BC
            POP     HL
            JR      L0B67               ; (-024H)

INKEYF:     CALL    L0BAB
            PUSH    HL
            CALL    L0BF6
            LD      HL,L1365
            OR      A
            JR      Z,L0B9E             ; (+006H)
            CP      (HL)
            JR      NZ,L0B9E            ; (+003H)
            POP     HL
            XOR     A
            RET     

L0B9E:      LD      (HL),A
            POP     HL
            RET     

INKEY0:     CALL    L0BAB
            CALL    L0BF6
            LD      (L1365),A
            RET     

L0BAB:      PUSH    HL
            LD      HL,(L1352)
            LD      A,L
            CP      H
            POP     HL
            RET     Z
            EX      (SP),HL
            INC     A
            LD      (L1352),A
            LD      HL,L1353
            CALL    ADDHLA
            LD      A,(HL)
            POP     HL
            RET     

L0BC1:      CALL    PUSHR
            LD      DE,L0D3A
            LD      HL,L0D30
            LD      BC,00A00H
            DI      
L0BCE:      LD      A,B
            ADD     A,0EFH
            OUT     (LSD0),A
            CP      0F8H
            IN      A,(LSD1)
            JR      NZ,L0BDB            ; (+002H)
            OR      07FH
L0BDB:      CP      0FFH
            JR      Z,L0BE1             ; (+002H)
            SET     0,C
L0BE1:      EX      DE,HL
            CP      (HL)
            LD      (HL),A
            EX      DE,HL
            JR      Z,L0BE9             ; (+002H)
            SET     1,C
L0BE9:      CPL     
            AND     (HL)
            JR      Z,L0BEF             ; (+002H)
            SET     2,C
L0BEF:      INC     HL
            INC     DE
            DJNZ    L0BCE               ; (-025H)
            LD      A,C
L0BF4:      EI      
            RET     

L0BF6:      CALL    PUSHR
            LD      HL,L0D30
            LD      DE,L0D3A
            PUSH    HL
            PUSH    DE
            LD      BC,0000AH
            LDIR    
            POP     HL
            POP     DE
            LD      BC,00AF9H
            DI      
            LD      A,C
            OUT     (LSD0),A
            NOP     
            IN      A,(LSD1)
            LD      (DE),A
L0C13:      LD      A,C
            OUT     (LSD0),A
            CP      0F8H
            IN      A,(LSD1)
            LD      (DE),A
            JR      Z,L0C3E             ; (+021H)
            CPL     
            AND     (HL)
L0C1F:      LD      (HL),A
            INC     DE
            INC     HL
            DEC     C
            DJNZ    L0C13               ; (-012H)
            EI      
            LD      BC,00A00H
L0C29:      DEC     HL
            LD      A,(HL)
            OR      A
            JR      NZ,L0C68            ; (+03aH)
            INC     C
            DJNZ    L0C29               ; (-008H)
            LD      B,00AH
L0C33:      DEC     DE
            LD      A,(DE)
            CP      0FFH
            JR      NZ,L0C41            ; (+008H)
L0C39:      DJNZ    L0C33               ; (-008H)
L0C3B:      XOR     A
            JR      L0BF4               ; (-04aH)

L0C3E:      XOR     A
            JR      L0C1F               ; (-022H)

L0C41:      LD      A,B
            CP      002H
            JR      NZ,L0C4F            ; (+009H)
            LD      A,(DE)
            AND     081H
            JR      NZ,L0C39            ; (-012H)
            LD      A,01BH
            JR      L0BF4               ; (-05bH)

L0C4F:      CP      001H
            JR      Z,L0C3B             ; (-018H)
            LD      A,(L0D45)
            CP      B
            JR      NZ,L0C39            ; (-020H)
            LD      A,(DE)
            PUSH    DE
            LD      D,A
            LD      A,(L0D46)
            AND     D
            POP     DE
            JR      NZ,L0C39            ; (-02aH)
            LD      A,(L1365)
            JR      L0BF4               ; (-074H)

L0C68:      PUSH    AF
            LD      A,B
            LD      (L0D45),A
            LD      A,(HL)
            LD      (L0D46),A
            POP     AF
            DEC     B
            JR      NZ,L0CAB            ; (+036H)
            CALL    L0D18
            LD      A,(00D31H)
            BIT     6,A
            JR      Z,L0C3B             ; (-044H)
            BIT     0,A
            LD      A,B
            JR      NZ,L0C86            ; (+002H)
            ADD     A,005H
L0C86:      CP      00AH
            JR      NC,L0C3B            ; (-04fH)
            LD      L,A
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      BC,L12B2
            ADD     HL,BC
            LD      A,(HL)
            OR      A
            JR      Z,L0C3B             ; (-05eH)
            LD      DE,L1352
            LD      A,001H
            LD      (DE),A
            INC     DE
            LD      BC,00010H
            LDIR    
            LD      A,(INBUF)
            JP      L0BF4

L0CAB:      CALL    L0D18
            LD      A,C
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,B
            LD      L,A
            LD      H,000H
            LD      A,(00D31H)
            BIT     6,A
            LD      BC,L0D47
            JR      Z,L0CEF             ; (+02fH)
            PUSH    AF
            LD      A,(L108D)
            CP      001H
            JR      NZ,L0CCC            ; (+004H)
            POP     AF
            XOR     001H
            PUSH    AF
L0CCC:      POP     AF
            BIT     0,A
            JR      NZ,L0CD4            ; (+003H)
            LD      BC,L0D59
L0CD4:      LD      A,(L108D)
            CP      002H
            JR      NZ,L0CE8            ; (+00dH)
            LD      BC,L0D6B
            LD      A,(00D31H)
            BIT     0,A
            JR      Z,L0CE8             ; (+003H)
            LD      BC,L0D7D
L0CE8:      CALL    L3C3E
            LD      A,C
            JP      L0BF4

L0CEF:      CALL    L3C3E
            LD      A,C
            CP      020H
            JP      C,L0BF4
            LD      HL,L0D8F
            LD      B,005H
L0CFD:      CP      (HL)
            JR      Z,L0D12             ; (+012H)
            INC     HL
            DJNZ    L0CFD               ; (-006H)
            CP      040H
            JP      C,L0C3B
            CP      05BH
            JP      NC,L0C3B
            SUB     040H
            JP      L0BF4

L0D12:      LD      A,020H
            SUB     B
            JP      L0BF4

L0D18:      LD      B,008H
L0D1A:      RRCA    
            JR      C,L0D20             ; (+003H)
            DJNZ    L0D1A               ; (-005H)
BRKEY:      RET     

L0D20:      DEC     B
            RET     

L0D22:      LD      A,0E8H
            OUT     (LSD0),A
            NOP     
            IN      A,(LSD1)
            AND     081H
            RET     Z
            RLCA    
            DB      0D8H
            DB      018H
            DB      PSGA
L0D30:      DS      10, 000H
L0D3A:      DS      4, 000H
L0D3E:      DS      6, 000H
L0D44:      DB      000H
L0D45:      DB      000H
L0D46:      DB      001H
L0D47:      DB      0EAH
            DB      00BH
            DB      090H
            DB      017H
            DB      LSFC
            DB      019H,009H,03BH,03AH,00DH,018H,010H,012H,011H,013H,014H,03FH,02FH
L0D59:      DB      02AH,00CH,090H,017H,0FBH,005H,009H,02BH,02AH,00DH,016H,015H,012H,011H,013H,014H,0C6H,05FH
L0D6B:      DB      0E9H
            DB      00CH
            DB      090H
            DB      017H
            DB      068H
            DB      005H
            DB      009H
            DB      084H
            DB      0E9H
            DB      00DH
            DB      016H
            DB      015H
            DB      012H
            DB      011H
            DB      013H
            DB      014H
            DB      08FH
            DB      08BH
L0D7D:      DB      06AH
            DB      00CH
            DB      090H
            DB      017H
            DB      06CH
L0D82:      DB      019H
            DB      009H
            DB      0FEH
            DB      089H
            DB      00DH
            DB      016H
            DB      015H
            DB      012H
            DB      011H
            DB      013H
            DB      014H
            DB      08AH
            DB      07BH
L0D8F:      DB      05BH
            DB      05CH
            LD      E,L
            LD      E,(HL)
            CPL     
L0D94:      CALL    PUSHR
L0D97:      LD      A,(DE)
            INC     DE
            OR      A
            RET     Z
            LD      C,A
            CP      005H
            JR      Z,L0DBE             ; (+01eH)
            CP      006H
            JR      Z,L0DBD             ; (+019H)
            SUB     041H
            CP      01AH
            JR      NC,L0DB6            ; (+00cH)
            LD      A,000H
            OR      A
            JR      Z,L0DB6             ; (+007H)
            LD      HL,L0D82
            LD      B,000H
            ADD     HL,BC
            LD      C,(HL)
L0DB6:      LD      A,C
            RST     018H
            DB      003H
            CP      00DH
            JR      NZ,L0D97            ; (-026H)
L0DBD:      XOR     A
L0DBE:      LD      (00DABH),A
            DB      018H
            DB      0D4H
            DB      0A1H
            DB      09AH
            DB      09FH
            DB      09CH
            DB      092H
            DB      0AAH
            DB      097H
            DB      098H
            DB      0A6H
            DB      0AFH
            DB      0A9H
            DB      0B8H
            DB      0B3H
            DB      0B0H
            DB      0B7H
            DB      09EH
            DB      0A0H
            DB      09DH
            DB      0A4H
            DB      096H
            DB      0A5H
            DB      0ABH
            DB      0A3H
EQTBL:      DB      09BH                ; $CRT / EQTBL - CRT device descriptor
            DB      0BDH
            DB      0A2H
L0DDD:      DB      0F6H,00DH,"CRT",000H,08AH
            DS      2, 000H
            DB      03AH
            DB      045H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      00FH
            DB      00EH
            DB      017H
$KB_:       DB      00EH,026H,00EH,079H,014H,04BH,042H ; $KB - Keyboard device descriptor
            DS      2, 000H
            DB      081H
            DS      2, 000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      00FH
            LD      C,0B2H
            NOP     
            OR      D
            NOP     
            RST     018H
L0E10:      DB      00CH
            LD      A,080H
            RET     C
            RST     018H
            DB      017H
            RET     

            EX      AF,AF'
            LD      HL,L0E61
            LD      A,(L1090)
            OR      A
            JR      Z,L0E24             ; (+003H)
            LD      HL,L0EA2
L0E24:      EX      AF,AF'
            JP      (HL)

            LD      A,(L1082)
            RET     

L0E2A:      LD      A,00DH
L0E2C:      PUSH    AF
            LD      A,(L1091)
            OR      A
            JR      NZ,L0E36            ; (+003H)
            POP     AF
            JR      L0E61               ; (+02bH)

L0E36:      POP     AF
            JP      L14B9

L0E3A:      PUSH    AF
            LD      A,(L1091)
L0E3E:      OR      A
            JR      NZ,L0E44            ; (+003H)
            POP     AF
            JR      L0EA2               ; (+05eH)

L0E44:      POP     AF
            JP      L14E0

L0E48:      CALL    PUSHR
            LD      HL,L0E2C
            JR      L0E56               ; (+006H)

L0E50:      CALL    PUSHR
            LD      HL,L0E61
L0E56:      LD      A,(DE)
            OR      A
            RET     Z
            CALL    .HL
CRT1C:      INC     DE
            JR      L0E56               ; (-009H)

L0E5F:      LD      A,020H
L0E61:      CALL    PUSHRA
L0E64:      LD      C,A
            LD      A,(L108F)
            OR      A
            JR      Z,L0E99             ; (+02eH)
            LD      A,C
            CP      020H
            JR      NC,L0E96            ; (+026H)
            LD      DE,(CURXY)
            LD      HL,(XS)
            CP      014H
            JR      Z,L0E83             ; (+008H)
            CP      012H
            JR      NZ,L0E88            ; (+009H)
            LD      HL,(L136F)
            LD      E,D
L0E83:      LD      A,L
            CP      E
            JP      NC,L003E
L0E88:      LD      HL,L0ED9
            LD      B,000H
            ADD     HL,BC
            LD      A,(HL)
            INC     A
            JR      Z,L0E99             ; (+007H)
            DEC     A
            JP      Z,L003E
L0E96:      CALL    L0EBF
L0E99:      LD      A,C
            CP      020H
            JP      C,L009B
            JP      ACCDI

L0EA2:      CALL    PUSHRA
            LD      C,A
            CP      00DH
            JR      Z,L0E64             ; (-046H)
            CALL    ACCDI
            LD      A,(L108F)
            OR      A
            RET     Z
            LD      A,C
PLTOTX:     CP      011H
            JR      C,L0ED4             ; (+01dH)
            CP      017H
            JR      C,L0ED6             ; (+01bH)
            CP      020H
            JR      C,L0ED4             ; (+015H)
L0EBF:      CP      060H
            JR      C,L0ED6             ; (+013H)
            CP      070H
            JR      C,L0ED4             ; (+00dH)
            CP      0C1H
            JR      C,L0ED6             ; (+00bH)
            CALL    CHKACC
            INC     BC
            RST     010H
            RST     008H
            RST     038H
            JR      Z,L0ED6             ; (+002H)
L0ED4:      DB      03EH
            DB      02EH
L0ED6:      DB      0C3H
            DB      LSPAL
            DB      014H
L0ED9:      DS      4, 000H
            DS      3, 0FFH
            DB      01DH
            DB      000H
            DB      0FFH
            DS      3, 000H
            DB      00DH
            DS      3, 000H
            DB      00AH
            DB      003H
            DB      020H
            DB      00EH
            DS      2, 000H
            DB      0FFH
            DB      000H
            DS      2, 0FFH
            DEC     C
            RST     038H
            NOP     
            NOP     
            NOP     
L0EF9:      DI      
            XOR     A
            OUT     (LSDMD),A
            LD      (L108F),A
            DB      032H
            DB      091H
            DB      010H
            DB      031H
            DS      2, 000H
            DB      0EDH
            DB      05EH
            DB      03EH
            DB      004H
            DB      LSD3
            DB      LSD3
            DB      LSD3
            DB      LSE0
            DB      LSD3
            DB      LSE1
            DB      LSRF
            DB      041H,004H,03EH,00FH,0EDH,047H,03EH,0FEH
            DB      LSD3
            DB      0FDH
            DB      03EH
            DB      00FH
            DB      LSD3
            DB      0FDH
            DB      0C5H
            DB      LSRF
            DB      04EH
            DB      00FH
            DB      LSRF
            DB      0B9H
            LD      B,H
            CALL    L3F58
            POP     BC
L0F2A:      LD      HL,L1E18
            XOR     A
            LD      (L0F2A),A
            LD      D,A
            LD      E,A
            RST     018H
            DB      026H
            LD      DE,$RFS
            LD      A,B
            OR      A
            JR      Z,L0F48             ; (+00cH)
            DEC     A
            JR      Z,L0F48             ; (+009H)
            LD      DE,L3B9E
            DEC     A
            JR      Z,L0F48             ; (+003H)
            LD      DE,$QD
L0F48:      LD      A,C
            RST     018H
            DB      03AH
            JP      L00DA

            DI      
            XOR     A
            OUT     (LSDMD),A
            LD      A,014H
            OUT     (LSRF),A
            LD      A,094H
            OUT     (LSWF),A
            IN      A,(LSE0)
            OUT     (LSE0),A
            LD      HL,L9FFF
            LD      A,(HL)
            LD      C,A
            CPL     
            LD      (HL),A
            CP      (HL)
            LD      (HL),C
            LD      A,000H
            JR      NZ,L0F6C            ; (+001H)
            INC     A
L0F6C:      LD      (L1099),A
            IN      A,(LSE1)
            EI      
            LD      A,001H
            CALL    DSMODE
            XOR     A
            LD      (L108C),A
            LD      (L108D),A
            RET     

            NOP     
            NOP     
            LD      D,L
            LD      D,E
            LD      D,D
            NOP     
            SBC     A,A
            NOP     
            NOP     
            OR      D
            NOP     
            SBC     A,B
            RRCA    
            SBC     A,B
            RRCA    
            OR      D
            NOP     
            OR      D
            NOP     
            AND     A
            RRCA    
            AND     A
            RRCA    
            OR      D
            NOP     
            LD      HL,L1001
            RST     018H
            DB      013H
            LD      A,D
            OR      E
            JP      Z,01FAFH
            LD      (ZWRK1),DE
            RET     

            LD      HL,(ZWRK1)
            JP      (HL)

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DS      12, 000H
            DB      01AH
            DB      042H
            DB      061H
            DB      015H
L1000:      DB      000H
L1001:      DS      14, 000H
L100F:      DS      3, 000H
L1012:      DS      2, 000H
L1014:      DS      4, 000H
L1018:      DS      32, 000H
L1038:      DB      000H
L1039:      DS      5, 000H
L103E:      DS      2, 000H
L1040:      DB      002H
            DB      000H
L1042:      DB      000H
L1043:      DB      000H
L1044:      DS      2, 000H
L1046:      DS      4, 000H
L104A:      DS      6, 000H
L1050:      DB      001H
L1051:      DS      23, 000H
            NOP     
L1069:      DS      3, 000H
            DB      0DDH
            DB      00DH
            DB      079H
            DB      014H
L1070:      DS      2, 000H
L1072:      DS      2, 000H
L1074:      DS      2, 000H
L1076:      DS      2, 000H
L1078:      DS      2, 000H
L107A:      DS      2, 000H
L107C:      DS      2, 000H
L107E:      DS      3, 000H
            DB      0FFH
L1082:      DS      2, 000H
L1084:      DB      000H
            DB      020H
L1086:      DB      000H
            DB      080H
L1088:      DS      2, 000H
L108A:      DS      2, 000H
L108C:      DB      000H
L108D:      DB      000H
L108E:      DB      000H
L108F:      DB      000H
L1090:      DB      000H
L1091:      DB      000H
            DB      001H
            DB      00DH
            DB      00EH
L1095:      DS      2, 000H
L1097:      DB      001H
L1098:      DB      000H
L1099:      DB      000H
L109A:      DB      000H
L109B:      DS      2, 003H
            DB      004H
L109E:      DB      0FFH
L109F:      DB      003H
            DS      80, 000H
L10F0:      DS      78, 000H
L113E:      DS      84, 000H
            DB      0EFH
            DS      4, 000H
L1197:      DS      2, 000H
L1199:      DS      4, 000H
            DB      001H
            DB      004H
            DB      005H
            DS      3, 000H
L11A3:      DB      000H
L11A4:      DB      000H
L11A5:      DB      000H
L11A6:      DS      2, 000H
L11A8:      DB      000H
L11A9:      DB      000H
L11AA:      DB      000H
L11AB:      DB      000H
L11AC:      DB      000H
L11AD:      DB      000H
L11AE:      DB      000H
L11AF:      DB      000H
L11B0:      DB      000H
L11B1:      DB      000H
L11B2:      DB      000H
L11B3:      DB      000H
L11B4:      DB      000H
L11B5:      DB      000H
L11B6:      DB      000H
L11B7:      DB      000H
L11B8:      DB      000H
L11B9:      DB      000H
L11BA:      DS      11, 000H
L11C5:      DS      4, 000H
L11C9:      DS      2, 000H
L11CB:      DS      2, 000H
L11CD:      DS      33, 000H
L11EE:      DS      18, 000H
L1200:      DS      7, 000H
L1207:      DB      000H
L1208:      DB      000H
L1209:      DS      5, 000H
L120E:      DS      2, 000H
L1210:      DS      2, 000H
L1212:      DS      2, 000H
L1214:      DS      2, 000H
L1216:      DS      2, 000H
L1218:      DS      2, 000H
L121A:      DS      2, 000H
L121C:      DS      2, 000H
L121E:      DS      2, 000H
L1220:      DB      000H
L1221:      DS      2, 000H
L1223:      DS      9, 000H
L122C:      DS      18, 000H
L123E:      DS      8, 000H
L1246:      DS      13, 000H
L1253:      DS      36, 000H
L1277:      DS      39, 000H
L129E:      DS      2, 000H
L12A0:      DS      10, 000H
L12AA:      DS      4, 000H
L12AE:      DS      4, 000H
L12B2:      DB      007H,"RUN"
            DS      3, 020H
            DB      00DH
            DS      8, 000H
            DB      005H,"LIST "
            DS      10, 000H
            DB      005H,"AUTO "
            DS      10, 000H
            DB      006H,"RENUM "
            DS      9, 000H
            DB      006H,"COLOR "
            DS      9, 000H
            DB      005H,"CHR$("
            DS      10, 000H
            DB      008H,"DEF KEY("
            DS      7, 000H
            DB      004H,"CONT"
            DS      11, 000H
            DB      006H,"SAVE"
            DS      2, 020H
            DS      5, 000H
L133E:      DS      4, 000H
            DB      006H,"LOAD"
            DS      2, 020H
            DS      8, 000H
            NOP     
L1352:      DB      000H
L1353:      DS      17, 000H
L1364:      DB      0FFH
L1365:      DS      5, 000H
L136A:      DB      027H
L136B:      DB      028H
            DB      000H
L136D:      DB      040H
            DB      001H
L136F:      DB      000H
            DB      018H
L1371:      DB      019H
L1372:      DS      2, 000H
L1374:      DB      07DH
L1375:      DB      000H
L1376:      DB      07DH
L1377:      DB      0E8H
            DB      003H
L1379:      DB      001H
L137A:      DB      001H
L137B:      DB      003H
L137C:      DS      2, 000H
L137E:      DB      000H
L137F:      DB      089H
            DB      013H
L1381:      DS      4, 000H
L1385:      DB      000H
            DB      01FH
            DB      02FH
            DB      03FH
L1389:      DB      000H
            DB      011H
            DB      022H
            DB      03FH
L138D:      DB      000H
            DB      011H
            DB      022H
            DB      033H
L1391:      DS      8, 0FFH
L1399:      DB      07EH
            DS      6, 0FFH
            DB      07EH
L13A1:      DS      7, 000H
            DB      0FFH
L13A9:      DS      26, 000H
L13C3:      DB      000H
L13C4:      DS      8, 000H
            DB      LSPAL
            DB      03FH
            DS      3, 000H
            DB      0C0H
            DB      000H
            DB      0C0H
            DB      000H
            DB      0C0H
            DS      2, 000H
            DB      004H
L13D9:      DB      000H
            DB      0DCH
            DB      013H
            DB      027H
            DS      2, 023H
            DS      2, 040H
            DS      2, 05BH
            DS      2, 05CH
            DS      2, 05DH
            DB      08BH,05EH,090H,05FH,093H,060H,0A1H,061H,09AH,062H,09FH,063H,09CH,064H,092H,065H,0AAH,066H,097H,067H,098H,068H,0A6H,069H,0AFH,06AH,0A9H,06BH,0B8H,06CH,0B3H,06DH,0B0H,06EH,0B7H,06FH,09EH,070H,0A0H,071H,09DH,072H,0A4H,073H,096H
L1414:      DB      074H,0A5H,075H,0ABH,076H,0A3H,077H,09BH,078H,0BDH,079H,0A2H,07AH,0BEH,07BH,0C0H,07CH,080H,07DH,094H,07EH
            DS      2, 07FH
L142B:      DB      0FEH
            DB      00DH
            DB      028H
            DB      013H
            DB      0FEH
            DB      00AH
            DB      028H
            DB      00FH
            DB      LSRF
            DB      048H,014H,0FEH,020H,030H,006H,0CBH,043H,028H,002H
L143E:      DB      03EH
            DB      020H
            DB      0DDH
            DB      0E9H
            DB      LSRF
            DB      040H
            DB      014H
            DB      036H
            DB      000H
            DB      0C9H
            DB      0C5H
            DB      00EH
            DB      000H
            DB      LSRF
            DB      050H
            DB      014H
            DB      0C1H
            DB      0C9H
            DB      LSRF
            DB      0C7H,000H,02AH,0DAH,013H,"F#T]",013H,0CBH,041H,028H,001H,0EBH,0BEH,028H,007H
            DS      2, 023H
            DS      2, 013H
            DB      010H
            DB      SIOBC
            DB      0C9H
            DB      01AH
            DB      0C9H
L146C:      DB      LSRF
            DB      040H
            DB      014H
            DB      0D8H
            DB      0C5H
            DB      00EH
            DB      001H
            DB      LSRF
            DB      050H
            DB      014H
            DB      0C1H
            DB      0B7H
            DB      0C9H
$LPT:       DB      "Z7LPT",000H,08AH ; $LPT - Line printer device descriptor
            DS      2, 000H
            DB      0ECH
            DB      014H
            DB      0ACH
            DB      01FH
            DB      0B2H
            DB      000H
            DB      0B2H
            DB      000H
            DB      0B2H
            DS      3, 000H
            DB      0B2H
            DB      014H
            DB      092H
            DB      014H
            LD      A,(L108F)
            OR      A
            LD      A,(L1095)
            RET     Z
            LD      A,(L1082)
            RET     

L149E:      CALL    L1517
            INC     BC
L14A2:      CALL    L1517
            LD      B,LSRF
            RLA     
            DEC     D
            ADD     HL,BC
L14AA:      CALL    L1517
            INC     C
L14AE:      CALL    01508H
            RRCA    
            LD      HL,L1090
            BIT     0,(HL)
            JR      NZ,L14E0            ; (+027H)
L14B9:      PUSH    IY
            EX      AF,AF'
            LD      A,012H
L14BE:      LD      (L14DF),A
            LD      A,003H
L14C3:      LD      (L14D6),A
            EX      AF,AF'
            CALL    L14D8
            POP     IY
            PUSH    BC
            LD      B,A
            LD      A,(L108F)
            OR      A
            LD      A,B
            POP     BC
            RET     Z
            RST     018H
L14D6:      DB      003H
            RET     

L14D8:      LD      IY,L142B
            CALL    01508H
L14DF:      LD      (DE),A
L14E0:      PUSH    IY
            EX      AF,AF'
            LD      A,015H
            LD      (L14DF),A
            LD      A,003H
            JR      L14C3               ; (-029H)

            CALL    01508H
            JR      L14BE               ; (-033H)

            EX      AF,AF'
            DEC     D
            DEC     DE
L14F4:      CALL    01508H
            LD      E,LSRF
            DB      008H
            DB      015H
            DB      021H
L14FC:      DB      LSRF
            DB      008H
            DB      015H
            DB      024H
L1500:      DB      LSRF
            DB      008H
            DB      015H
            DB      027H
L1504:      CALL    01508H
            LD      HL,(03A08H)
            SUB     D
            DJNZ    L14D8               ; (-035H)
            LD      C,A
            JR      Z,L1516             ; (+006H)
            PUSH    BC
            LD      B,003H
            RST     018H
            DB      023H
            POP     BC
L1516:      EX      AF,AF'
L1517:      EX      AF,AF'
            XOR     A
            LD      (L12AE),HL
            LD      (L13D9),A
            EX      AF,AF'
            DI      
            LD      (012ACH),SP
            EX      (SP),HL
            LD      SP,HL
            POP     HL
            OUT     (LSE3),A
            LD      SP,L12AA
            CALL    L1543
            OUT     (LSE1),A
            LD      SP,(012ACH)
            EX      (SP),HL
            INC     SP
            INC     SP
            EI      
            EX      AF,AF'
            LD      A,(L13D9)
L153E:      OR      A
            JR      NZ,L1546            ; (+005H)
            EX      AF,AF'
            RET     

L1543:      LD      H,SIOAD
            JP      (HL)

L1546:      LD      B,A
            EX      AF,AF'
            DEC     B
            JP      Z,BREAKZ
            DEC     B
            JP      NZ,ERRORJ
L1550:      LD      HL,(013CEH)
            LD      A,H
            OR      L
            JR      Z,L1504             ; (-053H)
            CALL    L14FC
            RST     018H
            DB      00EH
            JP      Z,BREAKZ
            JR      L1550               ; (-011H)

            DI      
            PUSH    AF
            PUSH    HL
            PUSH    BC
            LD      (01585H),SP
            LD      SP,L1585
            OUT     (LSE3),A
            CALL    0F400H
            OUT     (LSE1),A
            LD      SP,(01585H)
            POP     BC
            POP     HL
            POP     AF
            EI      
            RETI    

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1585:      NOP     
            NOP     
L1587:      PUSH    HL
            LD      DE,(0004FH)
            PUSH    DE
            LD      DE,L15CE
            LD      (0004FH),DE
            LD      A,(L1364)
            PUSH    AF
            LD      A,064H
            LD      (L1364),A
            LD      (01645H),SP
            XOR     A
            LD      (L1091),A
L15A5:      LD      SP,L0000
L15A8:      LD      BC,L15A8
            PUSH    BC
            RST     018H
            DB      002H
            LD      A,02AH
            RST     018H
            DB      003H
L15B2:      CALL    L1651
            JR      NC,L15B2            ; (-005H)
            LD      A,(DE)
            CP      02AH
            RET     NZ
            INC     DE
            LD      A,(DE)
            INC     DE
            EXX     
            LD      HL,L15E0
            LD      B,00AH
L15C4:      CP      (HL)
            INC     HL
            JR      Z,L15DA             ; (+012H)
            INC     HL
            INC     HL
            DJNZ    L15C4               ; (-008H)
            EXX     
            RET     

L15CE:      LD      C,A
            AND     07FH
            JR      Z,L15A5             ; (-02eH)
            LD      A,C
            RST     018H
            DB      01BH
            RST     018H
            DB      043H
            JR      L15A5               ; (-035H)

L15DA:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            PUSH    DE
            EXX     
            RET     

L15E0:      LD      B,H
            ADD     A,016H
            LD      C,L
            JR      C,L15FD             ; (+017H)
            LD      D,B
            CP      015H
            LD      B,A
            POP     BC
            LD      D,046H
            LD      E,H
            RLA     
            LD      D,D
            LD      B,H
            LD      D,053H
            RLCA    
            LD      D,04CH
            LD      E,016H
            LD      D,(HL)
            DEC     SP
            LD      D,054H
            XOR     H
L15FD:      RLA     
            LD      A,(L1091)
            XOR     001H
            LD      (L1091),A
            RET     

            CALL    L1795
            RET     C
            EXX     
            CALL    L17C3
            EXX     
            LD      (ELMD20),BC
            LD      (ELMD22),DE
            LD      (L1018),HL
            RST     018H
            DB      031H
            RET     

            CALL    L1672
            PUSH    HL
            PUSH    AF
            CALL    L1630
            POP     AF
            POP     HL
            JR      NC,L162D            ; (+003H)
            LD      HL,(ELMD22)
L162D:      RST     018H
            DB      030H
            RET     

L1630:      CALL    L17C3
            RST     018H
            DB      02FH
            CP      001H
            RET     Z
            JP      01FB2H

            CALL    L1630
L163E:      LD      HL,(ELMD22)
            RST     018H
            DB      032H
            RET     

            LD      SP,L0000
            POP     AF
            LD      (L1364),A
            POP     HL
            LD      (L004F),HL
            POP     HL
            RET     

L1651:      LD      DE,0FF00H
            RST     018H
            DB      00CH
            JR      C,L1670             ; (+018H)
            LD      A,(DE)
            CP      03AH
            SCF     
            RET     NZ
            INC     DE
            CALL    L1672
            RET     C
            LD      A,(DE)
            INC     DE
            XOR     03DH
            RET     NZ
L1667:      CALL    L1697
            CCF     
            RET     NC
            LD      (HL),A
            INC     HL
            JR      L1667               ; (-009H)

L1670:      LD      (DE),A
            RET     

L1672:      PUSH    HL
            CALL    L168C
            PUSH    DE
            CALL    L169E
            JR      C,L1687             ; (+00bH)
            LD      H,A
            CALL    L169E
            JR      C,L1687             ; (+005H)
            LD      L,A
            POP     AF
            POP     AF
            XOR     A
            RET     

L1687:      POP     DE
            POP     HL
            SCF     
            RET     

L168B:      INC     DE
L168C:      LD      A,(DE)
            CP      020H
            JR      Z,L168B             ; (-006H)
            RET     

L1692:      LD      A,(DE)
            RST     018H
            DB      015H
            INC     DE
            RET     

L1697:      CALL    L168C
            CP      03BH
            JR      Z,L16BC             ; (+01eH)
L169E:      PUSH    BC
            PUSH    DE
            CALL    L1692
            JR      C,L16B8             ; (+013H)
            LD      C,A
            CALL    L1692
            JR      C,L16B8             ; (+00dH)
            LD      B,A
            LD      A,C
            RLCA    
            RLCA    
            RLCA    
            RLCA    
            ADD     A,B
            LD      C,A
            LD      A,C
            POP     BC
            POP     BC
            OR      A
            RET     

L16B8:      POP     DE
            POP     BC
            SCF     
            RET     

L16BC:      INC     DE
            LD      A,(DE)
            INC     DE
            OR      A
            RET     

            CALL    L1672
            RET     C
            JP      (HL)

            CALL    L1672
            JR      C,L16D6             ; (+00bH)
            PUSH    HL
            CALL    L1672
            JR      C,L16D5             ; (+004H)
            POP     DE
            EX      DE,HL
            JR      L16DC               ; (+007H)

L16D5:      POP     HL
L16D6:      EX      DE,HL
            LD      HL,00080H
            ADD     HL,DE
            EX      DE,HL
L16DC:      LD      C,008H
            CALL    L16E9
            RET     C
            PUSH    HL
            SBC     HL,DE
            POP     HL
            RET     NC
            JR      L16DC               ; (-00dH)

L16E9:      CALL    L1711
            LD      B,C
            PUSH    HL
L16EE:      LD      A,(HL)
            CALL    L1722
            INC     HL
            LD      A,020H
            RST     018H
            DB      009H
            DJNZ    L16EE               ; (-00bH)
            POP     HL
            LD      A,02FH
            RST     018H
            DB      009H
            LD      B,C
L16FF:      LD      A,(HL)
            CP      020H
            JR      NC,L1706            ; (+002H)
            LD      A,02EH
L1706:      RST     018H
            DB      009H
            INC     HL
            DJNZ    L16FF               ; (-00cH)
            RST     018H
            DB      008H
            RST     018H
            DB      00FH
            OR      A
            RET     

L1711:      LD      A,03AH
            RST     018H
            DB      009H
            LD      A,H
            CALL    L1722
            LD      A,L
            CALL    L1722
            LD      A,03DH
            RST     018H
            DB      009H
            RET     

L1722:      PUSH    AF
            RLCA    
            RLCA    
            RLCA    
            RLCA    
            CALL    L172B
            POP     AF
L172B:      AND     00FH
            ADD     A,030H
            CP      03AH
            JR      C,L1735             ; (+002H)
            ADD     A,007H
L1735:      RST     018H
            DB      009H
            RET     

            CALL    L1672
            LD      A,(L1091)
            PUSH    AF
            XOR     A
            LD      (L1091),A
L1743:      RST     018H
            DB      002H
            CALL    L1711
            LD      A,(HL)
            CALL    L1722
            LD      A,014H
            RST     018H
            DB      003H
            RST     018H
            DB      003H
            CALL    L1651
            JR      NC,L1743            ; (-014H)
            POP     AF
            LD      (L1091),A
            RET     

            CALL    L1672
            RET     C
            PUSH    HL
            CALL    L1672
            POP     BC
            RET     C
            PUSH    HL
            PUSH    BC
            LD      HL,0FF00H
            CALL    L1667
            LD      DE,0FF00H
            OR      A
            SBC     HL,DE
            LD      C,L
            POP     HL
            PUSH    HL
            EXX     
            POP     HL
            POP     DE
            EXX     
            RET     Z
L177C:      CALL    L17D6
            JR      NZ,L1785            ; (+004H)
            CALL    L16E9
            RET     C
L1785:      RST     018H
            DB      00EH
            RET     Z
            EXX     
            INC     HL
            PUSH    HL
            SCF     
            SBC     HL,DE
            POP     HL
            RET     NC
            PUSH    HL
            EXX     
            POP     HL
            JR      L177C               ; (-019H)

L1795:      CALL    L1672
            PUSH    HL
            CALL    NC,L1672
            POP     BC
            RET     C
            SBC     HL,BC
            INC     HL
            PUSH    HL
            PUSH    BC
            CALL    L1672
            PUSH    HL
            EXX     
            POP     HL
            POP     DE
            POP     BC
            RET     

            CALL    L1795
            RET     C
            EX      DE,HL
            PUSH    HL
            SBC     HL,DE
            POP     HL
            JR      C,L17BA             ; (+003H)
            LDIR    
            RET     

L17BA:      ADD     HL,BC
            DEC     HL
            EX      DE,HL
            ADD     HL,BC
            DEC     HL
            EX      DE,HL
            LDDR    
            RET     

L17C3:      LD      A,(DE)
            OR      A
            JR      Z,L17CC             ; (+005H)
            INC     DE
            CP      03AH
            JR      NZ,L17C3            ; (-009H)
L17CC:      RST     018H
            DB      017H
            RST     018H
            DB      02DH
            LD      A,001H
            LD      (L1000),A
            RET     

L17D6:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            PUSH    BC
            DB      0D5H
            DB      LSE5
            DB      041H,01AH,0BEH,020H,005H,013H,023H,010H,0F8H,0AFH
            DB      LSE1
            DB      LSD1
            DB      0C1H
            DB      0C9H
            DS      22, 000H
$IOCS:      DB      0C3H,000H,"X:B",010H,0FEH,088H,0C9H ; $IOCS - I/O control system entry
L1809:      DS      2, 000H
L180B:      DS      2, 000H
L180D:      DS      2, 000H
L180F:      DB      LSRF
            DB      01AH
            DB      018H
            DB      LSRF
            DB      021H
            DB      018H
            DB      0AFH
            DB      032H
            DB      0D9H
            DB      01FH
            DB      0C9H
L181A:      DB      03AH,042H,010H,032H,0D9H,01FH,0C9H
            DB      LSRF
            DB      0C7H,000H,03AH,050H,010H,0CBH,07FH,021H,048H,018H,028H,00FH,0CBH,"_!5",018H,020H,008H,0DDH,02AH,05FH,010H
            DB      LSRF
            DB      047H
            DB      002H
            DB      0C9H
            DB      078H
L183E:      DB      0B7H
            DB      0C8H
            DB      01AH
            DB      LSRF
            DB      0A7H
            DB      000H
            DB      013H
            DB      005H
            DB      018H
            DB      SIOBD
            DB      LSRF
            DB      0C7H,000H,0FDH,05EH,040H,0FDH,"VA*",00BH,018H,019H,077H,013H,02AH,05BH,010H,0B7H,0EDH,052H
            DB      LSWF
            DB      071H,018H,0FDH,073H,040H,0FDH,072H,041H,0FDH,034H,014H,0C0H,0FDH,034H,015H,0C0H,0C3H,0A6H,01FH,0C5H,006H,002H
            DB      LSRF
            DB      027H,01DH,0DDH,021H,035H,018H,028H,004H,0DDH,021H,0A1H,03BH,078H
            DB      LSRF
            DB      0B6H
            DB      018H
            DB      LSRF
            DB      090H
            DB      018H
            DB      0FDH
            DB      034H
            DB      04EH
            DB      011H
            DS      2, 000H
            DB      0C1H
            DB      0C9H
            DB      0DDH
            DB      0E9H
L1892:      DB      03EH,01AH,0FDH,05EH,040H,0FDH,"VA*",00BH,018H,019H,077H,013H,02AH,05BH,010H,0AFH,0EDH,052H,020H
            DB      PSGA
            DB      0C5H,02AH,00BH,018H,02BH,036H,0FFH,02BH,036H,0FFH
            DS      2, 006H
            DB      018H
            DB      0BEH
            DB      0EDH
            DB      04BH
            DB      05BH
            DB      010H
            DS      2, 003H
            DB      02AH
            DB      00BH
            DB      018H
            DS      2, 02BH
            DB      0EDH
            DB      05BH
            DB      009H
            DB      018H
            DB      0C9H
L18C6:      DB      0F6H
L18C7:      DB      0AFH
            DB      0DDH
            DB      02AH
            DB      059H
            DB      010H
            DB      LSRF
            DB      047H
            DB      002H
            DB      0C9H
L18D0:      DB      LSRF
            DB      003H
            DB      018H
            DB      0C0H
            DB      0D5H
            DB      011H
            DB      0A4H
            DB      011H
            DB      LSRF
            DB      067H,00AH,0EDH,053H,03CH,019H
            DB      LSD1
            DB      LSD0
            DB      0C3H
            DB      0E8H
            DB      000H
L18E4:      DB      LSE5
            DB      0D5H
            DB      LSRF
            DB      01AH,018H,02AH,040H,010H,023H,0CBH,07EH
            DB      LSE5
            DB      006H
            DB      000H
            DB      037H
            DB      LSWF
            DB      013H
            DB      019H
            DB      LSE1
            DB      0DCH
            DB      008H
            DB      019H
            DB      LSD1
            DB      SIOBD
            DB      LSRF
            DB      015H,018H,068H,026H,000H,019H,036H,000H,0F1H
            DB      LSE1
            DB      0C9H,0CBH,0FEH,021H,051H,010H,0CBH,066H,0C8H,0C3H,0B5H,01FH
            DB      LSRF
            DB      003H,018H,"(#:P",010H,0CBH,07FH,021H,091H,019H,028H,053H,0CBH,"W!)",019H,020H,04CH,0DDH,02AH,05DH,010H
            DB      LSRF
            DB      047H,002H,0C9H,03EH,03FH,0DFH,003H,03EH,020H,0DFH,003H,0DFH,034H,021H
            DS      2, 000H
L193E:      DB      LSRF
            DB      05EH,001H,0B7H,028H,0EDH,00EH,000H,0DFH,036H,022H,03CH,019H,0C9H
L194C:      DB      006H
            DB      000H
            DB      LSRF
            DB      064H,001H,022H,020H,013H,07EH,0B7H,0C8H,023H,0FEH,022H,028H,005H,012H,013H,004H,018H,0F3H
            DB      LSRF
            DB      064H,001H,02CH,0B7H,0C9H,07EH,0B7H,0C8H,0B9H,0C8H,023H,0FEH,02CH,0C8H,012H,013H,004H,018H
            DB      PSGA
            DB      022H
            DB      07BH
            DB      019H
            DB      006H
            DB      000H
            DB      LSRF
            DS      2, 000H
            DB      0D8H
            DB      0FEH
            DB      00DH
            DB      0C8H
            DB      012H
            DB      013H
            DB      004H
            DB      020H
            DB      SIOAD
            DB      0C3H
            DB      08BH
            DB      01FH
L1989:      DB      03AH
            DB      050H
            DB      010H
            DB      0CBH
            DB      07FH
            DB      0C2H
            DB      0ACH
            DB      01FH
            DB      LSRF
            DB      0C7H,000H,0FDH,05EH,040H,0FDH,"VA*[",010H,0B7H,0EDH,052H
            DB      LSWF
            DB      0BCH,019H,0D8H,0FDH,06EH,04EH,0FDH,066H,04FH,0AFH,0EDH,052H,037H,0C8H,02AH,00BH,018H,019H,07EH,013H,0FDH,073H,040H,0FDH,072H,041H,0C9H
            DB      LSRF
            DB      027H
            DB      01DH
            DB      0C2H
            DB      0A1H
            DB      03BH
            DB      0F6H
L19C3:      DB      0AFH
            DB      LSRF
            DB      0B6H
            DB      018H
            DB      LSRF
            DB      029H,019H,0D8H,07EH,023H,0A6H,036H,0FFH,03CH,011H
            DS      2, 000H
            DB      0C0H
            DB      LSE5
            DB      02AH,00DH,018H,0EDH,04BH,05BH,010H,02BH,00BH,07EH,0B7H,028H,0FAH
            DB      LSE1
            DB      "p+q",0C9H
L19E8:      DB      LSRF
            DB      0C7H,000H,021H,035H,01AH,0FEH,088H,028H,00AH,021H,03DH,01AH,0FEH,089H,028H,003H,0DFH,029H,0D8H,022H,040H,010H,011H
            LD      B,D
            DJNZ    L1A04               ; (+001H)
            EX      AF,AF'
L1A04:      NOP     
            LDIR    
            LD      (L1809),HL
            PUSH    HL
            POP     IY
            LD      DE,L1000
            CALL    L1C66
            PUSH    HL
            LD      HL,(L1044)
            LD      DE,L104A
            LD      BC,0001DH
            LDIR    
            POP     HL
            LD      BC,00010H
            ADD     HL,BC
            LD      (L180B),HL
            LD      BC,(ZKL)
            ADD     HL,BC
            LD      (L180D),HL
            LD      A,(L1043)
            AND     00FH
            RET     

            DB      088H
            DB      003H
            DB      0DDH
            DB      00DH
            DS      4, 000H
            DB      089H
            DB      002H
            DB      079H
            DB      014H
            DS      4, 000H
L1A45:      LD      HL,L11A4
            PUSH    HL
            LD      A,B
            OR      A
            CALL    NZ,LDHLDE
            LD      (HL),000H
            LD      HL,L0DDD
            JR      L1A58               ; (+003H)

L1A55:      LD      HL,L0000
L1A58:      LD      A,L
            OR      H
            JR      Z,L1A91             ; (+035H)
            LD      (01A8CH),HL
            CALL    LDDEMI
            LD      (01A56H),DE
            LD      DE,L11A4
            EX      DE,HL
L1A6A:      LD      A,(DE)
            OR      A
            JR      Z,L1A75             ; (+007H)
            CP      (HL)
            JR      NZ,L1A55            ; (-01cH)
            INC     HL
            INC     DE
            JR      L1A6A               ; (-00bH)

L1A75:      LD      A,(HL)
            INC     HL
            CP      03AH
            LD      C,000H
            JR      Z,L1A8A             ; (+00dH)
            SUB     031H
            CP      009H
            JR      NC,L1A55            ; (-02eH)
            LD      C,A
            LD      A,(HL)
            INC     HL
            CP      03AH
            JR      NZ,L1A55            ; (-035H)
L1A8A:      EX      (SP),HL
            LD      HL,L0000
            LD      A,C
            JR      L1AA3               ; (+012H)

L1A91:      POP     HL
            PUSH    HL
L1A93:      LD      A,(HL)
            INC     HL
            CP      03AH
            JP      Z,01FA9H
            OR      A
            JR      NZ,L1A93            ; (-00aH)
            LD      HL,(DDEV)
            LD      A,(L1069)
L1AA3:      LD      (L1044),HL
            PUSH    HL
            LD      (L1046),A
            LD      DE,L104A
            LD      BC,0001DH
            LDIR    
            LD      B,A
            LD      A,(L1051)
            AND     007H
            CP      B
            JP      C,01FA9H
            LD      A,B
            POP     DE
            POP     HL
            RET     

L1AC0:      CALL    PUSHR
            RST     018H
            DB      02CH
            EX      DE,HL
            LD      HL,L1001
            LD      B,01FH
            CALL    ?CLRHL
            LD      HL,L1000
            RST     018H
            DB      017H
            CALL    L1EC9
            LD      HL,L1050
            BIT     4,(HL)
            RET     Z
            INC     HL
            BIT     7,(HL)
            RET     NZ
            LD      A,(L1001)
            CP      00DH
            JP      Z,01FAFH
            RET     

L1AE9:      CALL    PUSHR
            CALL    L1AF7
            LD      B,000H
            CALL    L1BA9
            JP      L3BA1

L1AF7:      LD      A,(L1042)
            RST     018H
            DB      029H
            JP      NC,01F91H
            CALL    L1C6D
            LD      HL,L005D
            LD      A,(L1050)
            LD      DE,(ZKL)
            INC     DE
            INC     DE
            BIT     7,A
            JR      NZ,L1B13            ; (+001H)
            ADD     HL,DE
L1B13:      LD      A,(L1043)
            BIT     2,A
            JR      Z,L1B1B             ; (+001H)
            ADD     HL,DE
L1B1B:      EX      DE,HL
            LD      A,(L1042)
            RST     018H
            DB      02AH
            LD      (L1FD9),A
            LD      (L1040),HL
            EX      DE,HL
            LD      HL,L1042
            LD      BC,00008H
            LDIR    
            LD      (01809H),DE
            PUSH    DE
            POP     IY
            LD      HL,L1000
            CALL    L1C66
            LD      HL,00010H
            ADD     HL,DE
            LD      (L180B),HL
            LD      DE,(ZKL)
            ADD     HL,DE
            LD      (L180D),HL
            CALL    L1D27
            JP      NZ,L3BA1
            LD      A,(L1043)
            BIT     2,A
            JP      NZ,01FACH
            BIT     1,A
            LD      IX,(ZWO)
            JR      NZ,L1B6D            ; (+00bH)
            LD      A,(L1050)
            BIT     7,A
            JR      Z,L1B73             ; (+00aH)
            LD      IX,(ZRO)
L1B6D:      LD      HL,L1000
            JP      _IOCALL

L1B73:      LD      B,(IY+000H)
            CALL    L1C4B
            LD      A,(L1000)
            CP      B
            JP      NZ,01FB2H
            JP      L19C3

L1B83:      CALL    PUSHR
            LD      IY,00100H
            LD      (L1042),IY
            LD      IY,L1000
            CALL    L1D27
            LD      HL,L3BA1
            JR      NZ,L1B9D            ; (+003H)
            LD      HL,L1C4B
L1B9D:      CALL    .HL
            LD      B,080H
            CALL    L1BA9
            LD      A,(L1000)
            RET     

L1BA9:      LD      A,(L1000)
            CP      005H
            RET     C
            LD      A,(L1012)
            AND     080H
            CP      B
            RET     Z
            JP      01FB2H

L1BB9:      CALL    PUSHR
            OR      A
            JR      Z,L1BFF             ; (+040H)
            CALL    L1BC5
            JP      L3BA1

L1BC5:      RST     018H
            DB      02EH
            RET     C
            CALL    L181A
            PUSH    AF
            CALL    L1D27
            JR      NZ,L1BF3            ; (+022H)
            BIT     7,A
            LD      A,B
            JR      Z,L1BE6             ; (+010H)
            OR      A
            LD      IX,(ZKL)
            JR      Z,L1BE1             ; (+004H)
            LD      IX,(ZCL)
L1BE1:      CALL    _IOCALL
            JR      L1BF6               ; (+010H)

L1BE6:      OR      A
            JR      Z,L1BF6             ; (+00dH)
            LD      A,(L1043)
            BIT     1,A
            CALL    NZ,L1892
            JR      L1BF6               ; (+003H)

L1BF3:      CALL    L3BA1
L1BF6:      POP     AF
            RST     018H
            DB      02BH
            RET     

L1BFA:      CALL    PUSHR
            LD      B,000H
L1BFF:      LD      C,08EH
L1C01:      LD      A,C
            PUSH    BC
            RST     018H
            DB      029H
            CALL    NC,L1BC5
            POP     BC
            DEC     C
            JR      NZ,L1C01            ; (-00bH)
            JP      L1FC0

L1C0F:      CALL    PUSHR
            LD      A,(L1050)
            BIT     6,A
            JP      Z,01FACH
            CALL    L18C7
            LD      A,(ZDIRMX)
            LD      B,A
L1C21:      LD      HL,L11A4
            PUSH    BC
            LD      IX,(ZRO)
            CALL    _IOCALL
            POP     BC
            SET     0,A
            RET     C
            PUSH    IY
            POP     DE
            CALL    L1EB2
            LD      A,(HL)
            RET     Z
            DJNZ    L1C21               ; (-019H)
            XOR     A
            SCF     
            RET     

L1C3D:      CALL    L1C6D
            CALL    L1C0F
            JP      NC,01F8EH
            OR      A
            JP      Z,01F9AH
            RET     

L1C4B:      CALL    L1C6D
            CALL    L1C0F
            JP      C,01F88H
            CALL    PUSHR
            LD      HL,L11A4
            PUSH    IY
            POP     DE
            PUSH    HL
            CALL    L1C66
            POP     HL
            LD      DE,L1000
            LD      A,(HL)
L1C66:      LD      BC,00040H
            LDIR    
            OR      A
            RET     

L1C6D:      LD      IX,L1CAF
L1C71:      LD      (01CABH),IX
            CALL    PUSHR
            LD      A,(L1042)
            LD      C,A
            LD      HL,(L1072)
            PUSH    HL
L1C80:      POP     HL
            LD      A,(HL)
            OR      A
            RET     Z
            LD      B,A
            INC     HL
            CALL    LDDEMI
            PUSH    HL
            ADD     HL,DE
            EX      (SP),HL
            CP      08FH
            JR      NC,L1C80            ; (-010H)
            CP      C
            JR      Z,L1C80             ; (-013H)
            INC     HL
            LD      A,(HL)
            EX      AF,AF'
            INC     HL
            LD      DE,L1044
            PUSH    BC
            LD      BC,00300H
L1C9E:      LD      A,(DE)
            SUB     (HL)
            OR      C
            LD      C,A
            INC     DE
            INC     HL
            DJNZ    L1C9E               ; (-008H)
            POP     BC
            JR      NZ,L1C80            ; (-029H)
            LD      A,B
            CALL    L0000
            JR      L1C80               ; (-02fH)

L1CAF:      LD      A,(L1051)
            BIT     6,A
            JP      NZ,01F91H
            BIT     5,A
            RET     Z
            EX      AF,AF'
            LD      B,A
            LD      A,(L1043)
            AND     B
            BIT     1,A
            RET     Z
            JP      01F91H

L1CC6:      CALL    L1D27
            JP      NZ,L3BA1
            LD      BC,(ELMD20)
            PUSH    BC
            XOR     A
            LD      IX,(ZINP)
            CALL    _IOCALL
            POP     BC
            RET     

L1CDB:      LD      A,(L1051)
            BIT     7,A
            JP      Z,01FACH
            LD      BC,(ELMD20)
            JP      L388D

L1CEA:      LD      A,(L1000)
            CP      005H
            JR      C,L1CF6             ; (+005H)
            LD      A,080H
            LD      (L1012),A
L1CF6:      CALL    L1D27
            JP      NZ,L3BA1
            BIT     7,A
            JP      NZ,01FACH
            PUSH    DE
            LD      HL,L0200
            LD      (L1042),HL
            CALL    L1C6D
            LD      HL,L1000
            PUSH    HL
            POP     IY
            LD      IX,(ZWO)
            CALL    _IOCALL
            LD      BC,(ELMD20)
            POP     HL
            LD      A,004H
            LD      IX,(ZOUT)
            CALL    _IOCALL
            RET     

L1D27:      LD      A,(L1050)
            BIT     5,A
            RET     

L1D2D:      CALL    PUSHR
            OR      A
            JR      NZ,L1D80            ; (+04dH)
            LD      HL,00100H
            LD      (L1042),HL
            CALL    L1C6D
            LD      HL,L1050
            BIT     7,(HL)
            JP      NZ,01FACH
            BIT     5,(HL)
            JP      NZ,L3BA1
            INC     HL
            BIT     7,(HL)
            JP      NZ,01FACH
            CALL    L44A3
            LD      HL,L27D0
            LD      BC,00008H
L1D58:      CALL    ?CLRHL
            DEC     C
            JR      NZ,L1D58            ; (-006H)
            CALL    L18C7
            LD      A,(ZDIRMX)
            LD      B,A
            LD      HL,L27D0
L1D68:      PUSH    BC
            LD      IX,(ZRO)
            CALL    _IOCALL
            PUSH    AF
            LD      BC,00020H
            ADD     HL,BC
            LD      (HL),000H
            POP     AF
            POP     BC
            JR      C,L1D7D             ; (+002H)
            DJNZ    L1D68               ; (-015H)
L1D7D:      JP      L18C6

L1D80:      LD      (01E28H),A
            XOR     A
            LD      (L1090),A
            LD      HL,L11A4
            PUSH    HL
            LD      DE,L1E32
            LD      B,00EH
            CALL    LDHLDE
            CALL    SETDNM
            LD      (HL),020H
            INC     HL
            LD      (HL),020H
            INC     HL
            EX      DE,HL
            CALL    L1D27
            LD      IX,(ZFREE)
            JR      Z,L1DAA             ; (+004H)
            LD      IX,L3BA1
L1DAA:      CALL    _IOCALL
            JR      C,L1DBD             ; (+00eH)
            LD      H,B
            LD      L,C
            LD      B,000H
            RST     018H
            DB      016H
            LD      HL,L1E40
            LD      B,009H
            CALL    LDDEHL
L1DBD:      EX      DE,HL
            LD      (HL),00DH
            INC     HL
            LD      (HL),000H
            POP     DE
            CALL    L1E27
            LD      B,040H
            LD      HL,L27D0
L1DCC:      CALL    L1DD8
            LD      DE,00020H
            ADD     HL,DE
            DJNZ    L1DCC               ; (-009H)
            JP      L3BA1

L1DD8:      CALL    PUSHR
            LD      A,(HL)
            OR      A
            RET     Z
            RET     M
            LD      DE,L11A4
            PUSH    DE
            LD      A,020H
            LD      B,026H
            CALL    ?SETDE
            LD      A,(HL)
            CP      00CH
            JR      C,L1DF1             ; (+002H)
            LD      A,00CH
L1DF1:      PUSH    HL
            POP     IY
            POP     DE
            PUSH    DE
            INC     DE
            LD      HL,L1E46
            LD      BC,L0003
L1DFD:      ADD     HL,BC
            DEC     A
            JR      NZ,L1DFD            ; (-004H)
            LDIR    
            EX      DE,HL
            BIT     0,(IY+012H)
            JR      Z,L1E0C             ; (+002H)
            LD      (HL),02AH
L1E0C:      INC     HL
            INC     HL
            LD      (HL),022H
            INC     HL
L1E11:      LD      A,(IY+001H)
            CP      00DH
            JR      Z,L1E1E             ; (+006H)
L1E18:      LD      (HL),A
            INC     IY
            INC     HL
            JR      L1E11               ; (-00dH)

L1E1E:      LD      (HL),022H
            INC     HL
            LD      (HL),00DH
            INC     HL
            LD      (HL),000H
            POP     DE
L1E27:      LD      A,000H
            RST     018H
            DB      02EH
            RST     018H
            DB      017H
            RST     018H
            DB      037H
            RST     018H
            DB      00FH
            RET     

L1E32:      DB      00DH,"DIRECTORY OF " ; Directory/file type strings
L1E40:      DB      " KB FR"
L1E46:      DS      2, 045H
            DB      ".OBJBTXBSDBRDRB"
            DS      2, 020H
            DB      "? LIB ?"
            DS      2, 020H
            DB      "? SYSGR"
            DS      2, 020H
            DB      03FH
            DB      020H
L1E6D:      PUSH    HL
L1E6E:      XOR     A
            LD      (L1042),A
            LD      IX,L1E86
            LD      (01E87H),SP
            CALL    L1C71
            POP     HL
            LD      IX,(ZINIT)
            CALL    _IOCALL
            RET     

L1E86:      LD      SP,L0000
            LD      B,000H
            RST     018H
            DB      038H
            JR      L1E6E               ; (-021H)

L1E8F:      DB      LSRF
            LD      H,H
            LD      BC,0C859H
            LD      DE,L1EA3
            RST     018H
            DB      005H
            LD      A,001H
            RST     018H
            DB      00DH
            CP      059H
            RET     Z
            JP      BREAKZ

L1EA3:      DB      "OK ? [Y/N]",019H,000H
            LD      DE,L1000
L1EB2:      CALL    PUSHR
            INC     HL
            INC     DE
            LD      A,(DE)
            CP      00DH
            RET     Z
            LD      B,011H
L1EBD:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            CP      00DH
            RET     Z
            INC     HL
            INC     DE
            DJNZ    L1EBD               ; (-00aH)
            OR      A
            RET     

L1EC9:      INC     HL
            LD      C,010H
L1ECC:      LD      A,B
            OR      A
            JR      Z,L1EE4             ; (+014H)
            LD      A,(DE)
            INC     DE
            DEC     B
            OR      A
            JR      Z,L1EE4             ; (+00eH)
            CP      022H
            JR      Z,L1ECC             ; (-00eH)
            CP      03AH
            JP      Z,01FAFH
            LD      (HL),A
            INC     HL
            DEC     C
            JR      NZ,L1ECC            ; (-018H)
L1EE4:      LD      (HL),00DH
            INC     HL
L1EE7:      LD      A,C
            OR      A
            RET     Z
            LD      (HL),020H
            INC     HL
            DEC     C
            JR      L1EE7               ; (-009H)

L1EF0:      LD      HL,(L1072)
L1EF3:      INC     (HL)
            DEC     (HL)
            SCF     
            RET     Z
            CP      (HL)
            INC     HL
            JR      Z,L1F03             ; (+008H)
            PUSH    DE
            CALL    LDDEMI
            ADD     HL,DE
            POP     DE
            JR      L1EF3               ; (-010H)

L1F03:      INC     HL
            INC     HL
            RET     

L1F06:      CALL    PUSHR
            RST     018H
            DB      029H
            RET     C
            DEC     HL
            LD      B,(HL)
            DEC     HL
            LD      C,(HL)
            DEC     HL
            LD      D,H
            LD      E,L
            INC     BC
            INC     BC
            INC     BC
            PUSH    BC
            ADD     HL,BC
            PUSH    HL
            LD      B,H
            LD      C,L
            LD      HL,(L107A)
            OR      A
            SBC     HL,BC
            LD      B,H
            LD      C,L
            POP     HL
            LDIR    
            POP     DE
            LD      HL,L0000
            OR      A
            SBC     HL,DE
            EX      DE,HL
            RST     018H
            DB      019H
            OR      A
            RET     

L1F32:      PUSH    AF
            PUSH    BC
            PUSH    DE
            PUSH    DE
            INC     DE
            INC     DE
            INC     DE
            LD      HL,(L107A)
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            JP      C,01F82H
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            SBC     HL,DE
            JR      C,01F82H             ; (+037H)
            LD      HL,(L107E)
            DEC     H
            DEC     H
            SBC     HL,DE
            JR      C,01F82H             ; (+02eH)
            POP     HL
            PUSH    HL
            LD      BC,(VARST)
            OR      A
            SBC     HL,BC
            LD      B,H
            LD      C,L
            POP     HL
            INC     BC
            LDDR    
            POP     DE
            LD      (HL),A
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            PUSH    HL
            INC     DE
            PUSH    DE
L1F6D:      LD      (HL),000H
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L1F6D            ; (-008H)
            POP     DE
            INC     DE
            INC     DE
            RST     018H
            DB      019H
            POP     HL
            POP     DE
            POP     BC
            POP     AF
            RET     

L1F7F:      LD      A,003H
            LD      HL,L063E
            LD      HL,09C3EH
            LD      HL,0A83EH
            LD      HL,0A93EH
            LD      HL,0AA3EH
            LD      HL,0AB3EH
            LD      HL,0AE3EH
            LD      HL,0B23EH
            LD      HL,0B33EH
            LD      HL,0B43EH
            LD      HL,0B53EH
            LD      HL,0B63EH
            LD      HL,0B73EH
            LD      HL,L3A3E
            LD      HL,0BB3EH
            LD      HL,0BC3EH
            LD      HL,0BD3EH
            LD      HL,0BF3EH
            LD      HL,L403E
            LD      HL,0C43EH
            JP      ERRORJ

L1FC0:      LD      A,(L1FD9)
            OR      A
            LD      B,000H
            CALL    NZ,L1BB9
            CALL    L3BA1
            CALL    L3028
            XOR     A
            LD      (L1FD9),A
            JP      L3BA1

            NOP     
            NOP     
            NOP     
L1FD9:      DB      000H
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L2000:      DS      230, 000H
L20E6:      DS      255, 000H
L21E5:      DS      283, 000H
L2300:      DS      38, 000H
L2326:      DS      88, 000H
L237E:      DS      353, 000H
L24DF:      DS      561, 000H
L2710:      DS      192, 000H
L27D0:      DS      88, 000H
L2828:      DS      720, 000H
L2AF8:      DS      77, 000H
L2B45:      DS      379, 000H
L2CC0:      DS      382, 000H
L2E3E:      DS      146, 000H
L2ED0:      DS      256, 000H
$QD:        DB      07FH                ; $QD - Quick Disk device descriptor
            DB      00FH
            DB      051H
            DB      044H
            DS      2, 000H
            DB      "_@ "
            DB      LSPAL
            DS      2, 02FH
            DB      "0M0",008H,030H,000H,004H,"@0W0"
            DS      4, 000H
            DB      0EDH
            DB      02FH
            XOR     A
            SCF     
            RET     

            RET     C
            CALL    TEST1
            DB      059H
            JR      Z,L2FFE             ; (+007H)
            OR      A
            JP      NZ,L1F7F
            CALL    L1E8F
L2FFE:      CALL    L3052
            RET     C
            RST     018H
            DB      010H
            LD      C,002H
            JR      L3047               ; (+03fH)

            OR      A
            JR      NZ,L3028            ; (+01dH)
            RST     018H
            DB      010H
            XOR     A
            LD      (L308C),A
            LD      C,005H
            CALL    L3019
            LD      BC,00001H
L3019:      LD      (L3082),HL
            LD      (03084H),DE
            LD      HL,L3081
            LD      (HL),B
            DEC     HL
            LD      (HL),C
            JR      L3096               ; (+06eH)

L3028:      CALL    PUSHR
            LD      C,006H
            JR      L3047               ; (+018H)

            LD      BC,L0003
            LD      DE,00040H
            CALL    L3019
            RET     NC
            CP      028H
            SCF     
            RET     NZ
            LD      A,000H
            RET     

            RST     018H
            DB      010H
            LD      D,B
            LD      E,C
            LD      BC,L0103
L3047:      CALL    L3019
            RST     018H
            DB      011H
            RET     

            LD      A,037H
            LD      (L305A),A
L3052:      LD      BC,L0101
            JR      L3019               ; (-03eH)

            PUSH    AF
            RST     018H
            DB      010H
L305A:      XOR     A
            JR      NC,L3071            ; (+014H)
            LD      A,0AFH
            LD      (L305A),A
            CALL    L1C3D
            LD      (L3086),HL
            LD      HL,L1000
            LD      DE,00040H
            POP     AF
            JR      L3077               ; (+006H)

L3071:      LD      (L3086),HL
            POP     AF
            SET     0,A
L3077:      LD      (03088H),BC
            LD      B,A
            LD      C,004H
            JR      L3047               ; (-039H)

            DB      000H
L3081:      DB      000H
L3082:      DS      4, 000H
L3086:      DS      4, 000H
L308A:      DB      000H
L308B:      DB      000H
L308C:      DB      000H
L308D:      DB      000H
L308E:      DB      000H
L308F:      DB      000H
L3090:      DB      000H
L3091:      DB      000H
L3092:      DB      000H
L3093:      DS      3, 000H
L3096:      LD      A,005H
            LD      (L3092),A
L309B:      DI      
            CALL    L30F2
            EI      
            RET     NC
            PUSH    AF
            CP      028H
            JR      Z,L30F0             ; (+04aH)
            CALL    L3371
            LD      A,(03080H)
            CP      004H
            JR      NZ,L30CD            ; (+01dH)
            LD      A,(L308E)
            OR      A
            JR      Z,L30D5             ; (+01fH)
            XOR     A
            LD      (L308E),A
            LD      A,(L308F)
            PUSH    HL
            LD      (03094H),SP
            POP     HL
            DI      
            CALL    L32F1
            EI      
            JR      C,L30EA             ; (+020H)
            CALL    L3371
L30CD:      CP      003H
            JR      NZ,L30D5            ; (+004H)
            LD      HL,L308A
            DEC     (HL)
L30D5:      POP     AF
            PUSH    AF
            CP      029H
            JR      NZ,L30EA            ; (+00fH)
            LD      HL,L3092
            DEC     (HL)
            JR      Z,L30EA             ; (+009H)
            POP     AF
            LD      A,(L308D)
            LD      (L308C),A
            JR      L309B               ; (-04fH)

L30EA:      CALL    L3263
            CALL    L310B
L30F0:      POP     AF
            RET     

L30F2:      LD      (03094H),SP
            LD      A,(03080H)
            DEC     A
            JR      Z,L3112             ; (+016H)
            DEC     A
            JR      Z,L3118             ; (+019H)
            DEC     A
            JR      Z,L3162             ; (+060H)
            DEC     A
            JP      Z,L31D6
            DEC     A
            JR      Z,L310B             ; (+002H)
            JR      L315B               ; (+050H)

L310B:      PUSH    AF
            XOR     A
            LD      (L308A),A
            POP     AF
            RET     

L3112:      LD      A,(L3081)
            JP      L32C5

L3118:      XOR     A
            CALL    L32F1
            CALL    L33EF
            LD      BC,0EFFFH
            LD      A,0AAH
L3124:      CPL     
            LD      D,A
            CALL    L3466
            DEC     BC
            LD      A,B
            OR      C
            JR      Z,L3131             ; (+003H)
            LD      A,D
            JR      L3124               ; (-00dH)

L3131:      CALL    L343C
            CALL    L3371
            CALL    L3324
            LD      A,(L3090)
            DEC     A
            JR      NZ,L315E            ; (+01eH)
            CALL    L3386
            LD      BC,0EFFFH
            LD      E,055H
L3148:      CP      E
            JR      NZ,L315E            ; (+013H)
            DEC     BC
            LD      A,B
            OR      C
            JR      Z,L3158             ; (+008H)
            LD      A,E
            CPL     
            LD      E,A
            CALL    L347C
            JR      L3148               ; (-010H)

L3158:      CALL    L344E
L315B:      JP      L3371

L315E:      LD      A,029H
            SCF     
            RET     

L3162:      LD      A,(L3091)
            OR      A
            CALL    Z,L3324
            CALL    L319C
            RET     C
            CALL    L34C1
            CALL    L347C
            LD      C,A
            CALL    L347C
            LD      B,A
            OR      C
            JP      Z,L326D
            LD      HL,(03084H)
            SBC     HL,BC
            JP      C,L326D
            LD      HL,(L3082)
L3187:      CALL    L347C
            LD      (HL),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3187            ; (-00aH)
            CALL    L344E
            LD      A,(L3081)
            BIT     0,A
            JR      NZ,L315B            ; (-040H)
            RET     

L319C:      LD      HL,L3090
            DEC     (HL)
            JR      Z,L31D2             ; (+030H)
            CALL    L3386
            LD      C,A
            LD      A,(L308A)
            LD      HL,L308B
            CP      (HL)
            JR      NZ,L31CF            ; (+020H)
            INC     A
            LD      (L308A),A
            LD      (HL),A
            LD      A,(L3081)
            XOR     C
            RRA     
            RET     NC
L31BA:      CALL    L347C
            LD      C,A
            CALL    L347C
            LD      B,A
L31C2:      CALL    L347C
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L31C2            ; (-008H)
            CALL    L344E
            JR      L319C               ; (-033H)

L31CF:      INC     (HL)
            JR      L31BA               ; (-018H)

L31D2:      LD      A,028H
            SCF     
            RET     

L31D6:      LD      A,(L308C)
            LD      (L308D),A
            LD      A,(L3091)
            OR      A
            JR      NZ,L31F9            ; (+017H)
            CALL    L3324
            LD      A,(L308C)
            LD      HL,L3090
            ADD     A,(HL)
            LD      (L3090),A
            INC     A
            LD      (L308A),A
            CALL    L319C
            JP      NC,L326D
L31F9:      LD      A,(L3081)
            LD      B,A
            AND     001H
            JR      NZ,L320D            ; (+00cH)
            LD      DE,L3082
            LD      A,B
            RES     2,A
            CALL    L3276
            CALL    L34C1
L320D:      LD      DE,L3086
            LD      A,(L3081)
            SET     0,A
            CALL    L3276
            CALL    L3371
            CALL    L34C1
            LD      A,(L3081)
            AND     004H
            JR      Z,L3271             ; (+04cH)
            LD      A,(L308F)
            LD      HL,L308C
            ADD     A,(HL)
            CALL    L32F1
            LD      A,001H
            LD      (L308E),A
L3234:      LD      A,(L308F)
            LD      HL,L308D
            ADD     A,(HL)
            INC     A
            LD      (L3090),A
            INC     A
            LD      (L308A),A
            CALL    L319C
            JR      NC,L326D            ; (+025H)
            LD      A,(L3081)
            AND     001H
            JR      NZ,L3256            ; (+007H)
            LD      DE,L3082
            CALL    L32A4
            RET     C
L3256:      LD      DE,L3086
            CALL    L32A4
            RET     C
            LD      A,(L308E)
            OR      A
            JR      Z,L326A             ; (+007H)
L3263:      XOR     A
            LD      (L308C),A
            LD      (L308E),A
L326A:      JP      L3371

L326D:      LD      A,029H
            SCF     
            RET     

L3271:      CALL    L3324
            JR      L3234               ; (-042H)

L3276:      PUSH    AF
            LD      HL,L308C
            INC     (HL)
            CALL    L33EF
            POP     AF
            CALL    L3466
            CALL    L329A
            LD      A,C
            CALL    L3466
            LD      A,B
            CALL    L3466
L328D:      LD      A,(HL)
            CALL    L3466
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L328D            ; (-00aH)
            JP      L343C

L329A:      EX      DE,HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            EX      DE,HL
            RET     

L32A4:      CALL    L3386
            CALL    L329A
            CALL    L347C
            CP      C
            JR      NZ,L326D            ; (-043H)
            CALL    L347C
            CP      B
            JR      NZ,L326D            ; (-049H)
L32B6:      CALL    L347C
            CP      (HL)
            JR      NZ,L326D            ; (-04fH)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L32B6            ; (-00cH)
            JP      L344E

L32C5:      LD      B,A
            LD      A,002H
            OUT     (SIOBC),A
            LD      A,081H
            OUT     (SIOBC),A
            LD      A,002H
            OUT     (SIOBC),A
            IN      A,(SIOBC)
            AND     081H
            CP      081H
            JP      NZ,03492H
            LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            LD      C,A
            AND     008H
            JP      Z,03492H
            LD      A,B
            OR      A
            RET     Z
            LD      A,C
            AND     020H
            RET     NZ
            JP      0348FH

L32F1:      PUSH    AF
            LD      HL,L34B8
            LD      B,009H
            CALL    L3361
L32FA:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     008H
            JP      Z,03492H
            LD      A,010H
            OUT     (SIOBC),A
            IN      A,(SIOBC)
            AND     008H
            JR      Z,L32FA             ; (-015H)
            LD      BC,000E9H
            CALL    L34A0
            CALL    L3424
            CALL    L3408
            POP     AF
            CALL    L3466
            CALL    L343C
            JR      L3357               ; (+033H)

L3324:      LD      HL,L34AD
            LD      B,00BH
            CALL    L3361
L332C:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     008H
            JP      Z,03492H
            CALL    L34C1
            LD      A,010H
            OUT     (SIOBC),A
            IN      A,(SIOBC)
            AND     008H
            JR      Z,L332C             ; (-018H)
            LD      BC,000E9H
            CALL    L34A0
            CALL    L339C
            LD      (L308F),A
            INC     A
            LD      (L3090),A
            CALL    L344E
L3357:      LD      HL,L3093
            SET     3,(HL)
            XOR     A
            LD      (L308B),A
            RET     

L3361:      LD      C,0F6H
            OTIR    
            LD      A,005H
            LD      (L3091),A
            OUT     (SIOBC),A
            LD      A,080H
            OUT     (SIOBC),A
            RET     

L3371:      PUSH    AF
            LD      A,005H
            OUT     (0F6H),A
            LD      A,060H
            OUT     (0F6H),A
            LD      A,005H
            OUT     (SIOBC),A
            XOR     A
            LD      (L3091),A
            OUT     (SIOBC),A
            POP     AF
            RET     

L3386:      LD      A,058H
            LD      B,00BH
            LD      HL,L34AD
            CALL    L342D
            LD      HL,L3093
            BIT     3,(HL)
            LD      BC,L0003
            JR      Z,L339F             ; (+005H)
            RES     3,(HL)
L339C:      LD      BC,L00A0
L339F:      CALL    L34A0
            LD      A,005H
            OUT     (SIOBC),A
            LD      A,082H
            OUT     (SIOBC),A
            LD      A,003H
            OUT     (0F6H),A
            LD      A,LSD3
            OUT     (0F6H),A
            LD      BC,L2CC0
L33B5:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     010H
            JR      Z,L33C7             ; (+008H)
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L33B5            ; (-00fH)
            JP      03498H

L33C7:      LD      A,003H
            OUT     (0F6H),A
            LD      A,0C3H
            OUT     (0F6H),A
            LD      B,09FH
L33D1:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     001H
            JR      NZ,L33E1            ; (+006H)
            DEC     B
            JR      NZ,L33D1            ; (-00dH)
            JP      03498H

L33E1:      LD      A,003H
            OUT     (0F6H),A
            LD      A,0C9H
            OUT     (0F6H),A
            CALL    L347C
            JP      L347C

L33EF:      LD      A,098H
            LD      B,009H
            LD      HL,L34B8
            CALL    L342D
            CALL    L3424
            LD      HL,L3093
            BIT     3,(HL)
            LD      BC,0001DH
            JR      Z,L340B             ; (+005H)
            RES     3,(HL)
L3408:      LD      BC,L0140
L340B:      CALL    L34A0
            LD      A,005H
            OUT     (0F6H),A
            LD      A,0EFH
            OUT     (0F6H),A
            LD      BC,00001H
            CALL    L34A0
            LD      A,0C0H
            OUT     (0F6H),A
            LD      A,0A5H
            JR      L3466               ; (+042H)

L3424:      LD      A,005H
            OUT     (0F6H),A
            LD      A,0FFH
            OUT     (0F6H),A
            RET     

L342D:      LD      C,0F6H
            OUT     (C),A
            LD      A,005H
            OUT     (SIOBC),A
            LD      A,080H
            OUT     (SIOBC),A
            OTIR    
            RET     

L343C:      LD      BC,00001H
            CALL    L34A0
            LD      A,010H
            OUT     (SIOBC),A
            IN      A,(SIOBC)
            AND     008H
            RET     NZ
            JP      03495H

L344E:      LD      B,003H
L3450:      CALL    L347C
            DJNZ    L3450               ; (-005H)
L3455:      IN      A,(0F6H)
            RRCA    
            JR      NC,L3455            ; (-005H)
            LD      A,001H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     040H
            JR      NZ,L348C            ; (+028H)
            OR      A
            RET     

L3466:      PUSH    AF
L3467:      IN      A,(0F6H)
            AND     004H
            JR      Z,L3467             ; (-006H)
            POP     AF
            OUT     (SIOAD),A
L3470:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     008H
            JP      Z,03492H
            RET     

L347C:      CALL    L3470
            IN      A,(0F6H)
            RLCA    
            JR      C,L348C             ; (+008H)
            RRCA    
            RRCA    
            JR      NC,L347C            ; (-00cH)
            IN      A,(SIOAD)
            OR      A
            RET     

L348C:      LD      A,029H
            LD      HL,L2E3E
            LD      HL,0323EH
            LD      HL,0353EH
            LD      HL,L363E
            LD      SP,(03094H)
            SCF     
            RET     

L34A0:      PUSH    AF
L34A1:      LD      A,096H
L34A3:      DEC     A
            JR      NZ,L34A3            ; (-003H)
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L34A1            ; (-00aH)
            POP     AF
            RET     

L34AD:      DB      058H
            DB      004H
            DB      010H
            DB      005H
            DB      004H
            DB      003H
            DB      LSD0
            DB      006H
            DB      016H
            DB      007H
            DB      016H
L34B8:      DB      098H
            DB      004H
            DB      010H
            DB      006H
            DB      016H
            DB      007H
            DB      016H
            DB      005H
            DB      06DH
L34C1:      LD      A,0E8H
            OUT     (LSD0),A
            NOP     
            IN      A,(LSD1)
            AND     081H
            RET     NZ
            CALL    L3263
            JP      BREAKX

            DS      2, 000H
L34D3:      DS      2, 000H
L34D5:      DS      2, 000H
L34D7:      DS      2, 000H
L34D9:      DB      000H
L34DA:      DB      000H
L34DB:      DB      000H
L34DC:      DB      000H
L34DD:      DB      000H
L34DE:      CALL    PUSHR
            LD      HL,L351D
            OR      A
            JR      Z,L34EA             ; (+003H)
            LD      HL,L3611
L34EA:      LD      (03506H),HL
            RST     018H
            DB      028H
            CALL    L310B
            PUSH    HL
            LD      (03094H),SP
            POP     HL
            XOR     A
            CALL    L32C5
            JR      C,L351A             ; (+01cH)
            LD      A,005H
            LD      (L3092),A
L3503:      RST     018H
            DB      010H
            CALL    L0000
            CALL    L3371
            RST     018H
            DB      011H
            RET     NC
            CP      029H
            JR      NZ,L351A            ; (+008H)
            LD      HL,L3092
            DEC     (HL)
            JR      NZ,L3503            ; (-015H)
            LD      A,029H
L351A:      JP      ERRORJ

L351D:      LD      (03094H),SP
            LD      HL,L0000
            CALL    L40B5
            DEC     DE
            DEC     DE
            LD      (034D1H),DE
            LD      HL,00002H
            CALL    L40B5
            LD      HL,00010H
            OR      A
            SBC     HL,DE
            JP      NZ,L3752
            LD      (034D5H),DE
            INC     DE
            INC     DE
            LD      (034D7H),DE
            LD      HL,L34D3
            LD      (HL),000H
            INC     HL
            LD      (HL),000H
            CALL    L3324
L3551:      LD      HL,L3090
            DEC     (HL)
            JP      Z,L35F7
            CALL    L3386
            LD      (L34DB),A
            CALL    L347C
            LD      (L34DC),A
            CALL    L347C
            LD      (L34DD),A
            LD      HL,(L34DC)
            LD      DE,(034D7H)
            ADD     HL,DE
            JR      C,L3578             ; (+004H)
            LD      BC,00002H
            ADD     HL,BC
L3578:      JP      C,L360A
            LD      BC,(034D1H)
            SBC     HL,BC
            JR      Z,L3586             ; (+003H)
            JP      NC,L360A
L3586:      LD      HL,L34DB
            LD      BC,L0003
            CALL    L40D0
            EX      DE,HL
            LD      DE,(034DCH)
            LD      A,D
            OR      E
            JP      Z,L348C
L3599:      IN      A,(0F6H)
            RLCA    
            JR      C,L360F             ; (+071H)
            RRCA    
            RRCA    
            JR      NC,L3599            ; (-009H)
            IN      A,(SIOAD)
            LD      C,0EBH
            LD      B,H
            OUT     (C),L
            DEC     C
            OUT     (C),A
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L3599            ; (-019H)
            CALL    L344E
            LD      (L34D7),HL
            LD      HL,(L34D3)
            LD      DE,(034DCH)
            ADD     HL,DE
            INC     HL
            INC     HL
            INC     HL
            LD      (L34D3),HL
            LD      A,(L34DB)
            BIT     2,A
            JR      NZ,L35D6            ; (+009H)
L35CD:      CALL    BRKCHK
            JP      NZ,L3551
            JP      BREAKZ

L35D6:      LD      DE,(034D5H)
            ADD     HL,DE
            INC     HL
            INC     HL
            LD      (L34D5),HL
            PUSH    HL
            EX      DE,HL
            LD      DE,(034D3H)
            CALL    L40AA
            LD      HL,L0000
            LD      (L34D3),HL
            POP     HL
            INC     HL
            INC     HL
            LD      (L34D7),HL
            JR      L35CD               ; (-02aH)

L35F7:      LD      HL,(L34D5)
            LD      DE,00002H
            EX      DE,HL
            CALL    L40AA
            EX      DE,HL
            NOP     
            LD      DE,L0000
            CALL    L40AA
            RET     

L360A:      CALL    L35F7
            LD      A,035H
L360F:      SCF     
            RET     

L3611:      LD      (03094H),SP
            XOR     A
            LD      (L34DA),A
            LD      (L34D9),A
            LD      (L308C),A
            LD      HL,00010H
            CALL    L40B5
            LD      A,D
            OR      E
            RET     Z
            CALL    L3324
            LD      A,(L3090)
            DEC     A
            JP      NZ,L3752
            LD      HL,00010H
L3635:      CALL    L40B5
            LD      (034D3H),DE
            LD      A,D
            OR      E
L363E:      JR      Z,L36BA             ; (+07aH)
            INC     HL
            INC     HL
L3642:      PUSH    HL
            CALL    L33EF
            POP     HL
            CALL    L409F
            CALL    L3466
            INC     HL
            CALL    L40B5
            LD      (034DCH),DE
            LD      A,E
            CALL    L3466
            LD      A,D
            CALL    L3466
            INC     HL
            INC     HL
L365F:      LD      C,0EBH
            LD      B,H
            OUT     (C),L
            DEC     C
            IN      B,(C)
L3667:      IN      A,(0F6H)
            AND     004H
            JR      Z,L3667             ; (-006H)
            LD      A,B
            OUT     (SIOAD),A
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L365F            ; (-017H)
            LD      BC,00001H
            CALL    L34A0
            LD      A,010H
            OUT     (SIOBC),A
            IN      A,(SIOBC)
            AND     008H
            JR      NZ,L368E            ; (+008H)
            LD      A,035H
            LD      (L34D9),A
            JP      L36BA

L368E:      PUSH    HL
            LD      HL,L308C
            INC     (HL)
            CALL    BRKCHK
            JP      Z,BREAKZ
            LD      HL,(L34D3)
            LD      DE,(034DCH)
            LD      BC,L0003
            XOR     A
            SBC     HL,DE
            SBC     HL,BC
            JR      Z,L36B0             ; (+006H)
            LD      (L34D3),HL
            POP     HL
            JR      L3642               ; (-06eH)

L36B0:      POP     HL
            LD      A,(L308C)
            LD      (L34DA),A
            JP      L3635

L36BA:      LD      A,(L34DA)
            LD      (L308C),A
            CALL    L3371
            CALL    L3324
            LD      HL,00010H
L36C9:      CALL    L40B5
            LD      (034D3H),DE
            INC     HL
            INC     HL
L36D2:      LD      A,(L34DA)
            DEC     A
            JP      Z,L373E
            LD      (L34DA),A
            PUSH    HL
            CALL    L3386
            POP     HL
            LD      D,A
            CALL    L409F
            CP      D
            JR      NZ,L3756            ; (+06eH)
            INC     HL
            CALL    L40B5
            LD      (034DCH),DE
            CALL    L347C
            CP      E
            JR      NZ,L3756            ; (+060H)
            CALL    L347C
            CP      D
            JR      NZ,L3756            ; (+05aH)
            INC     HL
            INC     HL
L36FE:      IN      A,(0F6H)
            RLCA    
            JR      C,L3756             ; (+053H)
            RRCA    
            RRCA    
            JR      NC,L36FE            ; (-009H)
            IN      A,(SIOAD)
            LD      C,0EBH
            LD      B,H
            OUT     (C),L
            DEC     C
            IN      B,(C)
            CP      B
            JR      NZ,L3756            ; (+042H)
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L36FE            ; (-01cH)
            CALL    L344E
            PUSH    HL
            CALL    BRKCHK
            JP      Z,BREAKZ
            LD      HL,(L34D3)
            LD      DE,(034DCH)
            LD      BC,L0003
            XOR     A
            SBC     HL,DE
            SBC     HL,BC
            JR      Z,L373B             ; (+006H)
            LD      (L34D3),HL
            POP     HL
            JR      L36D2               ; (-069H)

L373B:      POP     HL
            JR      L36C9               ; (-075H)

L373E:      CALL    L3371
            LD      A,(L308C)
            CALL    L32F1
            XOR     A
            LD      (L308C),A
            LD      A,(L34D9)
            OR      A
            RET     Z
            SCF     
            RET     

L3752:      LD      A,036H
            SCF     
            RET     

L3756:      LD      A,029H
            SCF     
            RET     

$RFS:       DB      "d<CMT",000H,05FH ; $RFS - ROM Filing System (SD card) device descriptor
L3761:      DB      0C0H,000H,077H,037H,0C0H,037H,085H,037H,0B2H
            DS      2, 000H
            DB      001H
            DB      00DH
            DB      038H
            DB      0B9H
            DB      037H
            DS      4, 000H
            DB      0ACH
            DB      01FH
            CALL    TEST1
            DB      054H
            LD      HL,L3761
            SET     4,(HL)
            RET     Z
            RES     4,(HL)
            OR      A
            RET     

            CALL    PUSHR
            LD      DE,L10F0
            LD      A,(HL)
            LD      C,005H
            CP      002H
            JR      Z,L3799             ; (+007H)
            LD      C,004H
            CP      003H
            JR      Z,L3799             ; (+001H)
            LD      C,A
L3799:      LD      A,C
            LD      (DE),A
            INC     HL
            INC     DE
            LD      BC,00011H
            LDIR    
            INC     HL
            INC     HL
            LD      BC,L0006
            LDIR    
            LD      B,068H
            CALL    ?CLRDE
            LD      HL,L10F0
            LD      BC,00080H
            CALL    L382E
            JR      L37BC               ; (+003H)

            CALL    L3832
L37BC:      JP      C,BREAKX
            RET     

            LD      A,037H
            LD      (L380D),A
            PUSH    HL
            LD      HL,L10F0
            LD      BC,00080H
            CALL    L386C
            JR      C,L3824             ; (+053H)
            LD      DE,L3A10
            CALL    L39DF
            POP     DE
            LD      A,(L1042)
            OR      A
            LD      A,(HL)
            JP      NZ,L37E6
            LD      C,002H
            CP      005H
            JR      Z,L37F4             ; (+00eH)
L37E6:      LD      C,003H
            CP      004H
            JR      Z,L37F4             ; (+008H)
            LD      C,A
            SUB     002H
            CP      002H
            JP      C,01FB2H
L37F4:      LD      A,C
            LD      (DE),A
            DB      023H
$CMT:       DB      013H                ; $CMT - Cassette device descriptor
            DB      001H
            DB      011H
            DB      000H
L37FB:      DB      0EDH
            DB      0B0H
            DB      0AFH
            DB      006H
            DB      002H
            DB      LSRF
            DB      03DH
            DS      2, 001H
            DB      006H
            DB      000H
            DB      0EDH
            DB      0B0H
            DS      2, 006H
            DB      0C3H
            DB      03DH
            DB      001H
L380D:      DB      0AFH,030H,010H,03EH,0AFH,032H,00DH
            JR      C,L37FB             ; (-01bH)
            LD      HL,L1000
            LD      DE,L3A1D
            CALL    L39DF
            POP     HL
            CALL    L3870
            RET     NC
L3824:      CP      002H
            JP      NZ,BREAKX
            LD      A,0C6H
            JP      ERRORJ

L382E:      LD      A,LSWF
            JR      L3834               ; (+002H)

L3832:      LD      A,053H
L3834:      LD      (03865H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      E,A
            LD      D,0D7H
            LD      A,B
            OR      C
            JR      Z,L3863             ; (+020H)
            CALL    L3AD9
            CALL    L38C5
            JR      C,L385F             ; (+014H)
            LD      A,E
            CP      LSWF
            JR      NZ,L3858            ; (+008H)
            PUSH    DE
            LD      DE,L3A03
            CALL    L39DF
            POP     DE
L3858:      DI      
            CALL    L3AFB
            CALL    NC,L3915
L385F:      DI      
            CALL    L3B68
L3863:      POP     DE
            LD      SP,L0000
            PUSH    AF
            RST     018H
            DB      011H
            POP     AF
            RET     

L386C:      LD      A,LSWF
            JR      L3872               ; (+002H)

L3870:      LD      A,053H
L3872:      LD      (03865H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      D,LSD2
            LD      E,A
            LD      A,B
            OR      C
            JR      Z,L3863             ; (-01eH)
            CALL    L38C5
            DI      
            CALL    NC,L3A99
            CALL    NC,L394D
            JR      L385F               ; (-02eH)

L388D:      PUSH    HL
            LD      DE,L3A2A
            LD      HL,L1000
            CALL    L39DF
            POP     HL
            CALL    L38A6
            RET     NC
            CP      002H
            JP      NZ,BREAKX
            LD      A,083H
            JP      ERRORJ

L38A6:      LD      (03865H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      D,LSD2
            LD      E,053H
            LD      A,B
            OR      C
            JR      Z,L3863             ; (-053H)
            CALL    L3AD9
            CALL    L38C5
            DI      
            CALL    NC,L3A99
            CALL    NC,L3996
            JR      L385F               ; (-066H)

L38C5:      CALL    PUSHR
            RST     018H
            DB      010H
            LD      A,0F8H
            OUT     (LSD0),A
            LD      B,00AH
L38D0:      IN      A,(LSD2)
            AND     010H
            JR      Z,L38DF             ; (+009H)
L38D6:      LD      B,0FFH
L38D8:      CALL    L3B80
            DJNZ    L38D8               ; (-005H)
            XOR     A
            RET     

L38DF:      LD      A,006H
            OUT     (LSD3),A
            INC     A
            OUT     (LSD3),A
            DJNZ    L38D0               ; (-018H)
            LD      A,(L108E)
            OR      A
            JR      NZ,L3907            ; (+019H)
            RST     018H
            DB      002H
            LD      A,07FH
            RST     018H
            DB      004H
            LD      A,020H
            RST     018H
            DB      003H
            LD      A,D
            CP      0D7H
            LD      DE,L39D3
            JR      Z,L3903             ; (+003H)
            LD      DE,039DAH
L3903:      RST     018H
            DB      005H
            RST     018H
            DB      002H
L3907:      IN      A,(LSD2)
            AND     010H
            JR      NZ,L38D6            ; (-037H)
            IN      A,(LSD1)
            AND     080H
            JR      NZ,L3907            ; (-00cH)
            SCF     
            RET     

L3915:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      D,002H
            LD      A,0F8H
            OUT     (LSD0),A
L391E:      LD      A,(HL)
            CALL    L3A86
            IN      A,(LSD1)
            AND     080H
            SCF     
            JR      Z,L398A             ; (+061H)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L391E            ; (-011H)
            LD      HL,(L1197)
            LD      A,H
            CALL    L3A86
            LD      A,L
            CALL    L3A86
            CALL    L3B57
            XOR     A
            DEC     D
            JR      Z,L398A             ; (+049H)
            LD      B,A
L3942:      CALL    L3B40
            DJNZ    L3942               ; (-005H)
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
            JR      L391E               ; (-02fH)

L394D:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      D,002H
L3952:      CALL    L3A37
            JR      C,L398A             ; (+033H)
            CALL    L3B8F
            IN      A,(LSD2)
            AND     020H
            JR      Z,L3952             ; (-00eH)
            LD      HL,L0000
            LD      (L1197),HL
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
L396A:      CALL    L3A59
            JR      C,L398A             ; (+01bH)
            LD      (HL),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L396A            ; (-00cH)
            LD      HL,(L1197)
            CALL    L3A59
            JR      C,L398A             ; (+00cH)
            CP      H
            JR      NZ,L398E            ; (+00dH)
            CALL    L3A59
            JR      C,L398A             ; (+004H)
            CP      L
            JR      NZ,L398E            ; (+005H)
L3989:      XOR     A
L398A:      POP     HL
            POP     BC
            POP     DE
            RET     

L398E:      DEC     D
            JR      NZ,L3952            ; (-03fH)
L3991:      LD      A,002H
            SCF     
            JR      L398A               ; (-00cH)

L3996:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      D,002H
L399B:      CALL    L3A37
            JR      C,L398A             ; (-016H)
            CALL    L3B8F
            IN      A,(LSD2)
            AND     020H
            JR      Z,L399B             ; (-00eH)
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
L39AD:      CALL    L3A59
            JR      C,L398A             ; (-028H)
            CP      (HL)
            JR      NZ,L3991            ; (-024H)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L39AD            ; (-00eH)
            LD      HL,(L1199)
            CALL    L3A59
            JR      C,L398A             ; (-039H)
            CP      H
            JR      NZ,L3991            ; (-035H)
            CALL    L3A59
            JR      C,L398A             ; (-041H)
            CP      L
            JR      NZ,L3991            ; (-03dH)
            DEC     D
            JR      NZ,L399B            ; (-036H)
            JR      L3989               ; (-04aH)

L39D3:      LD      D,D
            LD      B,L
            LD      B,E
            LD      C,A
            LD      D,D
            LD      B,H
            LD      L,050H
            LD      C,H
            LD      B,C
            LD      E,C
            NOP     
L39DF:      LD      A,(L108E)
            OR      A
            RET     NZ
            RST     018H
            DB      002H
            RST     018H
            DB      005H
            PUSH    HL
            INC     HL
            LD      A,022H
            RST     018H
            DB      003H
            LD      D,010H
L39F0:      LD      A,(HL)
            CP      00DH
            JR      Z,L39FB             ; (+006H)
            RST     018H
            DB      003H
            INC     HL
            DEC     D
            JR      NZ,L39F0            ; (-00bH)
L39FB:      LD      A,022H
            RST     018H
            DB      003H
            RST     018H
            DB      002H
            POP     HL
            RET     

L3A03:      LD      D,A
            DEC     B
            LD      D,D
            LD      C,C
            LD      D,H
            LD      C,C
            LD      C,(HL)
            LD      B,A
            JR      NZ,L3A2D            ; (+020H)
            JR      NZ,L3A15            ; (+006H)
            NOP     
L3A10:      LD      B,(HL)
            DEC     B
            LD      C,A
            LD      D,L
            LD      C,(HL)
L3A15:      LD      B,H
            JR      NZ,03A38H            ; (+020H)
            JR      NZ,03A3AH            ; (+020H)
            JR      NZ,L3A22            ; (+006H)
            NOP     
L3A1D:      LD      C,H
            DEC     B
            LD      C,A
            LD      B,C
            LD      B,H
L3A22:      LD      C,C
            LD      C,(HL)
            LD      B,A
            JR      NZ,03A47H            ; (+020H)
            JR      NZ,L3A2F            ; (+006H)
            NOP     
L3A2A:      LD      D,(HL)
            DEC     B
            LD      B,L
L3A2D:      LD      D,D
            LD      C,C
L3A2F:      LD      B,(HL)
            LD      E,C
            LD      C,C
            LD      C,(HL)
            LD      B,A
            JR      NZ,L3A3C            ; (+006H)
            NOP     
L3A37:      LD      A,0F8H
            OUT     (LSD0),A
            NOP     
L3A3C:      IN      A,(LSD1)
L3A3E:      AND     081H
            JR      NZ,L3A44            ; (+002H)
            SCF     
            RET     

L3A44:      IN      A,(LSD2)
            AND     020H
            JR      NZ,L3A3C            ; (-00eH)
L3A4A:      IN      A,(LSD1)
            AND     081H
            JR      NZ,L3A52            ; (+002H)
            SCF     
            RET     

L3A52:      IN      A,(LSD2)
            AND     020H
            JR      Z,L3A4A             ; (-00eH)
            RET     

L3A59:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      HL,00800H
L3A5F:      CALL    L3A37
            JP      C,03AD5H
            CALL    L3B8F
            IN      A,(LSD2)
            AND     020H
            JP      Z,L3A79
            PUSH    HL
            DB      02AH                ; CMT status strings (RECORD/PLAY)
            DB      097H
            DB      011H
            DB      023H
            DB      022H
            DB      097H
            DB      011H
            DB      LSE1
            DB      037H
L3A79:      DB      07DH
            DB      017H
            DB      06FH
            DEC     H
            JP      NZ,L3A5F
            CALL    L3A37
            LD      A,L
            JR      03AD5H               ; (+04fH)

L3A86:      PUSH    BC
            LD      B,008H
            CALL    L3B57
L3A8C:      RLCA    
            CALL    C,L3B57
            CALL    NC,L3B40
            DEC     B
            JP      NZ,L3A8C
            POP     BC
            RET     

L3A99:      CALL    L3B28
            PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      HL,L2828
            DB      07BH
            DB      0FEH
            DB      LSWF
            DB      028H
            DB      003H
            DB      021H
            DS      2, 014H
            DB      022H
            SUB     L
            LD      DE,L952A
            DB      011H
            DB      LSRF
            DB      "7:8 "
            DB      LSRF
            DB      08FH
            DB      03BH
            DB      0DBH
            JP      NC,L20E6
            DB      028H,0EFH,025H,020H,0EFH
            DB      LSRF
            DB      "7:8",00FH
            CALL    L3B8F
            DB      0DBH
            DB      LSD2
            DB      0E6H
            DS      2, 020H
            DB      0DEH
            DB      02DH
            DB      020H
            DB      0EFH
            DB      LSRF
            SCF     
            LD      A,(0C1E1H)
            POP     DE
            RET     

L3AD9:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      DE,L0000
L3ADF:      LD      A,B
            OR      C
            JR      NZ,L3AEC            ; (+009H)
            EX      DE,HL
            LD      (L1197),HL
            LD      (L1199),HL
            JR      03AD5H               ; (-017H)

L3AEC:      LD      A,(HL)
            PUSH    BC
            LD      B,008H
L3AF0:      RLCA    
            JR      NC,L3AF4            ; (+001H)
            INC     DE
L3AF4:      DJNZ    L3AF0               ; (-006H)
            POP     BC
            INC     HL
            DEC     BC
            JR      L3ADF               ; (-01cH)

L3AFB:      PUSH    DE
            PUSH    BC
            LD      A,E
            LD      BC,L55F0
            LD      DE,L2828
            CP      LSWF
            JP      Z,L3B0F
            LD      BC,L2AF8
            LD      DE,L1414
L3B0F:      CALL    L3B40
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3B0F            ; (-008H)
L3B17:      CALL    L3B57
            DEC     D
            JR      NZ,L3B17            ; (-006H)
L3B1D:      CALL    L3B40
            DEC     E
            JR      NZ,L3B1D            ; (-006H)
            CALL    L3B57
            JR      03AD6H               ; (-052H)

L3B28:      PUSH    DE
            PUSH    BC
            PUSH    HL
L3B2B:      LD      H,064H
L3B2D:      CALL    L3A37
            JR      C,03AD5H             ; (-05dH)
            CALL    L3B8F
            IN      A,(LSD2)
            AND     020H
            JR      NZ,L3B2B            ; (-010H)
            DEC     H
            JR      NZ,L3B2D            ; (-011H)
L3B3E:      JR      03AD5H               ; (-06bH)

L3B40:      PUSH    AF
            LD      A,003H
            OUT     (LSD3),A
            CALL    L3B96
            CALL    L3B96
            LD      A,002H
            OUT     (LSD3),A
            CALL    L3B96
            CALL    L3B96
            POP     AF
            RET     

L3B57:      PUSH    AF
            LD      A,003H
            OUT     (LSD3),A
            CALL    L3B9A
            LD      A,002H
            OUT     (LSD3),A
            CALL    L3B9A
            POP     AF
            RET     

L3B68:      PUSH    AF
            PUSH    BC
            PUSH    DE
            LD      B,00AH
L3B6D:      IN      A,(LSD2)
            AND     010H
            JR      Z,L3B7C             ; (+009H)
            LD      A,006H
            OUT     (LSD3),A
            INC     A
            OUT     (LSD3),A
            DJNZ    L3B6D               ; (-00fH)
L3B7C:      POP     DE
            POP     BC
            POP     AF
            RET     

L3B80:      PUSH    BC
            LD      B,014H
L3B83:      CALL    L3B8F
            CALL    L3B8D
            DJNZ    L3B83               ; (-008H)
            POP     BC
            RET     

L3B8D:      NOP     
            RET     

L3B8F:      NOP     
            LD      A,04CH
L3B92:      DEC     A
            JR      NZ,L3B92            ; (-003H)
            RET     

L3B96:      LD      A,018H
            JR      L3B92               ; (-008H)

L3B9A:      LD      A,069H
            JR      L3B92               ; (-00cH)

L3B9E:      RET     NC
            CPL     
            NOP     
L3BA1:      OR      A
            RET     

L3BA3:      JP      01FACH

L3BA6:      CALL    PUSHR
            LD      HL,(ZDELT)
            LD      A,L
            OR      H
            JR      Z,L3BC5             ; (+015H)
            PUSH    HL
            RST     018H
            DB      02FH
            LD      A,002H
            LD      (L1043),A
            CALL    L1C6D
            JR      L3BDA               ; (+01dH)

L3BBD:      CALL    PUSHR
            LD      HL,(ZWDIR)
            LD      A,L
            OR      H
L3BC5:      JP      Z,01FACH
            PUSH    HL
            RST     018H
            DB      02FH
            LD      HL,L1000
            CALL    L1EC9
            LD      HL,L0200
            LD      (L1042),HL
            CALL    L1C3D
L3BDA:      POP     IX
            JP      _IOCALL

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L3C00:      CP      010H
            JR      C,L3C16             ; (+012H)
            CP      080H
            JR      Z,L3C19             ; (+011H)
            CP      0C0H
            JR      Z,L3C19             ; (+00dH)
            DI      
            OUT     (LSE2),A
            CALL    00BB9H
            OUT     (LSE0),A
            EI      
            RET     

L3C16:      LD      A,LSPAL
            RET     

L3C19:      SUB     040H
            RET     

L3C1C:      CP      LSPAL
            JR      NC,L3C38            ; (+018H)
            CP      073H
            JR      Z,L3C16             ; (-00eH)
            CP      040H
            JR      Z,$FD               ; (+013H)
            CP      080H
            JR      Z,$FD               ; (+00fH)
            DI      
            OUT     (LSE2),A
            CALL    L0BCE
            OUT     (LSE0),A
            EI      
            CP      LSPAL
            RET     NZ
L3C38:      LD      A,020H
            RET     

$FD:        DB      0C6H                ; $FD - Floppy Disk stub device descriptor
            DB      040H
            DB      0C9H
L3C3E:      PUSH    AF
            LD      A,L
            SUB     008H
            JR      C,L3C48             ; (+004H)
            SUB     030H
            JR      C,L3C4F             ; (+007H)
L3C48:      ADD     A,00AH
            LD      L,A
            ADD     HL,BC
            LD      C,(HL)
            POP     AF
            RET     

L3C4F:      LD      A,(BC)
            PUSH    AF
            INC     BC
            LD      A,(BC)
            LD      B,A
            POP     AF
            LD      C,A
            ADD     HL,BC
            DI      
            OUT     (LSE2),A
            LD      A,(HL)
            OUT     (LSE0),A
            EI      
            CALL    L3C1C
            LD      C,A
            POP     AF
            RET     

$RS:        DB      0C6H,">RS" ; $RS - RS-232C device descriptor
            DS      2, 000H
            DB      08FH,001H,000H,07DH,03CH,0AEH,03CH,0AEH,03CH,0BFH,03CH,0BFH,03CH
            DB      LSD0
            DB      03CH
            DB      0FBH
            DB      03CH
            DB      0B2H
            DB      000H
            RET     C
            PUSH    IY
            CALL    L3D25
            CALL    L3C8B
            CALL    L3D6E
            JR      L3CE3               ; (+058H)

L3C8B:      RST     018H
            DB      013H
            LD      (IY-003H),E
            CALL    TEST1
            DB      02CH
            JP      NZ,L1F7F
            RST     018H
            DB      013H
            LD      (IY-002H),E
            CALL    TEST1
            DB      000H
            RET     Z
            CALL    TEST1
            DB      02CH
            JP      NZ,L1F7F
            RST     018H
            DB      013H
            LD      (IY-008H),E
            RET     

            PUSH    IY
            CALL    L3D25
            LD      A,(IY-001H)
            INC     (IY-001H)
            OR      A
            CALL    Z,L3DD0
            JR      L3CE3               ; (+024H)

            PUSH    IY
            CALL    L3D25
            DEC     (IY-001H)
            LD      A,(IY-001H)
            OR      A
            CALL    Z,L3DB8
            JR      L3CE2               ; (+012H)

            PUSH    IY
            CALL    L3D25
            CALL    L3CE6
            JP      C,IOERR
            CP      (IY-008H)
            JR      NZ,L3CE2            ; (+002H)
            LD      A,00DH
L3CE2:      OR      A
L3CE3:      POP     IY
            RET     

L3CE6:      BIT     6,(IY-002H)
            JP      Z,L3E1F
            LD      IX,L3E1F
            PUSH    IY
            POP     HL
            LD      DE,0FFFBH
            ADD     HL,DE
            JP      L146C

            PUSH    IY
            CALL    L3D25
            CP      00DH
            JR      NZ,L3D07            ; (+003H)
            LD      A,(IY-008H)
L3D07:      CALL    L3D0C
            JR      L3CE3               ; (-029H)

L3D0C:      BIT     6,(IY-002H)
            JP      Z,L3E64
            LD      IX,L3E64
            PUSH    IY
            POP     HL
            LD      DE,0FFF9H
            ADD     HL,DE
            LD      DE,(DISPX)
            JP      L142B

L3D25:      PUSH    AF
            PUSH    DE
            LD      A,(L1046)
            INC     A
            LD      IY,03D30H
            LD      DE,L0015
L3D32:      ADD     IY,DE
            DEC     A
            JR      NZ,L3D32            ; (-005H)
            LD      C,(IY+000H)
            POP     DE
            POP     AF
            RET     

            DS      8, 000H
            DB      0B1H
            DB      0B0H
            DB      000H
            DS      2, 010H
            DB      004H,040H,003H,0C0H,005H,060H,030H,003H
            DS      8, 000H
            DB      0B3H
            DB      0B2H
            DB      000H
            DS      2, 010H
            DB      004H,040H,003H,0C0H,005H,060H,030H,003H
L3D67:      CALL    BRKCHK
            RET     NZ
            JP      BREAKZ

L3D6E:      LD      A,018H
            OUT     (C),A
            LD      A,030H
            OUT     (C),A
            LD      A,(IY-002H)
            AND     00CH
            JR      NZ,L3D81            ; (+004H)
            SET     2,(IY-002H)
L3D81:      LD      A,(IY-002H)
            LD      B,A
            AND     00FH
            OR      040H
            LD      (IY+006H),A
            LD      A,B
            AND     080H
            OR      040H
            LD      (IY+008H),A
            RRA     
            AND     07FH
            OR      00AH
            LD      (IY+00AH),A
            LD      A,B
            OR      07FH
            LD      (IY+002H),A
            CALL    L3DC4
L3DA5:      IN      A,(C)
            RRCA    
            RET     NC
            DEC     C
            IN      A,(C)
            INC     C
            LD      A,001H
            OUT     (C),A
            IN      A,(C)
            AND     070H
            JR      Z,L3DA5             ; (-012H)
            RET     

L3DB8:      RES     0,(IY+008H)
            RES     7,(IY+00AH)
            LD      (IY-001H),000H
L3DC4:      LD      B,00AH
            PUSH    IY
            POP     HL
            LD      DE,L0003
            ADD     HL,DE
            OTIR    
            RET     

L3DD0:      LD      A,030H
            OUT     (C),A
            RET     

L3DD5:      SET     0,(IY+008H)
            LD      A,013H
            OUT     (C),A
            LD      A,(IY+008H)
            OUT     (C),A
            LD      A,035H
            OUT     (C),A
            LD      A,(IY+00AH)
            OR      088H
            LD      (IY+00AH),A
            OUT     (C),A
            RET     

            LD      A,003H
            OUT     (C),A
            RES     0,(IY+008H)
            LD      A,(IY+008H)
            OUT     (C),A
L3DFE:      RES     7,(IY+00AH)
            JR      L3E14               ; (+010H)

L3E04:      SET     1,(IY+00AH)
            JR      L3E14               ; (+00aH)

L3E0A:      RES     1,(IY+00AH)
            JR      L3E14               ; (+004H)

            SET     7,(IY+00AH)
L3E14:      LD      A,005H
            OUT     (C),A
            LD      A,(IY+00AH)
            OUT     (C),A
            OR      A
            RET     

L3E1F:      CALL    PUSHR
            LD      C,(IY+000H)
L3E25:      CALL    L3D67
            CALL    L3E9D
            JR      C,L3E25             ; (-008H)
            CALL    L3DD5
L3E30:      CALL    L3D67
            IN      A,(C)
            RRCA    
            JR      NC,L3E30            ; (-008H)
            DEC     C
            IN      A,(C)
            INC     C
            AND     (IY+002H)
            PUSH    AF
            LD      A,001H
            OUT     (C),A
            IN      A,(C)
            AND     070H
            JR      NZ,L3E4F            ; (+005H)
            CALL    L3DFE
            POP     AF
            RET     

L3E4F:      LD      B,A
            POP     AF
            PUSH    BC
            CALL    L3D6E
            POP     BC
            LD      A,01DH
            RLC     B
            RLC     B
            RET     C
            INC     A
            RLC     B
            RET     C
            INC     A
            SCF     
            RET     

L3E64:      CALL    PUSHR
            LD      C,(IY+000H)
            LD      D,A
            CALL    L3E04
L3E6E:      CALL    L3D67
            CALL    L3EA4
            CALL    NC,L3EB5
            JR      C,L3E6E             ; (-00bH)
            IN      A,(C)
            BIT     2,A
            JR      Z,L3E6E             ; (-011H)
            BIT     7,(IY-003H)
            JR      Z,L3E8E             ; (+009H)
            LD      A,001H
            OUT     (C),A
            IN      A,(C)
            RRCA    
            JR      NC,L3E6E            ; (-020H)
L3E8E:      DEC     C
            OUT     (C),D
            INC     C
            BIT     6,(IY-003H)
            JR      Z,L3E9B             ; (+003H)
            CALL    L3E0A
L3E9B:      OR      A
            RET     

L3E9D:      OR      A
            BIT     0,(IY-003H)
            JR      L3EA9               ; (+005H)

L3EA4:      OR      A
            BIT     1,(IY-003H)
L3EA9:      RET     Z
            LD      A,010H
            OUT     (C),A
            IN      A,(C)
            AND     008H
            RET     NZ
            SCF     
            RET     

L3EB5:      OR      A
            BIT     2,(IY-003H)
            RET     Z
            LD      A,010H
            OUT     (C),A
            IN      A,(C)
            AND     020H
            RET     NZ
            SCF     
            RET     

$RAM:       DB      09EH,";RAM",000H,05FH ; $RAM - EMM device descriptor
            DS      2, 020H
            DB      014H,03FH,0A9H,03FH,0EAH,03FH,09BH,03FH,000H,004H,0D5H,03FH,011H,"@V@",083H,040H
            DB      LSE3
            DB      03EH
            CALL    L3EEF
            LD      C,H
            LD      B,000H
            SRL     C
            SRL     C
            OR      A
            RET     

L3EEF:      PUSH    DE
            LD      HL,L0000
            CALL    L40B5
            PUSH    DE
            INC     HL
            INC     HL
            CALL    L40B5
            POP     HL
            SBC     HL,DE
            JP      C,01F8BH
            POP     DE
            RET     

L3F04:      LD      DE,00010H
L3F07:      LD      HL,00002H
            CALL    L40AA
            EX      DE,HL
            LD      DE,L0000
            JP      L40AA

            RET     C
            LD      A,(L13C3)
            OR      A
            JP      Z,01F97H
            CALL    L1E8F
            CALL    TEST1
            DB      02CH
            PUSH    HL
            CALL    L3F04
            POP     HL
            CALL    TEST1
            DB      000H
            RET     Z
            RST     018H
            DB      013H
L3F2F:      LD      HL,L0000
            DI      
            LD      B,001H
            LD      A,D
            AND     LSFC
            CP      LSFC
            LD      HL,0FFFFH
            JR      Z,L3F48             ; (+009H)
            LD      B,003H
            LD      A,D
            OR      A
            LD      HL,00020H
            JR      NZ,L3F49            ; (+001H)
L3F48:      EX      DE,HL
L3F49:      LD      A,B
            LD      (L13C3),A
            LD      HL,L0000
            CALL    L40AA
            CALL    L14F4
            EI      
            RET     

L3F58:      LD      HL,00008H
            LD      B,L
            LD      C,000H
L3F5E:      CALL    L409F
            SUB     L
            OR      C
            LD      C,A
            LD      A,L
            CALL    L4094
            INC     L
            DJNZ    L3F5E               ; (-00dH)
            LD      A,C
            OR      A
            JR      NZ,L3F81            ; (+012H)
            LD      HL,L0000
            CALL    L40B5
            LD      A,002H
            INC     D
            JR      Z,L3F7B             ; (+001H)
            INC     A
L3F7B:      LD      (L13C3),A
            JP      L14F4

L3F81:      CALL    L3F04
            LD      HL,L0000
            LD      A,05AH
            CALL    L4094
            CALL    L409F
            SUB     05AH
            LD      DE,0C000H
            JR      Z,L3F2F             ; (-067H)
            XOR     A
            LD      (L13C3),A
            RET     

            LD      A,(L13C3)
            OR      A
            JP      Z,01F97H
            LD      HL,00010H
            LD      (L13C4),HL
            RET     

            LD      B,H
            LD      C,L
            LD      HL,(L13C4)
            CALL    L40B5
            LD      A,D
            OR      E
            SCF     
            RET     Z
            INC     HL
            INC     HL
            PUSH    HL
            ADD     HL,DE
            JP      C,01F8BH
            LD      (L13C4),HL
            POP     HL
            INC     HL
            INC     HL
            INC     HL
            LD      D,B
            LD      E,C
            LD      BC,BRKCHK
            CALL    L40DE
            LD      BC,00022H
            ADD     HL,BC
            EX      DE,HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            OR      A
            RET     

            EX      DE,HL
            LD      L,(IY+01EH)
            LD      H,(IY+01FH)
            INC     HL
            INC     HL
            INC     HL
            CALL    L40DE
            LD      (IY+01EH),L
            LD      (IY+01FH),H
            OR      A
            RET     

            PUSH    AF
            CALL    L1C3D
            PUSH    HL
            LD      HL,00002H
            CALL    L40B5
            LD      (013C6H),DE
            PUSH    DE
            LD      HL,L0047
            ADD     HL,DE
            CALL    L4045
            POP     DE
            INC     DE
            INC     DE
            POP     HL
            LD      BC,00040H
            POP     AF
            CALL    L40C0
            LD      (013C8H),DE
            RET     

            PUSH    AF
            PUSH    HL
            PUSH    BC
            LD      HL,(013C8H)
            INC     BC
            INC     BC
            INC     BC
            ADD     HL,BC
            CALL    L4045
            POP     BC
            POP     HL
            LD      DE,(013C8H)
            POP     AF
            PUSH    AF
            OR      001H
            CALL    L40C0
            LD      (013C8H),DE
            POP     AF
            BIT     2,A
            RET     Z
            PUSH    DE
            CALL    L3F07
            POP     HL
            LD      DE,(013C6H)
            DEC     HL
            DEC     HL
L403E:      OR      A
            SBC     HL,DE
            EX      DE,HL
            JP      L40AA

L4045:      JR      C,L4053             ; (+00cH)
            PUSH    HL
            LD      HL,L0000
            CALL    L40B5
            OR      A
            POP     HL
            SBC     HL,DE
            RET     C
L4053:      JP      01FA0H

            LD      HL,(ELMD30)
            LD      DE,0FFBBH
            ADD     HL,DE
            CALL    L40B5
            EX      DE,HL
            ADD     HL,DE
            INC     HL
            INC     HL
            PUSH    DE
            PUSH    HL
            LD      HL,00002H
            CALL    L40B5
            EX      DE,HL
            POP     DE
            PUSH    DE
            OR      A
            SBC     HL,DE
            INC     HL
            INC     HL
            LD      B,H
            LD      C,L
            POP     HL
            POP     DE
            CALL    L40EA
            DEC     DE
            DEC     DE
            LD      HL,00002H
            JP      L40AA

            LD      HL,(ELMD30)
            LD      DE,0FFC0H
            ADD     HL,DE
            EX      DE,HL
            LD      HL,L1000
            LD      BC,00020H
            JP      L40D0

L4094:      PUSH    BC
            LD      C,0EBH
            LD      B,H
            OUT     (C),L
            OUT     (0EAH),A
            POP     BC
            OR      A
            RET     

L409F:      PUSH    BC
            LD      C,0EBH
            LD      B,H
            OUT     (C),L
            IN      A,(0EAH)
            POP     BC
            OR      A
            RET     

L40AA:      LD      A,E
            CALL    L4094
            INC     HL
            LD      A,D
            CALL    L4094
            DEC     HL
            RET     

L40B5:      CALL    L409F
            LD      E,A
            INC     HL
            CALL    L409F
            LD      D,A
            DEC     HL
            RET     

L40C0:      EX      DE,HL
            CALL    L4094
            INC     HL
            LD      A,C
            CALL    L4094
            INC     HL
            LD      A,B
            CALL    L4094
            INC     HL
            EX      DE,HL
L40D0:      EX      DE,HL
L40D1:      LD      A,(DE)
            CALL    L4094
            INC     HL
            INC     DE
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L40D1            ; (-00bH)
            EX      DE,HL
            RET     

L40DE:      CALL    L409F
            LD      (DE),A
            INC     HL
            INC     DE
            DEC     BC
            LD      A,B
            OR      C
            RET     Z
            JR      L40DE               ; (-00cH)

L40EA:      CALL    L409F
            EX      DE,HL
            CALL    L4094
            EX      DE,HL
            INC     HL
            INC     DE
            DEC     BC
            LD      A,B
            OR      C
            RET     Z
            JR      L40EA               ; (-010H)

L40FA:      DB      000H                ; PSG data tables (INTM, STBL, PTBL, LTBL, ETBL, NTBL)
L40FB:      DS      2, 000H
L40FD:      DB      080H
            DB      000H
L40FF:      DB      09FH
            DB      0A0H
            DB      000H
            DB      0BFH
            DB      0C0H
            DB      000H
L4105:      DB      0DFH
L4106:      DS      16, 000H
            DB      001H
            DS      15, 000H
            DB      002H
            DS      15, 000H
            DB      003H
            DS      15, 000H
L4146:      DB      001H
            DB      002H
            DB      003H
            DB      004H
            DB      006H
            DB      008H
            DB      00CH
            DB      010H
            DB      018H
            DB      020H
            DB      017H
            DB      014H
            DB      011H
            DB      00DH
            DB      00AH
            DB      007H
            DB      003H
L4157:      DB      000H
            DB      005H
            DS      2, 003H
            DB      00FH
            DB      004H
            DB      001H
            DB      003H
            DB      000H
            DB      005H
            DB      002H
            DB      000H
            DB      00FH
            DB      004H
            DB      001H
            DS      2, 000H
            DB      005H
            DB      002H
            DB      003H
            DB      00FH
            DB      004H
            DS      2, 003H
            DB      000H
            DB      005H
            DB      004H
            DB      000H
            DB      00FH
            DB      004H
            DB      005H
            DS      2, 000H
            DS      2, 003H
            DB      000H
L417B:      DB      000H,03FH,007H,03BH,002H,038H,00FH,034H,000H,032H,003H,02FH,009H,02CH,001H,02AH,00BH,027H,007H,025H,006H,023H,006H,021H
L4193:      DB      008H
            DB      01FH
            DB      00CH
            DB      01DH
            DB      001H
            DB      01CH
            DB      008H
            DB      01AH
            DB      000H
            DB      019H
            DB      009H
            DB      017H
            DB      004H
            DB      016H
            DB      000H
            DB      015H
            DB      00DH
            DB      013H
            DB      00CH
            DB      012H
            DB      00BH
            DB      011H
            DB      00BH
            DB      010H
            DB      00CH
            DB      00FH
            DS      2, 00EH
            DB      000H
            DB      00EH
            DB      004H
            DB      00DH
            DB      008H
            DB      00CH
            DB      00DH
            DB      00BH
            DB      002H
            DB      00BH
            DB      008H
            DB      00AH
            DB      00FH
            DB      009H
            DB      006H
            DB      009H
            DB      00DH
            DB      008H
            DB      005H
            DB      008H
            DB      00EH
            DS      3, 007H
            DB      000H
            DB      007H
            DB      00AH
            DB      006H
            DB      004H
            DB      006H
            DB      00EH
            DB      005H
            DB      009H
            DB      005H
            DB      004H
            DB      005H
            DB      00FH
            DB      004H
            DB      00BH
            DB      004H
            DB      007H
            DB      004H
            DB      003H
            DB      004H
            DB      00FH
            DB      003H
            DB      00BH
            DB      003H
            DB      008H
            DB      003H
            DB      005H
            DB      003H
            DB      002H
            DB      003H
            DB      00FH
            DB      002H
            DB      00DH
            DB      002H
            DB      00AH
            DB      002H
            DB      008H
            DB      002H
            DB      005H
            DB      002H
            DB      003H
            DB      002H
            DB      001H
            DB      002H
            DB      00FH
            DB      001H
            DB      00EH
            DB      001H
            DB      00CH
            DB      001H
            DB      00AH
            DB      001H
            DB      009H
            DB      001H
            DB      008H
            DB      001H
            DB      006H
            DB      001H
            DB      005H
            DB      001H
            DB      004H
            DB      001H
            DB      003H
            DB      001H
            DB      002H
            DS      3, 001H
            DB      000H
            DB      001H
            DB      00FH
            DB      000H
            DB      00EH
            DB      000H
L4211:      DB      09FH
            DB      0BFH
            DB      0DFH
            DB      0FFH
L4215:      DB      080H
            DB      000H
            DB      090H
L4218:      DS      2, 000H
            PUSH    IY
            CALL    L4224
            POP     IY
            EI      
            RETI    

L4224:      CALL    PUSHRA
            CALL    L44CC
            LD      A,(L40FA)
            OR      A
            JP      Z,L447E
            DEC     A
            JP      NZ,L43B9
            LD      BC,L09F2
            LD      HL,L40FD
            OTIR    
            LD      B,008H
            LD      A,(L40FB)
            OR      A
            JP      Z,L447E
            LD      C,A
L4247:      DEC     B
            RET     M
            RLC     C
            JR      NC,L4247            ; (-006H)
            PUSH    BC
            LD      A,B
            CALL    L43FC
            BIT     0,(IY+00DH)
            CALL    Z,L425F
            CALL    L42AC
            POP     BC
            JR      L4247               ; (-018H)

L425F:      DEC     (HL)
            RET     NZ
            INC     HL
            LD      A,(HL)
            DEC     HL
            LD      (HL),A
            INC     HL
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            EX      DE,HL
L426B:      LD      A,(HL)
            OR      A
            JR      NZ,L4273            ; (+004H)
            DEC     HL
            DEC     HL
            JR      L426B               ; (-008H)

L4273:      EX      DE,HL
            INC     HL
            DEC     A
            JR      Z,L4288             ; (+010H)
            DEC     A
            JR      Z,L4296             ; (+01bH)
            DEC     A
            RET     Z
            DEC     A
            LD      A,(HL)
            JR      Z,L428C             ; (+00bH)
            INC     A
            CP      00FH
            JR      Z,L429A             ; (+014H)
            JR      C,L429A             ; (+012H)
L4288:      LD      A,00FH
            JR      L4299               ; (+00dH)

L428C:      DEC     A
            JP      M,L4296
            LD      C,(IY+00EH)
            CP      C
            JR      NC,L429A            ; (+004H)
L4296:      LD      A,(IY+00EH)
L4299:      INC     DE
L429A:      LD      (HL),A
            DEC     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
L429F:      AND     00FH
            LD      B,A
            LD      A,(IX+002H)
            AND     LSPAL
            OR      B
            LD      (IX+002H),A
            RET     

L42AC:      DEC     (IY+006H)
            RET     NZ
            DEC     (IY+007H)
            LD      A,(IY+008H)
            LD      (IY+006H),A
            RET     NZ
            LD      A,(IY+009H)
            LD      (IY+007H),A
            LD      E,(IY+00AH)
            LD      D,(IY+00BH)
L42C6:      LD      A,(DE)
            INC     DE
            CP      0FFH
            JR      Z,L4331             ; (+065H)
            CP      0A0H
            JR      Z,L432A             ; (+05aH)
            CP      090H
            JR      NC,L4339            ; (+065H)
            CP      080H
            JR      NC,L4340            ; (+068H)
            CP      060H
            JR      NC,L434A            ; (+06eH)
            SUB     009H
            LD      (IY+00AH),E
            LD      (IY+00BH),D
            SET     0,(IY+00DH)
            JR      C,L42F1             ; (+007H)
            RES     0,(IY+00DH)
            CALL    L4362
L42F1:      LD      A,(IY+002H)
            LD      (IY+001H),A
            LD      A,(IY+008H)
            LD      (IY+006H),A
            LD      A,(IY+009H)
            LD      (IY+007H),A
            BIT     0,(IY+00DH)
            JR      NZ,L4334            ; (+02bH)
            LD      A,(IY+00CH)
            LD      BC,L4157
            ADD     A,A
            ADD     A,A
            LD      H,000H
            LD      L,A
            ADD     HL,BC
            LD      A,(HL)
            OR      A
            JR      NZ,L431C            ; (+003H)
            LD      A,(IY+00EH)
L431C:      LD      (IY+005H),A
            CALL    L429F
            INC     HL
            LD      (IY+003H),L
            LD      (IY+004H),H
            RET     

L432A:      LD      A,(DE)
            INC     DE
            LD      (IY+002H),A
L432F:      JR      L42C6               ; (-06bH)

L4331:      CALL    L4464
L4334:      LD      A,00FH
            JP      L429F

L4339:      SUB     090H
            LD      (IY+00CH),A
            JR      L432F               ; (-011H)

L4340:      SUB     080H
            CPL     
            AND     00FH
            LD      (IY+00EH),A
            JR      L432F               ; (-01bH)

L434A:      SUB     060H
            LD      B,000H
            LD      C,A
            LD      HL,L4146
            ADD     HL,BC
            CP      00AH
            LD      A,(HL)
            JR      NC,L435D            ; (+005H)
            LD      (IY+008H),A
            JR      L432F               ; (-02eH)

L435D:      LD      (IY+009H),A
            JR      L432F               ; (-033H)

L4362:      ADD     A,A
            LD      HL,L417B
            LD      B,000H
            LD      C,A
            ADD     HL,BC
            LD      B,(HL)
            LD      A,(IX+000H)
            AND     LSPAL
            OR      B
            LD      (IX+000H),A
            INC     HL
            LD      A,(HL)
            LD      (IX+001H),A
            RET     

L437A:      OR      A
            JP      P,L43C6
            AND     00FH
            LD      C,PSGA
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            OR      080H
            LD      B,A
            BIT     4,A
            JR      NZ,L43AB            ; (+01eH)
            CP      LSE0
            JR      Z,L43A7             ; (+016H)
            LD      A,D
            CP      004H
            JR      NC,L43B6            ; (+020H)
            LD      A,E
            AND     00FH
            OR      B
            OUT     (C),A
            LD      A,D
            LD      B,004H
L439F:      RL      E
            RLA     
            DJNZ    L439F               ; (-005H)
            OUT     (C),A
            RET     

L43A7:      BIT     3,E
            JR      NZ,L43B6            ; (+00bH)
L43AB:      LD      A,E
            AND     LSPAL
            OR      D
            JR      NZ,L43B6            ; (+005H)
            LD      A,E
            OR      B
            OUT     (C),A
            RET     

L43B6:      JP      L1F7F

L43B9:      LD      HL,(L4218)
            DEC     HL
            LD      (L4218),HL
            LD      A,L
            OR      H
            RET     NZ
            JP      L447E

L43C6:      LD      C,A
            LD      A,D
            OR      E
            RET     Z
            LD      A,C
            LD      IX,L4215
            CP      054H
            RET     NC
            SUB     009H
            PUSH    AF
            LD      A,090H
            JR      NC,L43DB            ; (+002H)
            LD      A,09FH
L43DB:      LD      (IX+002H),A
            CALL    L44A3
            POP     AF
            CALL    NC,L4362
            DI      
            LD      A,002H
            LD      (L40FA),A
            LD      (04218H),DE
            LD      HL,L4215
            LD      BC,L03F2
            OTIR    
            CALL    L44CC
            EI      
            RET     

L43FC:      PUSH    BC
            PUSH    AF
            CP      003H
            JR      C,L4403             ; (+001H)
            DEC     A
L4403:      LD      HL,L40FD
            LD      B,A
            ADD     A,A
            ADD     A,B
            LD      C,A
            LD      B,000H
            ADD     HL,BC
            PUSH    HL
            POP     IX
            POP     AF
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            LD      HL,L4106
            LD      B,000H
            LD      C,A
            ADD     HL,BC
            PUSH    HL
            POP     IY
            INC     HL
            POP     BC
            RET     

L4422:      CP      0FFH
            JR      NZ,L4435            ; (+00fH)
            LD      A,003H
L4428:      PUSH    AF
            PUSH    DE
            CALL    L4435
            POP     DE
            POP     AF
            DEC     A
            JP      M,L445A
            JR      L4428               ; (-00dH)

L4435:      PUSH    AF
            LD      HL,L4105
            CP      003H
            JR      Z,04441H             ; (+004H)
            LD      A,0DFH
            DB      018H
            LD      B,03EH
            RST     020H
            OUT     (PSGA),A
            LD      A,0FFH
            LD      (HL),A
            DI      
            LD      A,001H
            LD      (L40FA),A
            POP     AF
            CALL    L43FC
            CALL    L4468
            CALL    L42C6
            EI      
            RET     

L445A:      DI      
            LD      A,(L40FA)
            OR      A
            CALL    NZ,L44CC
            EI      
            RET     

L4464:      LD      B,086H
            JR      L446A               ; (+002H)

L4468:      LD      B,0C6H
L446A:      LD      HL,L40FB
            LD      A,(IY+000H)
            OR      A
            RLCA    
            RLCA    
            RLCA    
            OR      B
            LD      (04479H),A
            RLC     B
            RET     

L447B:      CALL    PUSHR
L447E:      XOR     A
            LD      (L40FA),A
            LD      (L40FB),A
            LD      BC,L04F2
            LD      HL,L4211
            OTIR    
            LD      B,003H
            LD      HL,L40FF
L4492:      LD      A,(HL)
            AND     LSPAL
            OR      00FH
            LD      (HL),A
            INC     HL
            INC     HL
            INC     HL
            DJNZ    L4492               ; (-00bH)
            LD      A,003H
            OUT     (LSFC),A
            XOR     A
            RET     

L44A3:      LD      A,(L40FA)
            OR      A
            RET     Z
            RST     018H
            DB      00EH
            JR      NZ,L44A3            ; (-009H)
            JP      BREAKZ

L44AF:      DEC     B
            JP      Z,L445A
            DEC     B
            JR      Z,L447B             ; (-03bH)
            DEC     B
            JR      Z,L44A3             ; (-016H)
            CALL    L447B
            LD      BC,L05FC
            LD      HL,L44DC
            OTIR    
            LD      DE,044EDH
            LD      A,0FFH
            JP      L4422

L44CC:      LD      HL,L44DC
            LD      BC,L05FC
            OTIR    
            LD      HL,L44E1
            LD      B,006H
            JP      IOOUT

L44DC:      DB      LSFC
            DB      0FFH
            DB      03FH
            DB      017H
            DB      0EFH
L44E1:      DB      030H
            DB      0D7H
            DB      0B0H
            DB      0D4H
            DB      02AH
            DB      0D4H
            INC     B
            OUT     (000H),A
            OUT     (083H),A
            CALL    M,L6D65
            DB      098H
            DB      0A0H
            DS      2, 0FFH
L44F3:      CALL    PUSHR
            RST     018H
            DB      010H
            LD      HL,L4514
            LD      B,004H
            CALL    IOOUT
            LD      BC,SVC_ENTRY
L4503:      EX      (SP),HL
            DJNZ    L4503               ; (-003H)
            DEC     C
            JR      NZ,L4503            ; (-006H)
            LD      HL,L451C
            LD      B,002H
            CALL    IOOUT
            RST     018H
            DB      011H
            RET     

L4514:      LD      (HL),0D7H
            LD      BC,0F9D3H
            CALL    NC,0D403H
L451C:      LD      (HL),0D7H
            NOP     
            OUT     (LSRF),A
            CP      D
            NOP     
            LD      DE,L4538
            AND     00FH
            ADD     A,069H
            LD      (DE),A
            LD      B,003H
            RST     018H
            DB      023H
            LD      A,0FFH
            RST     018H
            DB      021H
            LD      B,001H
            RST     018H
            DB      023H
            RET     

L4538:      DB      000H
            DB      0FFH
L453A:      CALL    TEST1
            DB      04DH
            JR      Z,L4561             ; (+021H)
            OR      A
            JR      Z,L458E             ; (+04bH)
            CP      042H
            JP      NZ,L1F7F
            XOR     A
            LD      (L137E),A
            LD      A,(L137A)
            CP      002H
            JP      NZ,01FBBH
            INC     HL
            LD      B,004H
            CALL    DEVASC
            LD      (L137E),A
            RST     018H
            DB      051H
            JR      L4581               ; (+020H)

L4561:      LD      B,005H
            CALL    DEVASC
            OR      A
            JR      Z,L458B             ; (+022H)
            LD      B,A
            RST     018H
            DB      050H
            JP      C,01FBBH
            LD      A,B
            LD      (L137A),A
            XOR     A
            LD      (L108F),A
            SCF     
L4578:      ADC     A,A
            DJNZ    L4578               ; (-003H)
            LD      (L1379),A
            CALL    L4593
L4581:      CALL    TEST1
            DB      000H
            RET     Z
            CP      02CH
            INC     HL
            JR      Z,L453A             ; (-051H)
L458B:      JP      L1F7F

L458E:      LD      A,(L137A)
            RST     018H
            DB      050H
L4593:      CALL    L459D
            XOR     A
            LD      (L137E),A
            RST     018H
            DB      051H
            RET     

L459D:      LD      A,(L1379)
            LD      B,003H
            RRA     
            JR      C,L45B1             ; (+00cH)
            LD      B,00FH
            RRA     
            JR      C,L45B1             ; (+007H)
            LD      B,001H
            RRA     
            JR      C,L45B1             ; (+002H)
            LD      B,003H
L45B1:      LD      A,B
            LD      (L137B),A
            RST     018H
            DB      054H
            RET     

L45B8:      DB      0FFH
            DB      0FEH
            DB      LSFC
            DB      0F8H
            DB      LSPAL
            DB      LSE0
            DB      0C0H
            DB      080H
L45C0:      DB      001H
            DB      003H
            DB      007H
            DB      00FH
            DB      01FH
            DB      03FH
            DB      07FH
            DB      0FFH
L45C8:      DB      001H
            DB      002H
            DB      004H
            DB      008H
            DB      010H
            DB      020H
            DB      040H
            DB      080H
L45D0:      LD      BC,L0703
            LD      HL,L45D9
            JP      PATCH

L45D9:      DB      0C8H,04EH,080H,0BEH,040H,09FH,0C5H,046H,080H,0FDH,0C0H,0FEH,030H,054H,080H,002H,040H,001H,0C1H,04CH,050H,000H,028H,000H,0D4H,04CH,050H,000H,028H,000H
            DB      LSFC
            DB      04CH,080H,0FDH,0C0H,0FEH,003H,04DH,07FH,002H,03FH,001H,00FH,046H,029H,000H,"$NP(",0BEH,"NP("
L460F:      DB      029H,07BH,0E6H,007H,047H,07BH,0E6H,0F8H,082H
            DS      3, 00FH
            DB      04FH,078H,006H,080H,054H,05DH
            DS      2, 029H
            DB      019H
            DS      3, 029H
            DB      009H
            DB      0C9H
L4629:      CALL    L46B2
            JP      C,L479B
            CALL    L460F
            RLCA    
            RLCA    
            RLCA    
            OR      046H
            LD      (0464CH),A
            LD      C,LSRF
            LD      A,(0109DH)
            LD      B,A
            DI      
            IN      A,(LSE0)
            XOR     A
L4644:      RR      B
            JR      C,L4653             ; (+00bH)
            OUT     (C),B
            OR      A
            BIT     0,(HL)
            JR      Z,L4650             ; (+001H)
            SCF     
L4650:      RLA     
            JR      L4644               ; (-00fH)

L4653:      LD      B,A
            IN      A,(LSE1)
            EI      
            LD      A,(0109CH)
            AND     B
            LD      B,A
            LD      A,(L1098)
            CP      006H
            LD      A,B
            RET     NZ
            CP      004H
            RET     C
            SUB     002H
            RET     

L4669:      LD      A,0FFH
L466B:      PUSH    BC
            OR      A
            LD      A,(L109F)
            LD      C,A
            LD      A,(L109A)
            JR      Z,L4682             ; (+00cH)
            OR      A
            LD      A,0C0H
            JR      Z,L467D             ; (+002H)
            LD      A,040H
L467D:      OR      C
            OUT     (LSWF),A
            POP     BC
            RET     

L4682:      OR      A
            LD      A,060H
            JR      NZ,L467D            ; (-00aH)
            LD      A,(0109CH)
            LD      B,A
            LD      A,C
            CPL     
            AND     B
            OR      0C0H
            OUT     (LSWF),A
            POP     BC
            RET     

L4694:      CALL    L466B
L4697:      CALL    L46B2
            JP      C,L479B
            CALL    L460F
            EX      DE,HL
            LD      HL,L45C8
            LD      B,000H
            LD      C,A
            ADD     HL,BC
            DI      
            IN      A,(LSE0)
            LDI     
            IN      A,(LSE1)
            EI      
            XOR     A
            RET     

L46B2:      PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      A,H
            RLCA    
            JR      C,L46C8             ; (+00fH)
            LD      BC,0FF38H
            ADD     HL,BC
            JR      C,L46C8             ; (+009H)
            LD      A,D
            RLCA    
            JR      C,L46C8             ; (+005H)
            EX      DE,HL
            LD      BC,0FD80H
            ADD     HL,BC
L46C8:      POP     HL
            POP     DE
            POP     BC
            RET     

L46CC:      LD      A,0FFH
L46CE:      CALL    L466B
            PUSH    DE
            PUSH    HL
            EXX     
            LD      (KEYBUF),DE
            LD      (L11A9),HL
            EXX     
            PUSH    HL
            PUSH    DE
            EX      DE,HL
            LD      HL,(L11A9)
            CALL    L478B
            LD      (L11AD),A
            LD      (L11AB),HL
            POP     DE
            JP      NC,L4778
            PUSH    HL
            LD      HL,(L11A4)
            CALL    L478B
            LD      (L11A8),A
            LD      (L11A6),HL
            POP     BC
            POP     DE
            JP      NC,L4784
            XOR     A
            SBC     HL,BC
            JR      NC,L4719            ; (+013H)
            LD      HL,L11A4
            LD      DE,L11A9
            LD      B,005H
L470E:      LD      A,(DE)
            LD      C,(HL)
            LD      (HL),A
            LD      A,C
            LD      (DE),A
            INC     HL
            INC     DE
            DJNZ    L470E               ; (-009H)
            LD      A,0EBH
L4719:      LD      (L4753),A
            LD      (L475D),A
            LD      A,(L11AD)
            AND     A
            LD      A,023H
            JR      Z,L4729             ; (+002H)
            LD      A,02BH
L4729:      LD      (L476F),A
            LD      A,(L11A8)
            AND     A
            LD      A,013H
            JR      Z,L4736             ; (+002H)
            LD      A,01BH
L4736:      LD      (L4763),A
            EXX     
            LD      HL,(L11A6)
            LD      D,H
            LD      E,L
            SRL     H
            RR      L
            LD      BC,(011ABH)
            EXX     
            LD      HL,(L11A9)
            LD      DE,(KEYBUF)
            LD      BC,(011A6H)
L4753:      EX      DE,HL
            PUSH    HL
            PUSH    DE
            PUSH    BC
            CALL    L4697
            POP     BC
            POP     DE
            POP     HL
L475D:      EX      DE,HL
            DEC     BC
            LD      A,B
            INC     A
            JR      Z,L4773             ; (+010H)
L4763:      NOP     
            EXX     
            OR      A
            SBC     HL,BC
            EXX     
            JP      NC,L4753
            EXX     
            ADD     HL,DE
            EXX     
L476F:      NOP     
            JP      L4753

L4773:      EXX     
            POP     HL
            POP     DE
            EXX     
            RET     

L4778:      POP     HL
L4779:      CALL    L4C16
            CALL    L4C16
            CALL    L4C47
            JR      L4773               ; (-011H)

L4784:      EX      DE,HL
            LD      DE,(KEYBUF)
            JR      L4779               ; (-012H)

L478B:      LD      A,H
            ADD     A,040H
            LD      H,A
            LD      A,D
            ADD     A,040H
            LD      D,A
            OR      A
            SBC     HL,DE
            JR      C,L479F             ; (+007H)
            LD      A,H
            OR      L
            RET     Z
L479B:      LD      A,0FFH
            SCF     
            RET     

L479F:      OR      A
            EX      DE,HL
            LD      HL,L0000
            SBC     HL,DE
            XOR     A
            SCF     
            RET     

L47A9:      CALL    L47BA
            LD      HL,(L1088)
            PUSH    HL
            PUSH    BC
            EXX     
            CALL    L47BA
            LD      B,002H
            JP      L4C08

L47BA:      POP     IX
            EX      DE,HL
            CP      002H
            CALL    Z,L47D6
            LD      BC,(POINTX)
            ADD     HL,BC
            PUSH    HL
            EX      DE,HL
            CP      001H
            CALL    Z,L47D6
            LD      BC,(POINTY)
            ADD     HL,BC
            PUSH    HL
            JP      (IX)

L47D6:      BIT     7,H
            JP      Z,L4BA7
            CALL    L47E1
            CALL    L4BA7
L47E1:      EX      AF,AF'
            CALL    L4B80
            EX      AF,AF'
            RET     

L47E7:      PUSH    AF
            CALL    L4669
            POP     AF
            PUSH    AF
            LD      (04874H),IX
            LD      (011C7H),DE
            LD      (L11C9),HL
            EXX     
            LD      (011D3H),BC
            LD      (011C3H),DE
            LD      (L11C5),HL
            LD      A,C
            CALL    C,L47A9
            LD      HL,(011C3H)
            LD      DE,(011C5H)
            CALL    L4B44
            LD      (L11AE),A
            LD      HL,(011C7H)
            LD      DE,(011C9H)
            CALL    L4B44
            LD      (L11AF),A
            LD      HL,L11BA
            LD      B,008H
            CALL    ?CLRHL
            LD      HL,L11AE
            POP     AF
            LD      B,A
            AND     00FH
            JR      Z,L4858             ; (+025H)
            CP      003H
            JR      Z,L4843             ; (+00cH)
            LD      A,(HL)
            INC     HL
            CP      (HL)
            JR      NZ,L4858            ; (+01cH)
            LD      A,B
            CP      081H
            JR      Z,L4858             ; (+017H)
            JR      L4848               ; (+005H)

L4843:      LD      A,009H
            LD      (HL),A
            INC     HL
            LD      (HL),A
L4848:      LD      B,008H
            LD      HL,L11BA
            INC     A
            CALL    ?SETHL
            LD      A,0B0H
            CALL    L4BD0
            JR      L4873               ; (+01bH)

L4858:      LD      A,0A0H
            CALL    L4BD0
            LD      D,000H
            LD      HL,(L11AE)
            LD      B,H
            LD      A,L
L4864:      LD      HL,L11B9
            LD      E,A
            ADD     HL,DE
            LD      (HL),001H
            CP      B
            JR      Z,L4873             ; (+005H)
            AND     007H
            INC     A
            JR      L4864               ; (-00fH)

L4873:      LD      HL,L0000
            LD      (L11A6),HL
            LD      (L11A8),HL
            LD      HL,00001H
            LD      (L11A4),HL
            LD      (L11AA),HL
L4885:      LD      HL,(L11A6)
            LD      DE,(KEYBUF)
            XOR     A
            SBC     HL,DE
            LD      (L11A6),HL
            LD      HL,(L11AA)
            DEC     HL
            LD      (L11AC),HL
            LD      A,(011D3H)
            OR      A
            LD      D,H
            LD      E,L
            CALL    NZ,L4BA7
            CP      001H
            JR      Z,L48A7             ; (+001H)
            EX      DE,HL
L48A7:      LD      (011D1H),DE
            LD      (L11CD),HL
            LD      HL,(L11A8)
            OR      A
            LD      D,H
            LD      E,L
            CALL    NZ,L4BA7
            CP      001H
            JR      Z,L48BC             ; (+001H)
            EX      DE,HL
L48BC:      LD      (011CFH),DE
            LD      (L11CB),HL
            LD      HL,(011CFH)
            CALL    L4B80
            LD      (L11B2),HL
            LD      HL,(011D1H)
            CALL    L4B80
            LD      (L11B0),HL
            LD      HL,(L11CD)
            CALL    L4B80
            LD      (L11B4),HL
            LD      HL,(L11CB)
            CALL    L4B80
            LD      (L11B6),HL
            LD      HL,(L11AC)
            CALL    L4B80
            LD      (L11B8),HL
            LD      HL,L11BA
            LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4938             ; (+040H)
            EXX     
            LD      HL,(011CFH)
            LD      (04B95H),HL
            LD      B,000H
            LD      DE,(011B8H)
            BIT     7,D
            JR      Z,L491B             ; (+012H)
            LD      A,(L11AE)
            CP      001H
L490E:      JR      NZ,L491A            ; (+00aH)
            LD      HL,(L11C5)
            XOR     A
            SBC     HL,DE
            JR      Z,L491A             ; (+002H)
            JR      C,L491B             ; (+001H)
L491A:      INC     B
L491B:      LD      A,(L11AF)
            CP      001H
            JR      NZ,L492C            ; (+00aH)
            LD      HL,(L11C9)
            XOR     A
            SBC     HL,DE
            JR      Z,L492C             ; (+002H)
            JR      NC,L492E            ; (+002H)
L492C:      LD      A,001H
L492E:      AND     B
            JR      Z,L4937             ; (+006H)
            LD      HL,(L11B4)
            CALL    L4B88
L4937:      EXX     
L4938:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4979             ; (+03cH)
            EXX     
            LD      B,000H
            LD      HL,(011D1H)
            LD      (04B95H),HL
            LD      DE,(011ACH)
            LD      A,(L11AE)
            CP      002H
            JR      NZ,L495B            ; (+00aH)
            LD      HL,(011C3H)
            XOR     A
            SBC     HL,DE
            JR      Z,L495B             ; (+002H)
            JR      C,L495C             ; (+001H)
L495B:      INC     B
L495C:      LD      A,(L11AF)
            CP      002H
            JR      NZ,L496D            ; (+00aH)
            LD      HL,(011C7H)
            XOR     A
            SBC     HL,DE
            JR      Z,L496D             ; (+002H)
            JR      NC,L496F            ; (+002H)
L496D:      LD      A,001H
L496F:      AND     B
            JR      Z,L4978             ; (+006H)
            LD      HL,(L11B6)
            CALL    L4B88
L4978:      EXX     
L4979:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L49BE             ; (+040H)
            EXX     
            LD      B,000H
            LD      HL,(L11B0)
            LD      (04B95H),HL
            LD      DE,(011B8H)
            BIT     7,D
            JR      Z,L49A1             ; (+012H)
            LD      A,(L11AE)
            CP      003H
            JR      NZ,L49A0            ; (+00aH)
            LD      HL,(011C3H)
            XOR     A
            SBC     HL,DE
            JR      Z,L49A0             ; (+002H)
            JR      C,L49A1             ; (+001H)
L49A0:      INC     B
L49A1:      LD      A,(L11AF)
            CP      003H
            JR      NZ,L49B2            ; (+00aH)
            LD      HL,(011C7H)
            XOR     A
            SBC     HL,DE
            JR      Z,L49B2             ; (+002H)
            JR      NC,L49B4            ; (+002H)
L49B2:      LD      A,001H
L49B4:      AND     B
            JR      Z,L49BD             ; (+006H)
            LD      HL,(L11B6)
            CALL    L4B88
L49BD:      EXX     
L49BE:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4A04             ; (+041H)
            EXX     
            LD      B,000H
            LD      HL,(L11B2)
            LD      (04B95H),HL
            LD      DE,(011B8H)
            LD      A,(L11AE)
            CP      004H
            JR      NZ,L49E1            ; (+00aH)
            LD      HL,(L11C5)
            XOR     A
            SBC     HL,DE
            JR      Z,L49E1             ; (+002H)
            JR      NC,L49E2            ; (+001H)
L49E1:      INC     B
L49E2:      XOR     A
            BIT     7,D
            JR      Z,L49FA             ; (+013H)
            LD      A,(L11AF)
            CP      004H
            JR      NZ,L49F8            ; (+00aH)
            LD      HL,(L11C9)
            XOR     A
            SBC     HL,DE
            JR      Z,L49F8             ; (+002H)
            JR      C,L49FA             ; (+002H)
L49F8:      LD      A,001H
L49FA:      AND     B
            JR      Z,L4A03             ; (+006H)
            LD      HL,(L11B4)
            CALL    L4B88
L4A03:      EXX     
L4A04:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4A45             ; (+03cH)
            EXX     
            LD      B,000H
            LD      HL,(L11B2)
            LD      (04B95H),HL
            LD      DE,(011ACH)
            LD      A,(L11AE)
            CP      005H
            JR      NZ,L4A27            ; (+00aH)
            LD      HL,(L11C5)
            XOR     A
            SBC     HL,DE
            JR      Z,L4A27             ; (+002H)
            JR      NC,L4A28            ; (+001H)
L4A27:      INC     B
L4A28:      LD      A,(L11AF)
            CP      005H
            JR      NZ,L4A39            ; (+00aH)
            LD      HL,(L11C9)
            XOR     A
            SBC     HL,DE
            JR      Z,L4A39             ; (+002H)
            JR      C,L4A3B             ; (+002H)
L4A39:      LD      A,001H
L4A3B:      AND     B
            JR      Z,L4A44             ; (+006H)
            LD      HL,(L11CD)
            CALL    L4B88
L4A44:      EXX     
L4A45:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4A8B             ; (+041H)
            EXX     
            LD      B,000H
            LD      HL,(L11B0)
            LD      (04B95H),HL
            LD      DE,(011B8H)
            LD      A,(L11AE)
            CP      006H
            JR      NZ,L4A68            ; (+00aH)
            LD      HL,(011C3H)
            XOR     A
            SBC     HL,DE
            JR      Z,L4A68             ; (+002H)
            JR      NC,L4A69            ; (+001H)
L4A68:      INC     B
L4A69:      XOR     A
            BIT     7,D
            JR      Z,L4A81             ; (+013H)
            LD      A,(L11AF)
            CP      006H
            JR      NZ,L4A7F            ; (+00aH)
            LD      HL,(011C7H)
            XOR     A
            SBC     HL,DE
            JR      Z,L4A7F             ; (+002H)
            JR      C,L4A81             ; (+002H)
L4A7F:      LD      A,001H
L4A81:      AND     B
            JR      Z,L4A8A             ; (+006H)
            LD      HL,(L11CB)
            CALL    L4B88
L4A8A:      EXX     
L4A8B:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4ACC             ; (+03cH)
            EXX     
            LD      HL,(011D1H)
            LD      (04B95H),HL
            LD      DE,(011ACH)
            LD      B,000H
            LD      A,(L11AE)
            CP      007H
            JR      NZ,L4AAE            ; (+00aH)
            LD      HL,(011C3H)
            XOR     A
            SBC     HL,DE
            JR      Z,L4AAE             ; (+002H)
            JR      NC,L4AAF            ; (+001H)
L4AAE:      INC     B
L4AAF:      LD      A,(L11AF)
            CP      007H
            JR      NZ,L4AC0            ; (+00aH)
            LD      HL,(011C7H)
            XOR     A
            SBC     HL,DE
            JR      Z,L4AC0             ; (+002H)
            JR      C,L4AC2             ; (+002H)
L4AC0:      LD      A,001H
L4AC2:      AND     B
            JR      Z,L4ACB             ; (+006H)
            LD      HL,(L11CB)
            CALL    L4B88
L4ACB:      EXX     
L4ACC:      LD      A,(HL)
            OR      A
            INC     HL
            JR      Z,L4B0D             ; (+03cH)
            EXX     
            LD      HL,(011CFH)
            LD      (04B95H),HL
            LD      DE,(011ACH)
            LD      B,000H
            LD      A,(L11AE)
            CP      008H
            JR      NZ,L4AEF            ; (+00aH)
            LD      HL,(L11C5)
            XOR     A
            SBC     HL,DE
            JR      Z,L4AEF             ; (+002H)
            JR      C,L4AF0             ; (+001H)
L4AEF:      INC     B
L4AF0:      LD      A,(L11AF)
            CP      008H
            JR      NZ,L4B01            ; (+00aH)
            LD      HL,(L11C9)
            XOR     A
            SBC     HL,DE
            JR      Z,L4B01             ; (+002H)
            JR      NC,L4B03            ; (+002H)
L4B01:      LD      A,001H
L4B03:      AND     B
            JR      Z,L4B0C             ; (+006H)
            LD      HL,(L11CD)
            CALL    L4B88
L4B0C:      EXX     
L4B0D:      LD      HL,(L11A6)
            BIT     7,H
            JR      Z,L4B32             ; (+01eH)
            LD      DE,(011AAH)
            LD      HL,(L11A8)
            DEC     HL
            LD      (L11A8),HL
            BIT     7,H
            RET     NZ
            XOR     A
            SBC     HL,DE
            RET     C
            LD      HL,(L11A8)
            ADD     HL,HL
            LD      DE,(011A6H)
            ADD     HL,DE
            LD      (L11A6),HL
L4B32:      LD      HL,(L11AA)
            INC     HL
            LD      (L11AA),HL
            LD      HL,(L11A4)
            INC     HL
            INC     HL
            LD      (L11A4),HL
            JP      L4885

L4B44:      PUSH    HL
            PUSH    DE
            CALL    L4B7D
            EX      DE,HL
            CALL    L4B7D
            EX      DE,HL
            OR      A
            SBC     HL,DE
            POP     DE
            POP     HL
            JR      C,L4B69             ; (+014H)
            BIT     7,H
            JR      NZ,L4B61            ; (+008H)
            BIT     7,D
            LD      A,008H
            RET     Z
            LD      A,001H
            RET     

L4B61:      BIT     7,D
            LD      A,005H
            RET     Z
            LD      A,004H
            RET     

L4B69:      BIT     7,H
            JR      NZ,L4B75            ; (+008H)
            BIT     7,D
            LD      A,007H
            RET     Z
            LD      A,002H
            RET     

L4B75:      BIT     7,D
            LD      A,006H
            RET     Z
            LD      A,003H
            RET     

L4B7D:      BIT     7,H
            RET     Z
L4B80:      LD      A,H
            CPL     
            LD      H,A
            LD      A,L
            CPL     
            LD      L,A
            INC     HL
            RET     

L4B88:      LD      DE,(POINTY)
            ADD     HL,DE
            LD      DE,0FF38H
            LD      B,H
            LD      C,L
            ADD     HL,DE
            RET     C
            LD      HL,L0000
            LD      DE,(POINTX)
            ADD     HL,DE
            EX      DE,HL
            LD      HL,0FD80H
            ADD     HL,DE
            RET     C
            LD      H,B
            LD      L,C
            JP      L4697

L4BA7:      PUSH    AF
            PUSH    DE
            LD      B,008H
            LD      C,L
            LD      E,H
            XOR     A
            LD      D,A
            LD      H,A
            LD      L,A
            EX      AF,AF'
            LD      A,(011D4H)
L4BB5:      RRA     
            JR      NC,L4BBF            ; (+007H)
            ADD     HL,DE
            EX      AF,AF'
            ADD     A,C
            JR      NC,L4BBE            ; (+001H)
            INC     HL
L4BBE:      EX      AF,AF'
L4BBF:      SLA     C
            RL      E
            RL      D
            DJNZ    L4BB5               ; (-012H)
            EX      AF,AF'
            BIT     7,A
            JR      Z,L4BCD             ; (+001H)
            INC     HL
L4BCD:      POP     DE
            POP     AF
            RET     

L4BD0:      LD      (L492E),A
            LD      (L496F),A
            LD      (L49B4),A
            LD      (L49FA),A
            LD      (L4A3B),A
            LD      (L4A81),A
            LD      (L4AC2),A
            LD      (L4B03),A
            RET     

L4BE9:      LD      (011A8H),SP
            EX      AF,AF'
            CALL    L4C16
            CALL    L4C16
            EXX     
            PUSH    DE
            PUSH    HL
            PUSH    DE
            EXX     
            PUSH    HL
            PUSH    DE
            PUSH    HL
            PUSH    DE
            EXX     
            PUSH    HL
            PUSH    DE
            PUSH    HL
            EXX     
            EX      AF,AF'
            CALL    C,L4C2C
            LD      B,004H
L4C08:      EXX     
            POP     HL
            POP     DE
            EXX     
L4C0C:      POP     HL
            POP     DE
            PUSH    BC
            CALL    L46CC
            POP     BC
            DJNZ    L4C0C               ; (-009H)
            RET     

L4C16:      EX      DE,HL
            LD      A,H
            EXX     
            EX      DE,HL
            CP      H
            EXX     
            JR      Z,L4C21             ; (+003H)
            RET     P
            JR      L4C26               ; (+005H)

L4C21:      LD      A,L
            EXX     
            CP      L
            EXX     
            RET     NC
L4C26:      PUSH    HL
            EXX     
            EX      (SP),HL
            EXX     
            POP     HL
            RET     

L4C2C:      CALL    COLS
            LD      B,A
            LD      A,(L109F)
            CP      B
            JR      NZ,L4C3A            ; (+004H)
            LD      SP,(011A8H)
L4C3A:      LD      A,(L109A)
            OR      A
            LD      A,0C0H
            JR      Z,L4C44             ; (+002H)
            LD      A,040H
L4C44:      OR      B
            OUT     (LSWF),A
L4C47:      LD      A,H
            OR      D
            RET     M
            CALL    L4CEC
            LD      A,L
            EXX     
            BIT     7,H
            JR      Z,L4C56             ; (+003H)
            LD      HL,L0000
L4C56:      BIT     7,D
            JR      Z,L4C5D             ; (+003H)
            LD      DE,L0000
L4C5D:      EX      AF,AF'
            CALL    L4CEC
            RET     C
            EX      AF,AF'
            INC     A
            SUB     L
            RET     C
            RET     Z
            EX      AF,AF'
            PUSH    HL
            CALL    L460F
            LD      (L11A4),HL
            EXX     
            POP     HL
            LD      B,A
            PUSH    BC
            CALL    L460F
            POP     BC
            LD      (L11A6),HL
            LD      C,A
            LD      DE,(KEYBUF)
            OR      A
            SBC     HL,DE
            JR      Z,L4CAA             ; (+026H)
            DEC     HL
            INC     DE
            LD      A,L
            OR      A
            CALL    NZ,L4CCD
            LD      HL,L45C0
            LD      A,B
            LD      B,000H
            ADD     HL,BC
            LD      L,(HL)
            LD      C,A
            LD      A,L
            LD      HL,L45B8
            ADD     HL,BC
            LD      B,(HL)
            LD      DE,(011A6H)
            PUSH    BC
            CALL    L4CBA
            POP     BC
            LD      DE,(KEYBUF)
            LD      A,B
            JR      L4CBA               ; (+010H)

L4CAA:      LD      HL,L45C0
            LD      A,B
            LD      B,000H
            ADD     HL,BC
            LD      C,A
            LD      A,0FFH
            AND     (HL)
            LD      HL,L45B8
            ADD     HL,BC
            AND     (HL)
L4CBA:      LD      C,A
            EX      AF,AF'
            LD      B,A
            EX      AF,AF'
            EX      DE,HL
            DI      
            LD      DE,L0050
            IN      A,(LSE0)
L4CC5:      LD      (HL),C
            ADD     HL,DE
            DJNZ    L4CC5               ; (-004H)
            IN      A,(LSE1)
            EI      
            RET     

L4CCD:      PUSH    BC
            EX      DE,HL
            LD      B,A
            EX      AF,AF'
            LD      C,A
            EX      AF,AF'
            LD      DE,L0050
            DI      
L4CD7:      PUSH    HL
            PUSH    BC
            IN      A,(LSE0)
            LD      A,0FFH
L4CDD:      LD      (HL),A
            INC     HL
            DJNZ    L4CDD               ; (-004H)
            IN      A,(LSE1)
            POP     BC
            POP     HL
            ADD     HL,DE
            DEC     C
            JR      NZ,L4CD7            ; (-012H)
            EI      
            POP     BC
            RET     

L4CEC:      LD      A,H
            OR      A
            JR      NZ,L4CF5            ; (+005H)
            LD      A,0C7H
            CP      L
            JR      NC,L4CF9            ; (+004H)
L4CF5:      LD      HL,PUSHR
            SCF     
L4CF9:      RRA     
            PUSH    HL
            LD      HL,0FD80H
            ADD     HL,DE
            POP     HL
            JR      NC,L4D06            ; (+004H)
            LD      DE,L027F
            RET     

L4D06:      RLA     
            RET     

L4D08:      EXX     
            CALL    L46B2
            EXX     
            RET     NC
L4D0E:      LD      A,003H
            JP      ERRORJ

L4D13:      EXX     
            LD      (POINTX),DE
            LD      (L108A),HL
            EXX     
            RET     

L4D1D:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L4D25:      DB      LSE1
            DB      04EH,0EDH,04EH,003H,04FH,01CH,04FH
L4D2D:      PUSH    BC
            PUSH    DE
            LD      BC,L1218
            LD      D,L
            LD      E,H
            BIT     0,A
            JR      Z,L4D3B             ; (+003H)
            EX      DE,HL
            INC     BC
            INC     BC
L4D3B:      LD      (04DB4H),BC
            LD      (L1212),HL
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      (L1214),HL
            LD      L,E
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      (L1216),HL
            LD      DE,L0000
            EX      DE,HL
            SBC     HL,DE
            LD      (L1221),HL
            BIT     1,A
            JR      Z,L4D64             ; (+004H)
            LD      (01221H),DE
L4D64:      OR      A
            JP      PO,L4D6B
            LD      HL,L0000
L4D6B:      LD      DE,(POINTY)
            ADD     HL,DE
            LD      (L121A),HL
            LD      DE,(01214H)
            LD      HL,L0000
            OR      A
            SBC     HL,DE
            BIT     0,A
            JR      NZ,L4D8C            ; (+00bH)
            BIT     1,A
            LD      (01221H),DE
            JR      Z,L4D8C             ; (+003H)
            LD      (L1221),HL
L4D8C:      EX      DE,HL
            LD      HL,(L1088)
            BIT     1,A
            JR      Z,L4D95             ; (+001H)
            ADD     HL,DE
L4D95:      LD      (L1218),HL
            ADD     A,A
            LD      HL,L4D25
            LD      D,000H
            LD      E,A
            ADD     HL,DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      (04DEAH),DE
            CALL    L4669
            POP     HL
            POP     BC
L4DAC:      DEC     B
            RET     M
            PUSH    HL
            PUSH    BC
            CALL    L4DC8
            LD      HL,L1218
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            PUSH    HL
            LD      HL,(L1221)
            ADD     HL,DE
            EX      DE,HL
            POP     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            POP     BC
            POP     HL
            INC     HL
            JR      L4DAC               ; (-01cH)

L4DC8:      LD      IY,L1208
            LD      A,(HL)
            RST     018H
            DB      01DH
            LD      H,000H
            LD      L,A
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      A,010H
            ADD     A,H
            LD      H,A
            LD      DE,L4D1D
            LD      BC,00008H
            DI      
            IN      A,(LSE0)
            LDIR    
            IN      A,(LSE1)
            EI      
            LD      B,008H
            CALL    L4EE1
            LD      HL,L0808
            LD      (L1209),HL
            LD      DE,(01212H)
            LD      (0121FH),DE
            LD      HL,(L1218)
            BIT     7,H
            JR      Z,L4E16             ; (+015H)
            CALL    L4F32
            RET     C
L4E05:      EXX     
            LD      B,008H
            LD      HL,L1200
L4E0B:      RLC     (HL)
            INC     HL
            DJNZ    L4E0B               ; (-005H)
            EXX     
            DJNZ    L4E05               ; (-00eH)
            LD      HL,L0000
L4E16:      LD      (04E46H),HL
            LD      A,0F8H
            AND     L
            OR      H
            RRC     A
            RRC     A
            RRC     A
            SUB     050H
            RET     NC
            LD      L,A
            LD      H,011H
            LD      (L1210),HL
            LD      HL,(L121A)
            XOR     A
            BIT     7,H
            JR      Z,L4E42             ; (+00eH)
            INC     IY
            CALL    L4F32
            DEC     IY
            RET     C
            LD      HL,L0000
            LD      A,008H
            SUB     B
L4E42:      LD      (04E62H),A
            LD      DE,L0000
            PUSH    HL
            PUSH    DE
            CALL    L46B2
            POP     DE
            POP     HL
            RET     C
            CALL    L460F
            LD      (L121C),HL
            LD      HL,L45C8
            LD      D,000H
            LD      E,A
            ADD     HL,DE
            LD      A,(HL)
            LD      (L121E),A
            LD      HL,L1200
L4E64:      LD      DE,(01210H)
            LD      BC,(0121EH)
            XOR     A
            EXX     
            LD      B,(IY+001H)
L4E71:      EXX     
            LD      (DE),A
            XOR     A
            RRC     (HL)
            JR      NC,L4E7A            ; (+002H)
            LD      A,0B1H
L4E7A:      LD      (L4E7E),A
            LD      A,(DE)
L4E7E:      OR      C
            RLC     C
            JR      NC,L4E88            ; (+005H)
            LD      (DE),A
            INC     E
            JR      Z,L4E93             ; (+00cH)
            XOR     A
L4E88:      DJNZ    L4E7E               ; (-00cH)
            LD      B,(IY+00AH)
            EXX     
            DJNZ    L4E71               ; (-01fH)
            EXX     
            LD      (DE),A
            INC     E
L4E93:      DEC     E
            INC     L
            LD      (L120E),HL
            LD      HL,(L1210)
            EX      DE,HL
            XOR     A
            SBC     HL,DE
            INC     HL
            LD      (L1223),HL
            LD      A,(L1220)
            LD      B,A
L4EA7:      EXX     
            LD      DE,(0121CH)
            LD      HL,(L1210)
            LD      BC,(01223H)
            DI      
            IN      A,(LSE0)
            OUT     (LSE0),A
            LDIR    
            IN      A,(LSE1)
            EI      
            LD      DE,L0050
            LD      HL,(L121C)
            ADD     HL,DE
            LD      (L121C),HL
            LD      DE,0BE80H
            OR      A
            SBC     HL,DE
            RET     NC
            EXX     
            DJNZ    L4EA7               ; (-02aH)
            LD      A,(01213H)
            LD      (L1220),A
            LD      HL,(L120E)
            DEC     (IY+002H)
            JP      NZ,L4E64
            RET     

L4EE1:      LD      HL,L4D1D
            LD      DE,L1200
            LD      C,B
            LD      B,000H
            LDIR    
            RET     

            LD      DE,L1200
L4EF0:      EXX     
            LD      HL,L4D1D
            LD      B,008H
            XOR     A
L4EF7:      RLC     (HL)
            RRA     
            INC     HL
            DJNZ    L4EF7               ; (-006H)
            EXX     
            LD      (DE),A
            INC     DE
            DJNZ    L4EF0               ; (-012H)
            RET     

            LD      DE,L1207
            LD      HL,L4D1D
L4F09:      LD      A,(HL)
            EXX     
            LD      C,A
            LD      B,008H
            XOR     A
L4F0F:      RR      C
            RL      A
            DJNZ    L4F0F               ; (-006H)
            EXX     
            LD      (DE),A
            INC     HL
            DEC     DE
            DJNZ    L4F09               ; (-012H)
            RET     

            LD      DE,L1207
L4F1F:      EXX     
            LD      HL,L4D1D
            XOR     A
            LD      B,008H
L4F26:      RLC     (HL)
            RLA     
            INC     HL
            DJNZ    L4F26               ; (-006H)
            EXX     
            LD      (DE),A
            DEC     DE
            DJNZ    L4F1F               ; (-012H)
            RET     

L4F32:      LD      B,008H
            LD      E,(IY+00AH)
            LD      D,000H
L4F39:      ADD     HL,DE
            BIT     7,H
            JR      Z,L4F42             ; (+004H)
            DJNZ    L4F39               ; (-007H)
L4F40:      SCF     
            RET     

L4F42:      LD      A,H
            OR      L
            JR      NZ,L4F4A            ; (+004H)
            LD      L,E
            DEC     B
            JR      Z,L4F40             ; (-00aH)
L4F4A:      LD      (IY+017H),L
            LD      (IY+001H),B
            OR      A
            RET     

L4F52:      OR      A
            RET     Z
            LD      (011A6H),DE
            LD      E,A
            LD      C,A
            LD      A,H
            OR      A
            LD      A,023H
            JR      NZ,L4F62            ; (+002H)
            LD      A,02BH
L4F62:      LD      (L4FF5),A
            LD      (L4FE1),A
            LD      A,B
            OR      A
            RET     Z
            LD      HL,(L1088)
            LD      A,007H
            AND     L
            LD      D,A
            EXX     
            LD      HL,L45B8
            LD      D,000H
            LD      E,A
            ADD     HL,DE
            LD      A,(HL)
            LD      (04F85H),A
L4F7E:      LD      HL,(L108A)
L4F81:      LD      (L11A4),HL
            LD      C,0FFH
            LD      HL,(L11A6)
            LD      A,(HL)
            EXX     
            LD      H,A
            LD      A,D
            OR      A
            JR      Z,L4F95             ; (+005H)
L4F90:      RRC     H
            DEC     A
            JR      NZ,L4F90            ; (-005H)
L4F95:      LD      A,H
            EXX     
            LD      HL,L129E
            LD      B,008H
            LD      D,A
L4F9D:      SRL     D
            RLA     
            DJNZ    L4F9D               ; (-005H)
            LD      D,A
            AND     C
            LD      (HL),A
            LD      A,D
            CPL     
            LD      B,A
            AND     C
            INC     HL
            LD      (HL),A
            LD      A,C
            CPL     
            LD      C,A
            AND     D
            INC     HL
            LD      (HL),A
            LD      A,C
            AND     B
            INC     HL
            LD      (HL),A
            LD      DE,(POINTX)
            LD      HL,(L11A4)
            PUSH    DE
            PUSH    HL
            EX      DE,HL
            LD      BC,00008H
            ADD     HL,BC
            EX      DE,HL
            LD      A,001H
            CALL    L5003
            POP     HL
            POP     DE
            XOR     A
            CALL    L5003
            LD      HL,(L11A6)
            INC     HL
            LD      (L11A6),HL
            EXX     
            DJNZ    L4FE7               ; (+00eH)
            DEC     C
            EXX     
            JP      Z,L4FF8
            LD      HL,(L11A4)
L4FE1:      INC     HL
            LD      (L108A),HL
            XOR     A
            RET     

L4FE7:      DEC     C
            JR      NZ,L4FF1            ; (+007H)
            LD      C,E
            EXX     
            CALL    L4FF8
            JR      L4F7E               ; (-073H)

L4FF1:      EXX     
            LD      HL,(L11A4)
L4FF5:      INC     HL
            JR      L4F81               ; (-077H)

L4FF8:      LD      HL,(L1088)
            LD      BC,00008H
            ADD     HL,BC
            LD      (L1088),HL
            RET     

L5003:      EX      AF,AF'
            CALL    L46B2
            RET     C
            CALL    L460F
            LD      B,A
            LD      DE,L129E
            EX      AF,AF'
            OR      A
            JR      Z,L5018             ; (+005H)
            LD      A,B
            OR      A
            RET     Z
            INC     DE
            INC     DE
L5018:      CALL    L4669
            DI      
            IN      A,(LSE0)
            OUT     (LSE0),A
            LD      A,(DE)
            LD      (HL),A
            LD      A,(L109A)
            OR      A
            JR      NZ,L5032            ; (+00aH)
            LD      A,(0109CH)
            OR      060H
            OUT     (LSWF),A
            INC     DE
            LD      A,(DE)
            LD      (HL),A
L5032:      IN      A,(LSE1)
            EI      
            RET     

L5036:      LD      A,(L109F)
            OR      0C0H
            OUT     (LSWF),A
            EXX     
            LD      DE,L27D0
            LD      HL,L5556
            LD      BC,L0009
            LDIR    
            EXX     
L504A:      LD      A,(HL)
            CALL    COLS
            OR      080H
            LD      (05560H),A
            INC     HL
            EXX     
            LD      HL,L555F
            LD      BC,00005H
            LDIR    
            EXX     
            DJNZ    L504A               ; (-016H)
            EXX     
            LD      BC,00007H
            LDIR    
            LD      HL,(L107A)
            LD      (L11A6),HL
            LD      (051CFH),HL
            LD      HL,(L137C)
            LD      DE,0FFFAH
            ADD     HL,DE
            LD      (054DAH),HL
            LD      HL,(L1088)
            DEC     HL
            LD      (L11B1),HL
            INC     HL
            INC     HL
            LD      (L11B3),HL
            DEC     HL
            EX      DE,HL
            LD      HL,L0000
            LD      (L11A4),HL
            LD      HL,(L108A)
            LD      (L11AF),HL
            CALL    L46B2
            CCF     
            RET     NC
            LD      (054E2H),SP
            LD      SP,L2ED0
            CALL    L460F
            LD      DE,L45C8
            PUSH    HL
            LD      H,000H
            LD      L,A
            ADD     HL,DE
            LD      C,(HL)
            POP     HL
            CALL    L27D0
            AND     C
            JP      NZ,L5163
            CALL    L5425
            LD      (L11B3),IX
            CALL    L53F5
            LD      (L11B1),IX
            LD      A,0FFH
            LD      (L11B5),A
            CALL    L54D5
            LD      HL,L12A0
            LD      (L11A9),HL
            XOR     A
            LD      (L11B5),A
            LD      (L11A8),A
L50D6:      LD      A,(L11B5)
            CALL    L53C4
            LD      A,0C7H
            CP      L
            JR      C,L5115             ; (+034H)
            CALL    L539D
            JR      C,L5115             ; (+02fH)
            LD      (L11B6),A
            AND     009H
            CALL    NZ,L518A
            CALL    L51CD
            LD      A,(L11B7)
            OR      A
            JR      NZ,L5115            ; (+01eH)
L50F7:      CALL    L54FA
            JR      Z,L50D6             ; (-026H)
            LD      HL,(L11B3)
            PUSH    HL
            PUSH    DE
            CALL    L5429
            LD      (L11B3),IX
            CALL    L54D5
            POP     HL
            LD      (L11B1),HL
            POP     HL
            LD      (L11B3),HL
            JR      L50D6               ; (-03fH)

L5115:      LD      HL,(L11A6)
            DEC     HL
            LD      DE,0FFF9H
            LD      BC,(KEYBUF)
L5120:      LD      A,B
            OR      C
            JR      Z,L515C             ; (+038H)
            LD      A,00FH
            DEC     BC
            CP      (HL)
            ADD     HL,DE
            JR      Z,L5120             ; (-00bH)
            INC     HL
            PUSH    HL
            LD      (05149H),HL
            LD      DE,L11AF
            LD      BC,00007H
            LDIR    
            EX      DE,HL
            LD      HL,(L11A6)
            XOR     A
            POP     BC
            LD      (011A6H),BC
            SBC     HL,DE
            JR      Z,L5152             ; (+00cH)
            LD      B,H
            LD      C,L
            LD      HL,L0000
            EX      DE,HL
            LDIR    
            LD      (011A6H),DE
L5152:      LD      HL,(L11A4)
            DEC     HL
            LD      (L11A4),HL
            JP      L50F7

L515C:      LD      HL,(L11A4)
            LD      A,L
            OR      H
            JR      NZ,L5168            ; (+005H)
L5163:      LD      SP,(054E2H)
            RET     

L5168:      DEC     HL
            LD      (L11A4),HL
            LD      HL,(L11A6)
            DEC     HL
            LD      DE,L11B5
            LD      BC,00007H
            LDDR    
            INC     HL
            LD      (L11A6),HL
L517C:      CALL    L54FA
            JR      Z,L515C             ; (-025H)
            CALL    L5429
            LD      (L11B3),IX
            JR      L517C               ; (-00eH)

L518A:      LD      HL,L11AB
            LD      DE,L11B9
            CALL    L51C7
            LD      A,(L11B6)
            BIT     0,A
            JR      Z,L51B2             ; (+018H)
L519A:      LD      HL,(L11AB)
            LD      (L11B3),HL
            CALL    L53D1
            JR      C,L51A9             ; (+004H)
            BIT     0,A
            JR      NZ,L519A            ; (-00fH)
L51A9:      CALL    L51C1
            LD      A,(L11B6)
            CP      009H
            RET     NZ
L51B2:      LD      HL,(L11AD)
            LD      (L11B1),HL
            CALL    L53D1
            JR      C,L51C1             ; (+004H)
            BIT     3,A
            JR      NZ,L51B2            ; (-00fH)
L51C1:      LD      HL,L11B9
            LD      DE,L11AB
L51C7:      LD      BC,0000BH
            LDIR    
            RET     

L51CD:      LD      IY,L0000
            LD      BC,(KEYBUF)
            LD      HL,L0000
            LD      (L11B7),HL
L51DB:      CALL    L5203
            LD      A,(L11A8)
            OR      A
            RET     Z
            DEC     A
            LD      (L11A8),A
            LD      (051FFH),SP
            LD      SP,(011A9H)
            POP     IY
            POP     BC
            POP     HL
            LD      (L11B3),HL
            POP     HL
            LD      (L11B1),HL
            LD      (011A9H),SP
            LD      SP,L0000
            JR      L51DB               ; (-028H)

L5203:      LD      A,B
            OR      C
            LD      (0528EH),BC
            JP      Z,L5294
            LD      HL,(L11AF)
            LD      E,(IY+000H)
            LD      D,(IY+001H)
            XOR     A
            SBC     HL,DE
            JR      NZ,L5288            ; (+06eH)
            CALL    L556B
            CP      005H
            JR      Z,L5258             ; (+037H)
            CP      00FH
            JR      NZ,L529C            ; (+077H)
            LD      L,(IY+002H)
            LD      H,(IY+003H)
            LD      DE,(011B3H)
            XOR     A
            SBC     HL,DE
            JR      NC,L5288            ; (+054H)
            LD      HL,(L11B1)
            PUSH    HL
            LD      L,(IY+002H)
            LD      H,(IY+003H)
            PUSH    HL
            LD      (L11B1),HL
            LD      A,003H
            CALL    L5334
            POP     HL
            LD      (L11B3),HL
            POP     HL
            LD      (L11B1),HL
            CALL    L5425
            LD      (L11B3),IX
            JR      L5288               ; (+030H)

L5258:      LD      E,(IY+004H)
            LD      D,(IY+005H)
            LD      HL,(L11B1)
            XOR     A
            SBC     HL,DE
            JR      NC,L5288            ; (+022H)
            LD      HL,(L11B3)
            PUSH    HL
            LD      L,(IY+004H)
            LD      H,(IY+005H)
            PUSH    HL
            LD      (L11B3),HL
            LD      A,004H
            CALL    L5334
            POP     HL
            LD      (L11B1),HL
            POP     HL
            LD      (L11B3),HL
            CALL    L53F5
            LD      (L11B1),IX
L5288:      LD      DE,00007H
            ADD     IY,DE
            LD      BC,L0000
            DEC     BC
            JP      L5203

L5294:      LD      A,(L11B8)
            OR      A
            CALL    NZ,L54D5
            RET     

L529C:      EX      AF,AF'
            LD      A,00FH
            LD      (L11B7),A
            EX      AF,AF'
            OR      A
            JR      NZ,L52AC            ; (+006H)
            LD      A,00FH
            LD      (IY+006H),A
            RET     

L52AC:      CP      001H
            JR      NZ,L52C2            ; (+012H)
            LD      L,(IY+004H)
            LD      H,(IY+005H)
            LD      (L11B1),HL
            CALL    L53F5
            LD      (L11B1),IX
            JR      L52D6               ; (+014H)

L52C2:      CP      00CH
            JR      NZ,L52E0            ; (+01aH)
L52C6:      LD      L,(IY+002H)
            LD      H,(IY+003H)
            LD      (L11B3),HL
            CALL    L5425
            LD      (L11B3),IX
L52D6:      LD      A,00FH
            LD      (IY+006H),A
            LD      (L11B8),A
            JR      L5288               ; (-058H)

L52E0:      CP      00DH
            JP      NZ,L5334
            LD      A,(L11A8)
            INC     A
            CP      01BH
            CCF     
            JP      C,L54E1
            LD      (L11A8),A
            LD      HL,(L11B1)
            PUSH    HL
            LD      L,(IY+004H)
            LD      H,(IY+005H)
            LD      (L11B1),HL
            CALL    L53F5
            LD      (0532BH),IY
            LD      DE,00007H
            ADD     IY,DE
            LD      BC,(0528EH)
            DEC     BC
            LD      (05327H),SP
            LD      SP,(011A9H)
            PUSH    IX
            LD      DE,(011B3H)
            PUSH    DE
            PUSH    BC
            PUSH    IY
            LD      (011A9H),SP
            LD      SP,L0000
            LD      IY,L0000
            POP     HL
            LD      (L11B1),HL
            JP      L52C6

L5334:      EX      AF,AF'
            CALL    L54D5
            DEC     DE
            LD      A,00FH
            LD      (DE),A
            EX      AF,AF'
            CP      003H
            JR      NZ,L535D            ; (+01cH)
L5341:      LD      HL,(L11B3)
            LD      (L11B1),HL
            LD      L,(IY+004H)
            LD      H,(IY+005H)
            LD      (L11B3),HL
            CALL    L53F5
            PUSH    IX
            POP     HL
            LD      (IY+002H),L
            LD      (IY+003H),H
            RET     

L535D:      CP      004H
            JR      Z,L5381             ; (+020H)
            LD      HL,(L11A6)
            PUSH    HL
            LD      (054E7H),IY
            CALL    L54D5
            LD      HL,L11AF
            LD      (054E7H),HL
            LD      HL,(L11B1)
            PUSH    HL
            CALL    L5341
            POP     HL
            LD      (L11B3),HL
            POP     IY
            JR      L5387               ; (+006H)

L5381:      LD      HL,(L11B1)
            LD      (L11B3),HL
L5387:      LD      L,(IY+002H)
            LD      H,(IY+003H)
            LD      (L11B1),HL
            CALL    L5425
            PUSH    IX
            POP     HL
            LD      (IY+004H),L
            LD      (IY+005H),H
            RET     

L539D:      LD      HL,(L11B1)
            LD      (L11AB),HL
            LD      HL,(L11B3)
            LD      (L11AD),HL
            CALL    L53F5
            RET     C
            LD      (L11B1),IX
            CALL    L5425
            LD      (L11B3),IX
            CALL    L54B1
            LD      A,B
            RET     

L53BD:      LD      A,(L11B5)
            CPL     
            LD      (L11B5),A
L53C4:      LD      HL,(L11AF)
            INC     L
            OR      A
            JR      NZ,L53CD            ; (+002H)
            DEC     L
            DEC     L
L53CD:      LD      (L11AF),HL
            RET     

L53D1:      CALL    L53BD
            CALL    L539D
            RET     C
            PUSH    AF
            LD      HL,(L11B1)
            PUSH    HL
            LD      HL,(L11B3)
            PUSH    HL
            CALL    L51CD
            LD      A,(L11B7)
            OR      A
            CALL    Z,L54D5
            POP     HL
            LD      (L11B3),HL
            POP     HL
            LD      (L11B1),HL
            POP     AF
            RET     

L53F5:      LD      DE,(011B3H)
            LD      HL,(L11B1)
            PUSH    HL
            LD      (054A9H),DE
            LD      HL,L0000
            LD      (0547DH),HL
            LD      A,02BH
            LD      (0546FH),A
            LD      A,02FH
            LD      (L54A0),A
            XOR     A
            LD      (L548A),A
            LD      HL,L5471
            LD      (05469H),HL
            LD      HL,L5490
            LD      (0546CH),HL
            POP     DE
            INC     DE
            JR      L5450               ; (+02bH)

L5425:      LD      DE,(011B3H)
L5429:      LD      HL,(L11B1)
            LD      (0547DH),HL
            LD      HL,08002H
            LD      (054A9H),HL
            LD      A,023H
            LD      (0546FH),A
            LD      A,02FH
            LD      (L548A),A
            XOR     A
            LD      (L54A0),A
            LD      HL,L5490
            LD      (05469H),HL
            LD      HL,L5471
            LD      (0546CH),HL
            DEC     DE
L5450:      LD      HL,(L11AF)
            PUSH    DE
            POP     IX
            CALL    L460F
            LD      DE,L45C8
            PUSH    HL
            LD      H,000H
            LD      L,A
            ADD     HL,DE
            LD      C,(HL)
            POP     HL
            CALL    L27D0
            LD      E,A
            AND     C
            JP      Z,L5471
            CALL    L5490
            DEC     IX
            RET     

L5471:      DEC     IX
            RRC     C
            JR      NC,L5489            ; (+012H)
            PUSH    IX
            EXX     
            POP     DE
            INC     DE
            LD      HL,L0000
            INC     HL
            SBC     HL,DE
            EXX     
            RET     NC
            DEC     HL
            CALL    L27D0
            LD      E,A
L5489:      LD      A,E
L548A:      NOP     
            AND     C
            JP      Z,L5471
            RET     

L5490:      INC     IX
            RLC     C
            JR      NC,L549F            ; (+009H)
            CALL    L54A4
            RET     C
            INC     HL
            CALL    L27D0
            LD      E,A
L549F:      LD      A,E
L54A0:      CPL     
            AND     C
            JR      Z,L5490             ; (-014H)
L54A4:      PUSH    IX
            EXX     
            POP     HL
            LD      DE,L11B3
            XOR     A
            SBC     HL,DE
            EXX     
            CCF     
            RET     

L54B1:      LD      B,000H
            LD      HL,(L11AD)
            LD      DE,(011B3H)
            CALL    L54C6
            LD      HL,(L11AB)
            LD      DE,(011B1H)
            INC     HL
            INC     DE
L54C6:      PUSH    HL
            XOR     A
            INC     HL
            SBC     HL,DE
            POP     HL
            RL      B
            INC     DE
            EX      DE,HL
            SBC     HL,DE
            RL      B
            RET     

L54D5:      LD      DE,(011A6H)
            LD      HL,L0000
            XOR     A
            SBC     HL,DE
            JR      NC,L54E6            ; (+005H)
L54E1:      LD      SP,L0000
            SCF     
            RET     

L54E6:      LD      HL,L11AF
            LD      BC,00007H
            LDIR    
            LD      (011A6H),DE
            LD      HL,(L11A4)
            INC     HL
            LD      (L11A4),HL
            RET     

L54FA:      LD      HL,(L11AF)
            LD      DE,(011B3H)
            DEC     DE
            CALL    L460F
            LD      DE,L45C0
            PUSH    HL
            LD      H,000H
            LD      L,A
            ADD     HL,DE
            INC     C
            LD      B,C
            LD      C,(HL)
            POP     HL
L5511:      CALL    L27D0
            AND     C
            JR      NZ,L5528            ; (+011H)
            DI      
            IN      A,(LSE0)
            LD      (HL),C
            IN      A,(LSE1)
            EI      
            LD      C,0FFH
            DEC     HL
            DJNZ    L5511               ; (-012H)
            LD      DE,0FFFFH
            JR      L554F               ; (+027H)

L5528:      LD      E,B
            LD      B,007H
            LD      D,000H
L552D:      RLC     A
            JR      C,L5536             ; (+005H)
            SCF     
            RR      D
            DJNZ    L552D               ; (-009H)
L5536:      IN      A,(LSE0)
            LD      A,C
            AND     D
            LD      (HL),A
            IN      A,(LSE1)
            LD      A,E
            DEC     A
            RLC     A
            RLC     A
            RLC     A
            LD      C,A
            LD      A,007H
            AND     C
            LD      D,A
            LD      A,0F8H
            AND     C
            OR      B
            LD      E,A
L554F:      XOR     A
            LD      HL,(L11B1)
            SBC     HL,DE
            RET     

L5556:      PUSH    HL
            EXX     
            POP     HL
            DI      
            IN      A,(LSE0)
            LD      C,LSRF
            XOR     A
L555F:      LD      B,000H
            OUT     (C),B
            OR      (HL)
            LD      E,A
            IN      A,(LSE1)
            EI      
            LD      A,E
            EXX     
            RET     

L556B:      LD      HL,(L11B1)
            LD      E,(IY+002H)
            LD      D,(IY+003H)
            INC     HL
            INC     DE
            XOR     A
            CALL    L5583
            LD      HL,(L11B3)
            LD      E,(IY+004H)
            LD      D,(IY+005H)
L5583:      SBC     HL,DE
            RLA     
            RLA     
            RET     Z
            OR      001H
            RET     

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L55F0:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
$START:     PUSH    BC                  ; $START - BASIC warm start / system entry
            CALL    L585D
            POP     BC
            LD      HL,0A471H
            LD      (L1070),HL
            LD      HL,L586F
            LD      (L004D),HL
            LD      A,B
            OR      A
L5813:      JP      Z,L5825
            CP      001H
            JR      Z,L5825             ; (+00bH)
            LD      HL,L584D
            LD      DE,L1353
            LD      BC,00010H
            LDIR    
L5825:      LD      DE,L9EB5
            RST     018H
            DB      005H
            RST     018H
            DB      020H
            LD      A,0C3H
            LD      (L5813),A
            LD      HL,L5837
            LD      (05814H),HL
L5837:      LD      HL,0A471H
L583A:      LD      (HL),000H
            INC     HL
            LD      A,H
            CP      0FFH
            JR      C,L583A             ; (-008H)
            CALL    L616E
            CALL    L6180
            CALL    L755E
            JR      L5872               ; (+025H)

L584D:      DB      00FH,"RUN ",022H,"AUTO RUN",022H,00DH ; AUTO RUN string
L585D:      LD      A,001H
            RST     018H
            DB      050H
            XOR     A
            LD      (L109A),A
            INC     A
            LD      (L137A),A
            LD      (L1379),A
            RST     018H
            DB      056H
            RET     

L586F:      CALL    L585D
L5872:      LD      HL,L6403
            LD      (L004F),HL
L5878:      RST     018H
            DB      002H
            LD      DE,L63F0
            RST     018H
            DB      005H
            RST     018H
            DB      001H
L5881:      LD      A,(L63F6)
            OR      A
            JR      NZ,L5893            ; (+00cH)
            LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            LD      (09E64H),SP
L5893:      LD      HL,L0000
            LD      (L9E51),HL
            XOR     A
            LD      (L108E),A
            CALL    L611D
            RST     018H
            DB      043H
            LD      DE,L11A4
            RST     018H
            DB      00CH
            JR      NC,L58B4            ; (+00bH)
L58A9:      LD      HL,L611C
            LD      A,(HL)
            OR      A
            LD      (HL),000H
            JR      NZ,L5878            ; (-03aH)
            JR      L5881               ; (-033H)

L58B4:      CALL    L79BC
            OR      A
            JR      Z,L5881             ; (-039H)
            CALL    L79F6
            JP      NC,L5FAD
            LD      HL,L9EB5
            PUSH    HL
            CALL    L8216
            INC     HL
            LD      (L9E4B),HL
            CALL    L61C5
            POP     HL
            JR      L58D4               ; (+003H)

L58D1:      CALL    L797A
L58D4:      LD      (09E64H),SP
L58D8:      LD      DE,L58D1
            PUSH    DE
L58DC:      LD      (L9E66),HL
            CALL    BRKCHK
            JP      Z,BREAKZ
L58E5:      LD      A,(HL)
            INC     HL
            CP      080H
            JR      NC,L593F            ; (+054H)
            CP      027H
            JP      Z,L67FE
            CP      020H
            JR      Z,L58E5             ; (-00fH)
            CP      03AH
            JR      Z,L58DC             ; (-01cH)
            OR      A
            JR      Z,L5906             ; (+00bH)
            DEC     HL
            SUB     041H
            CP      01AH
            JP      C,L650D
            JP      L6364

L5906:      LD      HL,(L9E4B)
L5909:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L5928             ; (+018H)
            LD      (L108E),A
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            LD      (L9E4B),HL
            EX      DE,HL
            INC     HL
            CALL    LDDEMI
            LD      (09E51H),DE
            CALL    L61E4
            POP     DE
            JR      L58D4               ; (-054H)

L5928:      POP     HL
            CALL    L596B
            JP      Z,L5878
            XOR     A
            LD      (L63F6),A
            LD      A,(L9E54)
            CP      002H
            JP      Z,06391H
            PUSH    HL
            JP      L60B9

L593F:      CP      0FFH
            JP      Z,L653F
            LD      DE,L5D1B
            CP      0FEH
            JR      NZ,L594F            ; (+004H)
            LD      A,(HL)
            INC     HL
            JR      L5957               ; (+008H)

L594F:      CP      LSE0
            JP      NC,L6364
            LD      DE,L5C5B
L5957:      ADD     A,A
            PUSH    HL
            EX      DE,HL
            LD      E,A
            LD      D,000H
            ADD     HL,DE
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            EX      (SP),HL
L5963:      CALL    HLFTCH
L5966:      OR      A
            RET     Z
            CP      03AH
            RET     

L596B:      PUSH    HL
            LD      HL,(L9E51)
            LD      A,L
            OR      H
            POP     HL
            RET     

CTBL1:      DB      "GOT", "O" | 080H ; CTBL1 - BASIC statement keyword text table
            DB      "GOSU", "B" | 080H
            DB      080H
            DB      "RU", "N" | 080H
            DB      "RETUR", "N" | 080H
            DB      "RESTOR", "E" | 080H
            DB      "RESUM", "E" | 080H
            DB      "LIS", "T" | 080H
            DB      080H
            DB      "DELET", "E" | 080H
            DB      "RENU", "M" | 080H
            DB      "AUT", "O" | 080H
            DB      "EDI", "T" | 080H
            DB      "FO", "R" | 080H
            DB      "NEX", "T" | 080H
            DB      "PRIN", "T" | 080H
            DB      080H
            DB      "INPU", "T" | 080H
            DB      080H
            DB      "I", "F" | 080H
            DB      "DAT", "A" | 080H
            DB      "REA", "D" | 080H
            DB      "DI", "M" | 080H
            DB      "RE", "M" | 080H
            DB      "EN", "D" | 080H
            DB      "STO", "P" | 080H
            DB      "CON", "T" | 080H
            DB      "CL", "S" | 080H
            DB      080H
            DB      "O", "N" | 080H
            DB      "LE", "T" | 080H
            DB      "NE", "W" | 080H
            DB      "POK", "E" | 080H
            DB      "OF", "F" | 080H
            DB      "PMOD", "E" | 080H
            DB      "PSKI", "P" | 080H
            DB      "PLO", "T" | 080H
            DB      "PLIN", "E" | 080H
            DB      "RLIN", "E" | 080H
            DB      "PMOV", "E" | 080H
            DB      "RMOV", "E" | 080H
            DB      "TRO", "N" | 080H
            DB      "TROF", "F" | 080H
            DB      "INP", "@" | 080H
            DB      "DEFAUL", "T" | 080H
            DB      "GE", "T" | 080H
            DB      "PCOLO", "R" | 080H
            DB      "PHOM", "E" | 080H
            DB      "HSE", "T" | 080H
            DB      "GPRIN", "T" | 080H
            DB      "KE", "Y" | 080H
            DB      "AXI", "S" | 080H
            DB      "LOA", "D" | 080H
            DB      "SAV", "E" | 080H
            DB      "MERG", "E" | 080H
            DB      "CHAI", "N" | 080H
            DB      "CONSOL", "E" | 080H
            DB      "SEARC", "H" | 080H
            DB      "OUT", "@" | 080H
            DB      "PCIRCL", "E" | 080H
            DB      "PTES", "T" | 080H
            DB      "PAG", "E" | 080H
            DB      "WAI", "T" | 080H
            DB      "SWA", "P" | 080H
            DB      080H
            DB      "ERRO", "R" | 080H
            DB      "ELS", "E" | 080H
            DB      "US", "R" | 080H
            DB      "BY", "E" | 080H
            DB      080H
            DB      080H
            DB      "DE", "F" | 080H
            DB      080H
            DB      080H
            DB      "LABE", "L" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      "WOPE", "N" | 080H
            DB      "CLOS", "E" | 080H
            DB      "ROPE", "N" | 080H
            DB      "XOPE", "N" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      "DI", "R" | 080H
            DB      080H
            DB      080H
            DB      "RENAM", "E" | 080H
            DB      "KIL", "L" | 080H
            DB      "LOC", "K" | 080H
            DB      "UNLOC", "K" | 080H
            DB      "INI", "T" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      "T", "O" | 080H
            DB      "STE", "P" | 080H
            DB      "THE", "N" | 080H
            DB      "USIN", "G" | 080H
            DB      080H
            DB      "AL", "L" | 080H
            DB      "TA", "B" | 080H
            DB      "SP", "C" | 080H
            DB      080H
            DB      080H
            DB      ".XO", "R" | 080H
            DB      ".O", "R" | 080H
            DB      ".AN", "D" | 080H
            DB      ".NO", "T" | 080H
            DB      ">", "<" | 080H
            DB      "<", ">" | 080H
            DB      "=", "<" | 080H
            DB      "<", "=" | 080H
            DB      "=", ">" | 080H
            DB      ">", "=" | 080H
            DB      "=" | 080H
            DB      ">" | 080H
            DB      "<" | 080H
            DB      "+" | 080H
            DB      "-" | 080H
            DB      "}" | 080H
            DB      ".MO", "D" | 080H
            DB      "/" | 080H
            DB      "*" | 080H
            DB      "^" | 080H
            DB      0FFH
GTABL:      DB      080H ; GTABL - BASIC extended keyword text table
            DB      "CSE", "T" | 080H
            DB      "CRESE", "T" | 080H
            DB      "CCOLO", "R" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "SOUN", "D" | 080H
            DB      080H
            DB      "NOIS", "E" | 080H
            DB      "BEE", "P" | 080H
            DB      080H
            DB      080H
            DB      "COLO", "R" | 080H
            DB      080H
            DB      "SE", "T" | 080H
            DB      "RESE", "T" | 080H
            DB      "LIN", "E" | 080H
            DB      "BLIN", "E" | 080H
            DB      "PA", "L" | 080H
            DB      "CIRCL", "E" | 080H
            DB      "BO", "X" | 080H
            DB      "PAIN", "T" | 080H
            DB      "POSITIO", "N" | 080H
            DB      "PATTER", "N" | 080H
            DB      "HCOP", "Y" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      "SYMBO", "L" | 080H
            DB      080H
            DB      "MUSI", "C" | 080H
            DB      "TEMP", "O" | 080H
            DB      "CURSO", "R" | 080H
            DB      "VERIF", "Y" | 080H
            DB      "CL", "R" | 080H
            DB      "LIMI", "T" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "BOO", "T" | 080H
            DB      0FFH
CTBL2:      DB      "IN", "T" | 080H ; CTBL2 - BASIC function keyword text table
            DB      "AB", "S" | 080H
            DB      "SI", "N" | 080H
            DB      "CO", "S" | 080H
            DB      "TA", "N" | 080H
            DB      "L", "N" | 080H
            DB      "EX", "P" | 080H
            DB      "SQ", "R" | 080H
            DB      "RN", "D" | 080H
            DB      "PEE", "K" | 080H
            DB      "AT", "N" | 080H
            DB      "SG", "N" | 080H
            DB      "LO", "G" | 080H
            DB      "FRA", "C" | 080H
            DB      "PA", "I" | 080H
            DB      "RA", "D" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "STIC", "K" | 080H
            DB      "STRI", "G" | 080H
            DB      080H
            DB      080H
            DB      "CHR", "$" | 080H
            DB      "STR", "$" | 080H
            DB      "HEX", "$" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "SPACE", "$" | 080H
            DB      080H
            DB      080H
            DB      "AS", "C" | 080H
            DB      "LE", "N" | 080H
            DB      "VA", "L" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "ER", "N" | 080H
            DB      "ER", "L" | 080H
            DB      "SIZ", "E" | 080H
            DB      "CSR", "H" | 080H
            DB      "CSR", "V" | 080H
            DB      "POS", "H" | 080H
            DB      "POS", "V" | 080H
            DB      "LEFT", "$" | 080H
            DB      "RIGHT", "$" | 080H
            DB      "MID", "$" | 080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      080H
            DB      "TI", "$" | 080H
            DB      "POIN", "T" | 080H
            DB      "EO", "F" | 080H
            DB      "F", "N" | 080H
            DB      0FFH
L5C5B:      DW      L69AF               ; SJPTBL - Statement keyword dispatch address table
            DW      L692A
            DW      L6364
            DW      L606E
            DW      L68F9
            DW      L6E9E
            DW      L64B6
            DW      06A9DH
            DW      L6364
            DW      L620C
            DW      L62AB
            DW      L60CA
            DW      L6125
            DW      L6602
            DW      L6699
            DW      L6C9F
            DW      L6364
            DW      L6DD4
            DW      L6364
            DW      L69C2
            DW      L67FE
            DW      L6DCD
            DW      L8DCC
            DW      L67FE
            DW      L60B9
            DW      L6468
            DW      L6499
            DW      L7972
            DW      L6364
            DW      L6952
            DW      L650D
            DW      L618E
            DW      L68A1
            DW      L6364
            DW      LA015
            DW      LA07A
            DW      LA428
            DW      LA0BC
            DW      0A0BFH
            DW      0A0C2H
            DW      0A0C5H
            DW      L61CC
            DW      L61DF
            DW      L681F
            DW      L6F41
            DW      L686C
            DW      LA12A
            DW      LA15F
            DW      0A162H
            DW      LA16D
            DW      L6B84
            DW      LA1D5
            DW      L6FFD
            DW      L73C0
            DW      L7068
            DW      L7053
            DW      L6A61
            DW      L6A9B
            DW      L680A
            DW      LA215
            DW      LA3E3
            DW      LA3F1
            DW      L67EE
            DW      L74A6
            DW      L6364
            DW      L63F8
            DW      L69E4
            DW      L67A4
            DW      L6A59
            DW      L6364
            DW      L6364
            DW      L6C31
            DW      L6364
            DW      L6364
            DW      L67FE
            DW      L6364
            DW      L6364
            DW      L6364
            DW      06F59H
            DW      L6F8A
            DW      L6F56
            DW      06F5CH
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L7424
            DW      L6364
            DW      L6364
            DW      L744B
            DW      06F8BH
            DW      07418H
            DW      L7416
            DW      L6F47
            DW      L6364
            DW      L6364
            DW      L6364
L5D1B:      DW      L6364               ; GJPTBL - Extended keyword dispatch address table
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L9BAC
            DW      L6364
            DW      L9BE3
            DW      L6A56
            DW      L6364
            DW      L6364
            DW      L7675
            DW      L6364
            DW      L7592
            DW      07593H
            DW      L75A1
            DW      075A2H
            DW      L7619
            DW      L774C
            DW      L7648
            DW      L76FD
            DW      L75F5
            DW      L75C4
            DW      L7968
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L790F
            DW      L6364
            DW      09BE6H
            DW      L9BD9
            DW      L683B
            DW      L73A9
            DW      L619B
            DW      L68B5
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6A95
L5D79:      DW      L95C2               ; FJPTBL - Function keyword dispatch address table
            DW      L95BD
            DW      L9709
            DW      L96F9
            DW      L97E8
            DW      L9A4F
            DW      L992B
            DW      L961F
            DW      L98E6
            DW      L98DA
            DW      L963D
            DW      L98A0
            DW      L9A43
            DW      L7BC0
            DW      L98B8
            DW      L98B3
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L9060
            DW      L907F
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L8931
            DW      L88F0
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L8913
            DW      L6364
            DW      L6364
            DW      L8992
            DW      L899C
            DW      L89A4
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L887A
            DW      L8888
            DW      L8852
            DW      L8864
            DW      L8869
            DW      L886E
            DW      L8874
            DW      L89B6
            DW      L89D3
            DW      L89F0
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L8A46
            DW      L896C
            DW      L893F
            DW      L8FBF
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
            DW      L6364
L5E19:      CALL    TEST1
            DB      00CH
            JR      NZ,L5E25            ; (+006H)
            CALL    LDDEMI
            OR      0FFH
            RET     

L5E25:      INC     HL
            CP      00BH
            JR      NZ,L5E49            ; (+01fH)
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            LD      A,E
            OR      D
            RET     Z
            EX      DE,HL
            CALL    L5E78
            JP      C,06385H
            EX      DE,HL
            DEC     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            DEC     HL
            LD      (HL),00CH
            INC     HL
            INC     HL
            INC     HL
            OR      0FFH
            LD      (L5FAC),A
            RET     

L5E49:      CP      022H
            JP      NZ,L6364
            LD      (05EBFH),HL
            LD      B,000H
L5E53:      LD      A,(HL)
            OR      A
            JR      Z,L5E5F             ; (+008H)
            INC     HL
            CP      022H
            JR      Z,L5E5F             ; (+003H)
            INC     B
            JR      L5E53               ; (-00cH)

L5E5F:      LD      A,B
            OR      A
            JP      Z,L6364
            LD      (05EBDH),A
            EX      DE,HL
            CALL    L5E72
            JP      C,06385H
            EX      DE,HL
            OR      0FFH
            RET     

L5E72:      PUSH    BC
            LD      BC,L5EAB
            JR      L5E7C               ; (+004H)

L5E78:      PUSH    BC
            LD      BC,L5E9F
L5E7C:      LD      (05E92H),BC
            PUSH    DE
            EX      DE,HL
            LD      HL,(L1070)
L5E85:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            LD      A,B
            OR      C
            SCF     
            JR      Z,L5E9C             ; (+00fH)
            DEC     HL
            PUSH    HL
            ADD     HL,BC
            EX      (SP),HL
            CALL    L0000
            JR      C,L5E9B             ; (+005H)
            JR      Z,L5E9B             ; (+003H)
            POP     HL
            JR      L5E85               ; (-016H)

L5E9B:      POP     DE
L5E9C:      POP     DE
            POP     BC
            RET     

L5E9F:      INC     HL
            INC     HL
            INC     HL
            LD      A,D
            CP      (HL)
            RET     NZ
            DEC     HL
            LD      A,E
            CP      (HL)
            DEC     HL
            DEC     HL
            RET     

L5EAB:      PUSH    HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            CALL    TEST1
            DB      0CAH
            JR      NZ,L5ECF            ; (+019H)
            CALL    TEST1
            DB      022H
            JR      NZ,L5ECF            ; (+013H)
            LD      B,000H
            LD      DE,L0000
L5EC1:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L5ECF            ; (+00aH)
            INC     HL
            INC     DE
            DJNZ    L5EC1               ; (-008H)
            LD      A,(HL)
            CP      022H
            JR      Z,L5ECF             ; (+001H)
            OR      A
L5ECF:      SCF     
            CCF     
            POP     HL
            RET     

L5ED3:      LD      DE,L0000
            LD      BC,0FFFFH
            CALL    L5F15
            RET     Z
            CP      02DH
            JR      Z,L5EFD             ; (+01cH)
            CP      02EH
            LD      DE,(09E4DH)
            JR      Z,L5EF0             ; (+007H)
            CALL    TESTX
            DB      00BH
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L5EF0:      INC     HL
            CALL    L5F15
            JR      Z,L5EFA             ; (+004H)
            CP      02DH
            JR      Z,L5EFD             ; (+003H)
L5EFA:      LD      C,E
            LD      B,D
            RET     

L5EFD:      INC     HL
            CALL    L5F15
            RET     Z
            CP      02EH
            JR      NZ,L5F0C            ; (+006H)
            LD      BC,(09E4DH)
            INC     HL
            RET     

L5F0C:      CALL    TESTX
            DB      00BH
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            INC     HL
            RET     

L5F15:      CALL    L5963
            RET     Z
            CP      02CH
            RET     

L5F1C:      CALL    PUSHR
            LD      A,0FFH
            LD      (L5FAC),A
            LD      HL,L5F72
            JR      L5F3B               ; (+012H)

L5F29:      CALL    PUSHR
            CALL    L60A2
L5F2F:      LD      A,(L5FAC)
            OR      A
            RET     Z
            XOR     A
            LD      (L5FAC),A
            LD      HL,L5F58
L5F3B:      LD      (05F56H),HL
            LD      HL,(L1070)
            DEC     HL
L5F42:      INC     HL
            LD      A,(HL)
            INC     HL
            OR      (HL)
            RET     Z
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      (05FA1H),DE
L5F4F:      CALL    L6A0A
            OR      A
            JR      Z,L5F42             ; (-013H)
            JP      L0000

L5F58:      CP      00CH
            JR      NZ,L5F4F            ; (-00dH)
            DEC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            PUSH    HL
            EX      DE,HL
            INC     HL
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            POP     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            DEC     HL
            LD      (HL),00BH
            INC     HL
            INC     HL
            JR      L5F4F               ; (-023H)

L5F72:      CP      00BH
            JR      NZ,L5F4F            ; (-027H)
            DEC     HL
            PUSH    HL
            CALL    INDRCT
            LD      E,L
            LD      D,H
            LD      A,L
            OR      H
            JR      Z,L5FA8             ; (+027H)
            CALL    L5E78
            JR      C,L5F91             ; (+00bH)
            EX      DE,HL
            POP     HL
            DEC     HL
            LD      (HL),00CH
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            JR      L5F4F               ; (-042H)

L5F91:      PUSH    DE
            LD      A,010H
            RST     018H
            DB      01BH
            LD      A,020H
            RST     018H
            DB      003H
            POP     HL
            CALL    L7998
            RST     018H
            DB      005H
            LD      HL,L0000
            CALL    L63D6
            RST     018H
            DB      002H
L5FA8:      POP     HL
            INC     HL
            JR      L5F4F               ; (-05dH)

L5FAC:      NOP     
L5FAD:      RST     018H
            DB      028H
            CALL    L5F29
            CALL    L8532
            LD      A,B
            OR      C
            JP      Z,L5881
            LD      (09E4DH),BC
            LD      A,(DE)
            CP      020H
            JR      NZ,L5FC4            ; (+001H)
            INC     DE
L5FC4:      PUSH    AF
            LD      HL,L9EB5
            CALL    L8216
            PUSH    HL
            LD      HL,(L9E4D)
            LD      E,L
            LD      D,H
            CALL    L622C
            POP     HL
            POP     AF
            OR      A
            JR      Z,L5FEB             ; (+012H)
            LD      DE,L9EB5
            OR      A
            SBC     HL,DE
            LD      DE,00005H
            ADD     HL,DE
            LD      B,H
            LD      C,L
            LD      HL,L9EB5
            CALL    L6003
L5FEB:      LD      A,(L611C)
            OR      A
            JP      Z,L5881
            LD      DE,(09E4FH)
            LD      HL,(L9E4D)
            ADD     HL,DE
            LD      (L9E4D),HL
            JP      NC,L5881
            JP      L58A9

L6003:      LD      (06065H),HL
            PUSH    BC
            LD      BC,(09E4DH)
            LD      HL,(L1070)
            JR      L6014               ; (+004H)

L6010:      CALL    LDDEMD
            ADD     HL,DE
L6014:      CALL    LDDEMD
            LD      A,D
            OR      E
            JR      Z,L6028             ; (+00dH)
            INC     HL
            INC     HL
            CALL    LDDEMD
            EX      DE,HL
            SBC     HL,BC
            DEC     DE
            DEC     DE
            EX      DE,HL
            JR      C,L6010             ; (-018H)
L6028:      POP     DE
            PUSH    HL
            PUSH    DE
            LD      HL,00028H
            ADD     HL,DE
            LD      BC,(VARED)
            LD      (TMPEND),BC
            ADD     HL,BC
            JP      C,L63A7
            EX      DE,HL
            CALL    L8C08
            POP     DE
            RST     018H
            DB      018H
            POP     HL
            PUSH    DE
            PUSH    BC
            EX      (SP),HL
            POP     BC
            PUSH    HL
            OR      A
            SBC     HL,BC
            LD      B,H
            LD      C,L
            POP     HL
            LD      DE,(VARED)
            INC     BC
            LDDR    
            INC     HL
            POP     BC
            LD      (HL),C
            INC     HL
            LD      (HL),B
            INC     HL
            LD      DE,(09E4DH)
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            EX      DE,HL
            LD      HL,L9EB5
            DEC     BC
            DEC     BC
            DEC     BC
            DEC     BC
            LDIR    
            RET     

L606E:      JR      Z,L6079             ; (+009H)
            CALL    L69DE
            JP      Z,L69AF
            JP      L716B

L6079:      CALL    L619B
L607C:      CALL    L6090
            LD      DE,(TEXTST)
            LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            PUSH    HL
            EX      DE,HL
            JP      L5909

L6090:      PUSH    HL
            CALL    L60A2
            LD      (L611C),A
            LD      HL,0000AH
            LD      (L9E4D),HL
            LD      (L9E4F),HL
            POP     HL
            RET     

L60A2:      LD      HL,L0000
            LD      (L9E55),HL
            XOR     A
            LD      (L9E5D),A
            LD      (L63F6),A
            LD      (L9E54),A
            LD      (L9E53),A
            LD      (L9E68),A
            RET     

L60B9:      LD      A,(L9E68)
            OR      A
            JP      NZ,L750C
            RST     018H
            DB      028H
            XOR     A
            LD      (L63F6),A
            POP     BC
            JP      L5878

L60CA:      CALL    L7340
            LD      DE,0000AH
            LD      BC,0000AH
            JR      Z,L6103             ; (+02eH)
            CP      02CH
            JR      NZ,L60E4            ; (+00bH)
            INC     HL
            CALL    L8551
            LD      B,D
            LD      C,E
            LD      DE,0000AH
            JR      L6103               ; (+01fH)

L60E4:      CP      02EH
            LD      DE,(09E4DH)
            JR      Z,L60F5             ; (+009H)
            CP      00BH
            JP      NZ,L6364
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L60F5:      INC     HL
            CALL    TEST1
            DB      02CH
            JR      NZ,L6103            ; (+007H)
            PUSH    DE
            CALL    L8551
            LD      C,E
            LD      B,D
            POP     DE
L6103:      CALL    L797A
            LD      A,C
            OR      B
            JP      Z,0636AH
            LD      (09E4DH),DE
            LD      (09E4FH),BC
            LD      A,001H
            LD      (L611C),A
            POP     AF
            JP      L5881

L611C:      NOP     
L611D:      LD      A,(L611C)
            OR      A
            RET     Z
            XOR     A
            JR      L612B               ; (+006H)

L6125:      CALL    L612B
            JP      L5881

L612B:      LD      DE,(09E4DH)
            CALL    NZ,L5ED3
            PUSH    DE
            EX      DE,HL
            CALL    L5E78
            POP     DE
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            JR      NC,L6141            ; (+003H)
            LD      HL,.NOP
L6141:      EX      DE,HL
            PUSH    DE
            LD      (L9E4D),HL
            CALL    L7998
            RST     018H
            DB      005H
            LD      A,020H
            RST     018H
            DB      003H
            POP     HL
            LD      DE,L11A4
            PUSH    DE
            CALL    L8401
            POP     DE
            LD      B,000H
L615A:      LD      A,(DE)
            OR      A
            JR      Z,L6164             ; (+006H)
            INC     B
            RST     018H
            DB      004H
            INC     DE
            JR      L615A               ; (-00aH)

L6164:      LD      A,B
            OR      A
            RET     Z
            LD      A,014H
            RST     018H
            DB      003H
            DJNZ    06168H               ; (-005H)
            RET     

L616E:      PUSH    DE
            LD      DE,0FFF0H
            ADD     HL,DE
            POP     DE
            LD      (L107E),HL
            DEC     H
            LD      (L107C),HL
            XOR     A
            LD      (L9E68),A
            RET     

L6180:      LD      HL,(L1070)
            CALL    L61C5
            LD      (L1072),HL
            CALL    L6090
            JR      L619B               ; (+00dH)

L618E:      CALL    TEST1
            DB      09DH
            CALL    Z,L9FCF
            CALL    L6180
            JP      L5872

L619B:      PUSH    HL
            CALL    L61AC
            POP     HL
            RST     018H
            DB      028H
            RET     

L61A3:      LD      HL,(L1070)
            CALL    L61C5
            LD      (L1072),HL
L61AC:      LD      HL,(L1072)
            LD      (HL),000H
            INC     HL
            LD      (L1074),HL
            LD      (HL),000H
            INC     HL
            LD      (L1076),HL
            CALL    L61C5
            LD      (L1078),HL
            LD      (L107A),HL
            RET     

L61C5:      LD      (HL),000H
            INC     HL
            LD      (HL),000H
            INC     HL
            RET     

L61CC:      CALL    L5963
            LD      A,001H
            JR      Z,L61E0             ; (+00dH)
            CALL    TESTX
            DB      0FBH
            CALL    TESTX
            DB      050H
            LD      A,002H
            JR      L61E0               ; (+001H)

L61DF:      XOR     A
L61E0:      LD      (061E5H),A
            RET     

L61E4:      LD      A,000H
            OR      A
            RET     Z
            DEC     A
            LD      (L1091),A
            JR      Z,L61F5             ; (+007H)
            LD      A,(L1097)
            CP      002H
            JR      Z,L6207             ; (+012H)
L61F5:      PUSH    HL
            LD      A,05BH
            RST     018H
            DB      009H
            LD      HL,(L9E51)
            CALL    L7998
            RST     018H
            DB      00BH
            LD      A,05DH
            RST     018H
            DB      009H
            POP     HL
L6207:      XOR     A
            LD      (L1091),A
            RET     

L620C:      CALL    L5F15
            JP      Z,L6364
            CALL    L69DE
            JR      Z,L6220             ; (+009H)
            CP      02DH
            JR      Z,L6220             ; (+005H)
            CP      02EH
            JP      NZ,L7443
L6220:      CALL    L5ED3
            EX      DE,HL
            LD      E,C
            LD      D,B
            CALL    L622C
            JP      L5878

L622C:      PUSH    AF
            PUSH    BC
            PUSH    HL
            PUSH    DE
            CALL    L5F29
            LD      C,L
            LD      B,H
            LD      HL,(L1070)
L6238:      CALL    LDDEMI
            LD      A,E
            OR      D
            JR      NZ,L6247            ; (+008H)
L623F:      POP     DE
            POP     HL
            POP     BC
            POP     AF
            RET     

L6244:      POP     DE
            JR      L623F               ; (-008H)

L6247:      EX      DE,HL
            ADD     HL,DE
            DEC     HL
            DEC     HL
            EX      DE,HL
            PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            EX      DE,HL
            LD      (06261H),HL
            SBC     HL,BC
            POP     HL
            JR      C,L6238             ; (-021H)
            DB      01BH
            DEC     DE
            DEC     DE
            POP     BC
            PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      HL,L0000
            SBC     HL,BC
            POP     HL
            JR      Z,L6286             ; (+01eH)
            JR      NC,L6244            ; (-026H)
L626A:      CALL    LDDEMI
            LD      A,D
            OR      E
            JR      Z,L6284             ; (+013H)
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            DEC     DE
            DEC     DE
            PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            EX      DE,HL
            SBC     HL,BC
            POP     HL
            JR      C,L626A             ; (-016H)
            JR      Z,L6286             ; (+004H)
            EX      DE,HL
            DEC     HL
L6284:      DEC     HL
            DEC     HL
L6286:      POP     DE
            PUSH    DE
            PUSH    HL
            OR      A
            EX      DE,HL
            SBC     HL,DE
            EX      DE,HL
            LD      BC,(VARED)
            RST     018H
            DB      018H
            POP     DE
            LD      H,B
            LD      L,C
            OR      A
            SBC     HL,DE
            LD      B,H
            LD      C,L
            EX      DE,HL
            POP     DE
            LDIR    
            JR      L623F               ; (-063H)

L62A2:      CALL    L8551
            LD      A,D
            OR      E
            RET     NZ
            JP      0636AH

L62AB:      CALL    L7340
            LD      DE,0000AH
            LD      (0632AH),DE
            LD      (06341H),DE
            LD      E,000H
            LD      (06319H),DE
            JR      Z,L62F4             ; (+033H)
            CP      02CH
            JR      Z,L62D5             ; (+010H)
            CALL    L62A2
            LD      (0632AH),DE
            CALL    L5963
            JR      Z,L62F4             ; (+023H)
            CALL    L79B1
            DEC     HL
L62D5:      CALL    INCHLF
            CP      02CH
            JR      Z,L62EC             ; (+010H)
            CALL    L62A2
            LD      (06319H),DE
            CALL    L5963
            JR      Z,L62F4             ; (+00cH)
            CALL    L79B1
            DEC     HL
L62EC:      INC     HL
            CALL    L62A2
            LD      (06341H),DE
L62F4:      PUSH    HL
            LD      HL,(06319H)
            EX      DE,HL
            LD      HL,(0632AH)
            OR      A
            SBC     HL,DE
            JP      C,0636AH
            CALL    L5F1C
            LD      HL,(L1070)
L6308:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L634A             ; (+03bH)
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            EX      DE,HL
            INC     HL
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            PUSH    HL
            LD      HL,L0000
            OR      A
            SBC     HL,BC
            POP     HL
            JR      Z,L6326             ; (+005H)
            JR      C,L6326             ; (+003H)
            EX      DE,HL
            JR      L6308               ; (-01eH)

L6326:      DEC     HL
            DEC     HL
            DEC     HL
            LD      BC,L0000
            OR      A
            PUSH    AF
L632E:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L634A             ; (+015H)
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            EX      DE,HL
            POP     AF
            JR      C,L6350             ; (+014H)
            INC     HL
            LD      (HL),C
            INC     HL
            LD      (HL),B
            LD      HL,L0000
            ADD     HL,BC
            PUSH    AF
            LD      C,L
            LD      B,H
            EX      DE,HL
            JR      L632E               ; (-01cH)

L634A:      POP     AF
            CALL    L5F2F
            POP     HL
            RET     

L6350:      LD      HL,0000AH
            LD      (06341H),HL
            LD      (0632AH),HL
            LD      L,000H
            LD      (06319H),HL
            CALL    L62F4
            JP      0636AH

L6364:      LD      A,001H
            LD      HL,L023E
            LD      HL,0033EH
            LD      HL,L043E
            LD      HL,L053E
            LD      HL,L063E
            LD      HL,0073EH
            LD      HL,0083EH
            LD      HL,L0D3E
            LD      HL,L0E3E
            LD      HL,00F3EH
            LD      HL,L103E
            LD      HL,L113E
            LD      HL,L123E
            LD      HL,L133E
            LD      HL,L143E
            LD      HL,L153E
            LD      HL,L163E
            LD      HL,L183E
            LD      HL,L193E
            LD      HL,L3A3E
            LD      HL,L403E
            JR      L63B5               ; (+00eH)

L63A7:      LD      A,006H
L63A9:      LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            LD      (09E64H),SP
L63B5:      JR      L63D3               ; (+01cH)

L63B7:      LD      HL,(.$LPT)
            LD      IX,(.$CRT)
            LD      (L1044),HL
            XOR     A
            LD      (L1051),A
            LD      A,0C4H
            LD      HL,0BB3EH
            LD      HL,L3B3E
            LD      HL,0BC3EH
            LD      HL,0BD3EH
L63D3:      JP      ERRORJ

L63D6:      LD      A,L
            OR      H
            RET     Z
            LD      DE,L63E4
            RST     018H
            DB      005H
            CALL    L7998
            DB      0DFH
            DB      005H
            DB      0C9H
L63E4:      DB      " IN ",000H
L63E9:      DB      042H,005H,"REAK",000H
L63F0:      DB      052H
            DB      005H
            DB      045H
            LD      B,C
            LD      B,H
            LD      E,C
L63F6:      NOP     
            NOP     
L63F8:      CALL    L853D
            DEC     A
            CP      046H
            JR      C,L6402             ; (+002H)
            LD      A,044H
L6402:      INC     A
L6403:      LD      SP,(09E64H)
            PUSH    AF
            RST     018H
            DB      043H
            CALL    L737C
            POP     AF
            OR      A
            JR      Z,L6463             ; (+052H)
            CP      080H
            JR      Z,L6461             ; (+04cH)
            LD      C,A
            LD      HL,L0000
            LD      (L9048),HL
            CALL    L596B
            LD      A,C
            JR      Z,L644C             ; (+02aH)
            LD      HL,(L9E51)
            LD      (L9E55),HL
            LD      (L9E4D),HL
            LD      HL,(L9E4B)
            LD      (L9E57),HL
            LD      HL,(L9E66)
            LD      (L9E59),HL
            AND     07FH
            LD      (L9E53),A
            LD      A,(L9E54)
            INC     A
            CP      002H
            JR      Z,L6457             ; (+013H)
            XOR     A
            LD      (L63F6),A
            LD      (L9E68),A
            LD      A,C
L644C:      RST     018H
            DB      01BH
L644E:      LD      HL,(L9E51)
            CALL    L63D6
            JP      L5878

L6457:      LD      (L9E54),A
            LD      HL,(09E5BH)
            PUSH    HL
            JP      L5909

L6461:      LD      A,02EH
L6463:      LD      HL,(L9E66)
            JR      L646B               ; (+003H)

L6468:      LD      A,02EH
            POP     DE
L646B:      PUSH    AF
            PUSH    HL
            RST     018H
            DB      002H
            RST     018H
            DB      020H
            LD      DE,L63E9
            RST     018H
            DB      005H
            POP     HL
            CALL    L596B
            JR      Z,L6495             ; (+019H)
            LD      (064B1H),HL
            LD      HL,(L9E4B)
            LD      (064ABH),HL
            LD      HL,(L9E51)
            LD      (064A5H),HL
            LD      (L9E4D),HL
            POP     AF
            LD      (L63F6),A
            JP      L644E

L6495:      POP     AF
            JP      L5878

L6499:      POP     DE
            LD      HL,L63F6
            LD      A,(HL)
            OR      A
            JP      Z,06388H
            LD      (HL),000H
            LD      HL,L0000
            LD      (L9E51),HL
            LD      HL,L0000
            LD      (L9E4B),HL
            LD      HL,L0000
            JP      L58D4

L64B6:      LD      A,(L9E54)
            CP      002H
            JP      C,06394H
            DEC     A
            LD      (L9E54),A
            CALL    L5963
            EX      DE,HL
            LD      HL,(L9E55)
            LD      (L9E51),HL
            LD      HL,(L9E57)
            LD      (L9E4B),HL
            LD      HL,(L9E59)
            JR      NZ,L64DB            ; (+004H)
            POP     BC
            JP      L58D8

L64DB:      CP      08EH
            JP      Z,L67FE
            EX      DE,HL
            JP      L69AF

L64E4:      CALL    TESTX
            DB      080H
            CALL    L5E19
            JR      Z,L64F7             ; (+00aH)
            LD      (09E5BH),DE
            LD      A,001H
L64F3:      LD      (L9E54),A
            RET     

L64F7:      LD      A,(L9E54)
            DEC     A
            JR      Z,L64F3             ; (-00aH)
            XOR     A
            LD      (L9E54),A
            LD      HL,(L9E55)
            LD      (L9E51),HL
            LD      A,(L9E53)
            JP      L6403

L650D:      CALL    TEST1
            DB      0FFH
            JP      Z,L653F
            CALL    L8B56
            PUSH    BC
            PUSH    BC
            PUSH    AF
            CALL    TESTX
            DB      SIOAD
            CALL    L857C
            POP     BC
            LD      A,(L9E9C)
            CP      B
            JP      NZ,0636DH
            EX      (SP),HL
            EX      DE,HL
            CP      005H
            JR      Z,L6537             ; (+008H)
            PUSH    BC
            CALL    L654A
            POP     AF
            POP     HL
            POP     BC
            RET     

L6537:      LD      C,A
            LD      B,000H
            LDIR    
            POP     HL
            POP     BC
            RET     

L653F:      CALL    TESTX
            DB      0C4H
            JP      L8AE2

L6546:      PUSH    DE
            EX      DE,HL
            JR      L654E               ; (+004H)

L654A:      PUSH    DE
            CALL    L8570
L654E:      LD      HL,L11A3
            LD      (HL),A
            LD      B,A
            LD      C,A
            INC     HL
            CALL    LDHLDE
            POP     HL
            LD      A,(HL)
            CP      C
            JR      Z,L659F             ; (+042H)
            PUSH    HL
            OR      A
            CALL    NZ,L65AF
            POP     HL
            LD      A,(L11A3)
            OR      A
            JR      Z,L659C             ; (+033H)
            PUSH    HL
            LD      BC,(VARST)
            SBC     HL,BC
            EX      DE,HL
            LD      HL,(L1078)
            DEC     HL
            DEC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            LD      BC,(STRST)
            OR      A
            POP     DE
            PUSH    HL
            SBC     HL,BC
            EX      DE,HL
            LD      (HL),A
            LD      B,A
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            POP     HL
            LD      DE,L11A3
            INC     DE
            CALL    L8BFC
            CALL    L61C5
            LD      (L107A),HL
            LD      (L1078),HL
            RET     

L659C:      LD      (HL),000H
            RET     

L659F:      INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            LD      DE,L11A3
            LD      B,C
            INC     DE
            JP      L8BFC

L65AF:      LD      C,(HL)
            LD      B,000H
            INC     BC
            INC     BC
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            DEC     HL
            DEC     HL
            LD      E,L
            LD      D,H
            ADD     HL,BC
            PUSH    BC
            PUSH    DE
            EX      DE,HL
            LD      HL,(L1078)
            OR      A
            SBC     HL,DE
            LD      C,L
            LD      B,H
            EX      DE,HL
            POP     DE
            PUSH    DE
            JR      Z,L65D3             ; (+002H)
            LDIR    
L65D3:      POP     DE
            POP     BC
            LD      HL,(L1078)
            OR      A
            SBC     HL,BC
            LD      (L1078),HL
            EX      DE,HL
L65DF:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            RET     Z
            LD      HL,(L1074)
            ADD     HL,DE
            LD      A,(HL)
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            OR      A
            EX      DE,HL
            SBC     HL,BC
            EX      DE,HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            PUSH    BC
            LD      C,A
            LD      B,000H
            LD      HL,(L1076)
            ADD     HL,DE
            ADD     HL,BC
            POP     BC
            JR      L65DF               ; (-023H)

L6602:      POP     BC
            LD      (06697H),BC
            CALL    L650D
            LD      IX,L0000
            ADD     IX,SP
            LD      (06679H),HL
            CALL    L6772
            LD      (06675H),BC
L661A:      LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JR      NZ,L6642            ; (+01aH)
            LD      E,(IX+006H)
            LD      D,(IX+007H)
            EX      DE,HL
            OR      A
            SBC     HL,BC
            JR      Z,L663B             ; (+007H)
            LD      DE,L0012
            ADD     IX,DE
            JR      L661A               ; (-021H)

L663B:      DB      011H
            LD      (DE),A
            NOP     
            ADD     IX,DE
            LD      SP,IX
L6642:      LD      HL,(06679H)
            CALL    TESTX
            DB      LSE0
            CALL    L857C
            PUSH    AF
            PUSH    HL
            EX      DE,HL
            LD      DE,L677E
            CALL    L79C5
            POP     HL
            POP     AF
            CP      LSE1
            LD      DE,L7C45
            JR      NZ,L6662            ; (+004H)
            INC     HL
            CALL    L857C
L6662:      LD      (06679H),HL
            LD      HL,0FFF6H
            ADD     HL,SP
            LD      SP,HL
            EX      DE,HL
            CALL    L79C5
            LD      HL,L677E
            CALL    L79C5
            LD      HL,L0000
            PUSH    HL
            LD      HL,L0000
            PUSH    HL
            LD      HL,(L9E4B)
            PUSH    HL
            LD      HL,0FF12H
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(TMPEND)
            SBC     HL,DE
            LD      A,00BH
            JP      C,L63A9
            LD      HL,(06679H)
            JP      L0000

L6699:      LD      A,005H
            LD      (L9E9C),A
            POP     BC
            LD      (0670EH),BC
L66A3:      PUSH    AF
            POP     BC
            LD      (06679H),HL
            LD      IX,L0000
            ADD     IX,SP
            LD      (066FDH),IX
            LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JP      NZ,0637CH
            PUSH    BC
            POP     AF
            JR      NZ,L6724            ; (+05fH)
            LD      E,(IX+004H)
            LD      D,(IX+005H)
            EX      DE,HL
            LD      (0670BH),HL
            LD      E,(IX+006H)
            LD      D,(IX+007H)
            LD      HL,(L1074)
            ADD     HL,DE
            LD      BC,00008H
            ADD     IX,BC
            PUSH    IX
            POP     DE
            CALL    L90BC
            INC     DE
            LD      A,(DE)
            LD      IX,(066FDH)
            LD      DE,0000DH
            ADD     IX,DE
            PUSH    IX
            POP     DE
            BIT     7,A
            JR      NZ,L66F7            ; (+001H)
            EX      DE,HL
L66F7:      CALL    L9153
            JR      C,L6710             ; (+014H)
            LD      SP,L0000
            LD      HL,00002H
            ADD     HL,SP
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            LD      (L9E4B),HL
            LD      HL,L0000
L670D:      JP      L0000

L6710:      LD      DE,L0012
            LD      HL,(066FDH)
            ADD     HL,DE
            LD      SP,HL
            LD      HL,(06679H)
            CALL    TEST1
            DB      02CH
            JR      NZ,L670D            ; (-014H)
            LD      (06679H),HL
L6724:      LD      IX,L0000
            ADD     IX,SP
            LD      (066FDH),IX
            LD      HL,(06679H)
            CALL    TEST1
            DB      02CH
            JP      Z,L66A3
            CALL    L8B56
            LD      (06679H),HL
            CALL    L6772
            LD      IX,(066FDH)
L6745:      LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JP      NZ,0637CH
            LD      L,(IX+006H)
            LD      H,(IX+007H)
            OR      A
            SBC     HL,BC
            LD      HL,(06679H)
            JP      Z,L66A3
            LD      DE,L0012
            ADD     IX,DE
            LD      (066FDH),IX
            LD      SP,(066FDH)
            JR      L6745               ; (-02dH)

L6772:      LD      H,B
            LD      L,C
            LD      BC,(VARST)
            OR      A
            SBC     HL,BC
            LD      B,H
            LD      C,L
            RET     

L677E:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L6787:      CALL    L6A0A
            OR      A
            RET     NZ
            INC     HL
            PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            INC     HL
            LD      (06786H),DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      (06784H),DE
            POP     DE
            SCF     
            RET     Z
            JR      L6787               ; (-01dH)

L67A4:      CALL    L79A6
            CALL    L8551
            LD      (067DDH),DE
            CALL    TEST1
            DB      02CH
            JR      NZ,L67CF            ; (+01bH)
            CALL    L857C
            CALL    L9036
            LD      (067D2H),DE
            CALL    TEST1
            DB      02CH
            JR      NZ,L67CF            ; (+00bH)
            CALL    L8B56
            CALL    L9036
            LD      (067E5H),BC
            XOR     A
L67CF:      PUSH    HL
            PUSH    AF
            LD      HL,L0000
            CALL    L8570
            LD      IX,ERRORJ
            XOR     A
            CALL    L0000
            POP     AF
            JR      NZ,L67EA            ; (+008H)
            LD      A,B
            EX      DE,HL
            LD      DE,L0000
            CALL    L6546
L67EA:      POP     HL
            JP      L79AA

L67EE:      CALL    L8551
L67F1:      LD      A,D
            OR      E
            RET     Z
            LD      B,0FBH
L67F6:      DJNZ    L67F6               ; (-002H)
            RST     018H
            DB      00EH
            RET     Z
            DEC     DE
            JR      L67F1               ; (-00dH)

L67FE:      DEC     HL
L67FF:      CALL    L6A0A
            OR      A
            SCF     
            RET     Z
            CP      03AH
            RET     Z
            JR      L67FF               ; (-00bH)

L680A:      CALL    L853D
            SUB     LSE0
            CP      007H
            JP      C,0636AH
            CALL    L79B1
            PUSH    DE
            CALL    L853D
            POP     BC
            OUT     (C),A
            RET     

L681F:      CALL    L853D
            CALL    L79B1
            PUSH    DE
            CALL    L8B56
            CP      005H
            JP      NZ,0636DH
            EX      (SP),HL
            PUSH    BC
            EX      (SP),HL
            POP     BC
            IN      E,(C)
            LD      D,000H
            CALL    L79CB
            POP     HL
            RET     

L683B:      CALL    L6843
            EX      DE,HL
            RST     018H
            DB      012H
            EX      DE,HL
            RET     

L6843:      LD      B,018H
            LD      C,027H
            LD      A,(L137A)
            CP      003H
            JR      C,L6850             ; (+002H)
            LD      C,04FH
L6850:      CALL    L6857
            JP      C,0636AH
            RET     

L6857:      PUSH    BC
            CALL    L853D
            PUSH    AF
            CALL    L79B1
            CALL    L853D
            LD      D,E
            POP     AF
            LD      E,A
            POP     BC
            LD      A,C
            CP      E
            RET     C
            LD      A,B
            CP      D
            RET     

L686C:      CALL    L8B56
            LD      (L9E9C),A
            CP      005H
            JR      Z,L688B             ; (+015H)
            PUSH    HL
            PUSH    BC
            LD      A,0FFH
            RST     018H
            DB      00DH
            OR      A
            JR      Z,L6885             ; (+006H)
            LD      HL,(L107A)
            LD      (HL),A
            LD      A,001H
L6885:      POP     DE
            CALL    L6546
            POP     HL
            RET     

L688B:      PUSH    HL
            PUSH    BC
            LD      A,0FFH
            RST     018H
            DB      00DH
            SUB     030H
            CP      00AH
            JR      C,L6898             ; (+001H)
            XOR     A
L6898:      LD      E,A
            LD      D,000H
            POP     HL
            CALL    L79CB
            POP     HL
            RET     

L68A1:      CALL    L8551
            CALL    L79B4
L68A7:      PUSH    DE
            CALL    L853D
            POP     DE
            LD      (DE),A
            INC     DE
            CALL    TEST1
            DB      02CH
            RET     NZ
            JR      L68A7               ; (-00eH)

L68B5:      PUSH    HL
            CALL    TEST1
            DB      04DH
            JR      NZ,L68CE            ; (+012H)
            CALL    TEST1
            DB      041H
            JR      NZ,L68CE            ; (+00cH)
            CALL    TEST1
            DB      058H
            JR      NZ,L68CE            ; (+006H)
            EX      (SP),HL
            LD      HL,(MEMMAX)
            JR      L68EA               ; (+01cH)

L68CE:      POP     HL
            CALL    L8551
            PUSH    HL
            LD      HL,(MEMMAX)
            OR      A
            SBC     HL,DE
            JP      C,L63A7
            LD      HL,(L107A)
            INC     H
            INC     H
            INC     H
            INC     H
            OR      A
            SBC     HL,DE
            JP      NC,0636AH
            EX      DE,HL
L68EA:      CALL    L616E
            POP     HL
            POP     DE
            LD      SP,(INTFAC)
            LD      BC,0FFFFH
            PUSH    BC
            PUSH    DE
            RET     

L68F9:      POP     IX
L68FB:      POP     BC
            PUSH    BC
            LD      A,B
            INC     A
            JP      NZ,0637FH
            LD      A,C
            CP      012H
            JR      Z,L6921             ; (+01aH)
            CP      0FEH
            JP      NZ,0637FH
            POP     BC
            CALL    L5963
            EX      DE,HL
            POP     HL
            LD      (L9E51),HL
            POP     HL
            LD      (L9E4B),HL
            POP     HL
            PUSH    IX
            RET     Z
            EX      DE,HL
            JP      L69AF

L6921:      EX      DE,HL
            LD      HL,L0012
            ADD     HL,SP
            LD      SP,HL
            EX      DE,HL
            JR      L68FB               ; (-02fH)

L692A:      PUSH    HL
            CALL    L67FE
            EX      DE,HL
            POP     HL
            POP     BC
            PUSH    DE
            EXX     
            LD      HL,(L9E4B)
            PUSH    HL
            LD      HL,(L9E51)
            PUSH    HL
            LD      HL,0FFFEH
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(TMPEND)
            SBC     HL,DE
            LD      A,00AH
            JP      C,L63A9
            EXX     
            PUSH    BC
            JR      L69AF               ; (+05dH)

L6952:      CALL    TEST1
            DB      0C1H
            JP      Z,L64E4
            CALL    L8551
            LD      C,E
            LD      B,D
            CP      087H
            JP      NC,L6364
            CP      082H
            JR      NZ,L6977            ; (+010H)
            CALL    INCHLF
            LD      E,081H
            CP      LSE4
            JR      Z,L6976             ; (+006H)
            CP      LSE0
            JP      NZ,L6364
            DEC     E
L6976:      LD      A,E
L6977:      PUSH    HL
            LD      HL,L5C5B
            SUB     080H
            ADD     A,A
            LD      E,A
            LD      D,000H
            ADD     HL,DE
            CALL    INDRCT
            EX      (SP),HL
            INC     HL
            LD      A,B
            OR      A
            JR      NZ,L69AB            ; (+020H)
            LD      A,C
            OR      A
            JR      Z,L69AB             ; (+01cH)
            LD      B,A
L6990:      DEC     B
            RET     Z
            CALL    HLFTCH
            CALL    L69DB
            JP      NZ,L6364
            CALL    L6A10
            OR      A
            RET     Z
            INC     HL
            CALL    TEST1
            DB      02CH
            JR      Z,L6990             ; (-017H)
            POP     DE
            JP      L797A

L69AB:      POP     DE
            JP      L67FE

L69AF:      CALL    L5E19
            EX      DE,HL
            JR      NZ,L69B8            ; (+003H)
            LD      HL,(L1070)
L69B8:      LD      (L9E4B),HL
            XOR     A
            LD      (L63F6),A
            JP      L5909

L69C2:      CALL    L857C
            EX      AF,AF'
            LD      A,(DE)
            OR      A
            JR      Z,L69EA             ; (+020H)
            EX      AF,AF'
            CP      LSE2
            JR      NZ,L69D7            ; (+008H)
L69CF:      CALL    INCHLF
            CALL    L69DB
            JR      Z,L69AF             ; (-028H)
L69D7:      POP     AF
            JP      L58D4

L69DB:      CP      022H
            RET     Z
L69DE:      CP      00BH
            RET     Z
            CP      00CH
            RET     

L69E4:      CALL    L69F3
            JR      NC,L69E4            ; (-005H)
            RET     

L69EA:      DEC     HL
            CALL    L69F3
            JR      NC,L69CF            ; (-021H)
            DB      0C3H
            LD      B,059H
L69F3:      CALL    L6A0A
            OR      A
            SCF     
            RET     Z
            CP      0C2H
            RET     Z
            CP      093H
            JR      NZ,L69F3            ; (-00dH)
            CALL    L69F3
            RET     C
            JR      L69F3               ; (-013H)

L6A06:      INC     HL
            LD      A,(HL)
            JR      L6A10               ; (+006H)

L6A0A:      INC     HL
            LD      A,(HL)
            CP      094H
            JR      Z,L6A2F             ; (+01fH)
L6A10:      OR      A
            RET     Z
            CP      022H
            JR      Z,L6A4D             ; (+037H)
            CP      0FEH
            JR      NC,L6A2D            ; (+013H)
            CP      097H
            JR      Z,L6A2F             ; (+011H)
            CP      027H
            JR      Z,L6A2F             ; (+00dH)
            CP      020H
            RET     NC
            CP      00BH
            RET     C
            CP      015H
            JR      NC,L6A44            ; (+018H)
            INC     HL
L6A2D:      INC     HL
            RET     

L6A2F:      LD      A,(HL)
            OR      A
            RET     Z
            CP      03AH
            RET     Z
            CP      022H
            JR      Z,L6A3C             ; (+003H)
            INC     HL
            JR      L6A2F               ; (-00dH)

L6A3C:      CALL    L6A4D
            OR      A
            RET     Z
            INC     HL
            JR      L6A2F               ; (-015H)

L6A44:      AND     00FH
            ADD     A,L
            LD      L,A
            LD      A,020H
            RET     NC
            INC     H
            RET     

L6A4D:      INC     HL
            LD      A,(HL)
            OR      A
            RET     Z
            CP      022H
            RET     Z
            JR      L6A4D               ; (-009H)

L6A56:      RST     018H
            DB      020H
            RET     

L6A59:      CALL    L797A
            RST     018H
            DB      028H
            RST     018H
            DB      000H
            RET     

L6A61:      JR      Z,L6A8D             ; (+02aH)
            LD      A,(L136F)
            LD      D,000H
            LD      E,A
            CALL    TEST1
            DB      02CH
            JR      Z,L6A75             ; (+006H)
            CALL    L853D
            CALL    L79B1
L6A75:      LD      C,E
            PUSH    BC
            CALL    L853D
            POP     BC
            DEC     A
            JP      M,0636AH
            ADD     A,C
            CP      019H
            JP      NC,0636AH
            LD      B,A
            PUSH    HL
            LD      H,B
            LD      L,C
            RST     018H
            DB      053H
            POP     HL
            RET     

L6A8D:      PUSH    HL
            LD      HL,$IOCS
            RST     018H
            DB      053H
            POP     HL
            RET     

L6A95:      DI      
            OUT     (LSE4),A
            JP      L0000

L6A9B:      XOR     A
            LD      BC,?SETDE
            LD      (L6B83),A
            PUSH    AF
            CALL    L6EF9
            RST     018H
            DB      02EH
            JP      C,063A3H
            BIT     1,A
            JP      Z,063A3H
            CALL    TEST1
            DB      02CH
            POP     AF
            OR      A
            JR      NZ,L6ACD            ; (+015H)
            CALL    L8561
            LD      A,B
            LD      (L6B7E),A
            LD      (06B7FH),DE
            CALL    L797A
            JR      L6ACD               ; (+005H)

L6AC8:      LD      A,002H
            LD      (L6B83),A
L6ACD:      CALL    L5ED3
            LD      (06AF4H),DE
            LD      (06B02H),BC
            LD      A,0FFH
            LD      (L1090),A
            CALL    PUSHR
            LD      HL,(L1070)
L6AE3:      CALL    LDDEMI
            LD      A,D
            OR      E
            RET     Z
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            DEC     HL
            EX      DE,HL
            PUSH    DE
            CALL    LDDEMI
            PUSH    HL
            LD      HL,L0000
            OR      A
            SBC     HL,DE
            JR      C,L6B01             ; (+006H)
            JR      Z,L6B01             ; (+004H)
            POP     HL
            POP     HL
            JR      L6AE3               ; (-01eH)

L6B01:      LD      HL,L0000
            OR      A
            SBC     HL,DE
            JR      NC,L6B0C            ; (+003H)
            POP     HL
            POP     HL
            RET     

L6B0C:      EX      DE,HL
            CALL    L7998
            RST     018H
            DB      017H
            LD      HL,L11A4
            CALL    LDHLDE
            LD      (HL),020H
            INC     HL
            EX      DE,HL
            POP     HL
            CALL    L8401
            LD      A,(L6B83)
            OR      A
            JR      NZ,L6B2B            ; (+005H)
            CALL    L6B41
            JR      NC,L6B35            ; (+00aH)
L6B2B:      LD      DE,L11A4
            RST     018H
            DB      017H
            RST     018H
            DB      037H
            CALL    L6DB1
L6B35:      POP     HL
            LD      A,(L6B83)
            CP      002H
            JR      Z,L6AE3             ; (-05aH)
            RST     018H
            DB      00FH
            JR      L6AE3               ; (-05eH)

L6B41:      EX      DE,HL
L6B42:      PUSH    HL
            CALL    L6B4C
            POP     HL
            RET     C
            RET     Z
            INC     HL
            JR      L6B42               ; (-00aH)

L6B4C:      LD      A,(L6B7E)
            LD      B,A
            LD      DE,(06B7FH)
L6B54:      LD      A,(HL)
            INC     HL
            OR      A
            RET     Z
            CP      005H
            JR      Z,L6B60             ; (+004H)
            CP      006H
            JR      NZ,L6B62            ; (+002H)
L6B60:      JR      L6B54               ; (-00eH)

L6B62:      PUSH    HL
            LD      C,A
L6B64:      LD      A,(DE)
            INC     DE
            CP      005H
            JR      Z,L6B6E             ; (+004H)
            CP      006H
            JR      NZ,L6B75            ; (+007H)
L6B6E:      DEC     B
            SCF     
            POP     HL
            RET     Z
            PUSH    HL
            JR      L6B64               ; (-011H)

L6B75:      SUB     C
            POP     HL
            OR      A
            RET     NZ
            DEC     B
            SCF     
            RET     Z
            JR      L6B54               ; (-02aH)

L6B7E:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L6B83:      NOP     
L6B84:      CALL    TESTX
            DB      087H
            CALL    L7981
            PUSH    HL
            LD      C,000H
L6B8E:      RST     018H
            DB      008H
            LD      A,C
            ADD     A,031H
            LD      D,A
            LD      E,020H
            CP      03AH
            JR      NZ,L6B9D            ; (+003H)
            LD      DE,03031H
L6B9D:      LD      (06C20H),DE
            LD      DE,L6C18
            RST     018H
            DB      00BH
            LD      A,C
            CALL    L6C77
            LD      B,(HL)
            INC     HL
            PUSH    BC
            CALL    L6BBB
            POP     BC
            INC     C
            LD      A,C
            CP      00AH
            JR      NZ,L6B8E            ; (-029H)
            RST     018H
            DB      008H
            POP     HL
            RET     

L6BBB:      LD      A,B
            OR      A
            LD      C,000H
            JR      NZ,L6BC8            ; (+007H)
            LD      A,022H
            RST     018H
            DB      00AH
            RST     018H
            DB      00AH
            RET     

L6BC8:      LD      A,(HL)
            CP      020H
            JR      C,L6BED             ; (+020H)
            CP      022H
            JR      Z,L6BED             ; (+01cH)
            LD      A,C
            CP      001H
            JR      Z,L6BE0             ; (+00aH)
            OR      A
            LD      DE,L6C25
            JR      NZ,L6BDE            ; (+002H)
            INC     DE
            INC     DE
L6BDE:      RST     018H
            DB      00BH
L6BE0:      LD      A,(HL)
            RST     018H
            DB      00AH
            INC     HL
            LD      C,001H
            DJNZ    L6BC8               ; (-020H)
            LD      A,022H
L6BEA:      RST     018H
            DB      00AH
            RET     

L6BED:      LD      A,C
            CP      0FFH
            JR      Z,L6C12             ; (+020H)
            OR      A
            LD      DE,L6C29
            JR      NZ,L6BFA            ; (+002H)
            INC     DE
            INC     DE
L6BFA:      RST     018H
            DB      00BH
            PUSH    BC
            PUSH    HL
            LD      L,(HL)
            LD      H,000H
            CALL    L7998
            RST     018H
            DB      00BH
            POP     HL
            POP     BC
            INC     HL
            LD      C,0FFH
            DJNZ    L6BC8               ; (-045H)
            LD      A,029H
            JP      L6BEA

L6C12:      DB      03EH
            DB      02CH
            DB      0DFH
            DB      00AH
            DB      018H
            DB      LSE4
L6C18:      DB      "DEF KEY("
            DS      2, 000H
            DB      029H
            DB      03DH
            DB      000H
L6C25:      DB      029H
            DB      02BH
            DB      022H
            DB      000H
L6C29:      DB      022H
            DEC     HL
            LD      B,E
            LD      C,B
            LD      D,D
            INC     H
            JR      Z,L6C31             ; (+000H)
L6C31:      CALL    TEST1
            DB      0B2H
            JR      Z,L6C42             ; (+00bH)
            CALL    TESTX
            DB      0FFH
            CALL    TESTX
            DB      0C7H
            JP      L8F44

L6C42:      CALL    TESTX
            DB      028H
            CALL    L853D
            CALL    TESTX
            DB      029H
            CALL    TESTX
            DB      SIOAD
            LD      A,E
            DEC     A
            CP      00AH
            JP      NC,0636AH
            PUSH    HL
            CALL    L6C77
            EX      (SP),HL
            CALL    L8561
            EX      (SP),HL
            LD      A,B
            CP      010H
            JR      C,L6C68             ; (+002H)
            LD      A,00FH
L6C68:      LD      (HL),A
            OR      A
            JR      Z,L6C74             ; (+008H)
            LD      B,A
            INC     HL
L6C6E:      LD      A,(DE)
            LD      (HL),A
            INC     DE
            INC     HL
            DJNZ    L6C6E               ; (-006H)
L6C74:      POP     HL
            EI      
            RET     

L6C77:      ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            LD      HL,L12B2
            JP      ADDHLA

L6C81:      LD      A,(L1042)
            CP      088H
            RET     

L6C87:      CALL    L857C
            LD      A,(L9E9C)
            CP      003H
            PUSH    HL
            EX      DE,HL
            JR      Z,L6C9A             ; (+007H)
            CALL    L7B5B
            POP     HL
            RST     018H
            DB      017H
            RET     

L6C9A:      CALL    L8570
            POP     HL
            RET     

L6C9F:      XOR     A
            LD      (L1090),A
            CALL    L6EF9
            RST     018H
            DB      02EH
            JP      C,L6E2D
            BIT     2,A
            JP      NZ,L7459
            BIT     1,A
            JP      Z,06E30H
            CALL    L6F39
            CALL    L6C81
            JR      NZ,L6CD3            ; (+016H)
            LD      A,(L137B)
            LD      (L7591),A
            CALL    TEST1
            DB      05BH
            JR      NZ,L6CD3            ; (+00aH)
            CALL    L76D9
            LD      (L7591),A
            CALL    TESTX
            DB      05DH
L6CD3:      CALL    L5963
            JP      Z,L6DB1
L6CD9:      LD      A,(HL)
            CP      LSE3
            JR      Z,L6D58             ; (+07aH)
            LD      BC,L6CF2
            PUSH    BC
            CP      03BH
            RET     Z
            CP      02CH
            RET     Z
            CP      0E6H
            JR      Z,L6D28             ; (+03cH)
            CALL    L6C87
            JP      L6DB6

L6CF2:      CALL    L5963
            JP      Z,L6DB1
            CP      02CH
            JR      NZ,L6D18            ; (+01cH)
            CALL    L6C81
            JR      C,L6D15             ; (+014H)
            LD      IX,(ZDELT)
            CALL    _IOCALL
            LD      B,A
L6D09:      SUB     00AH
            JR      NC,L6D09            ; (-004H)
            NEG     
            LD      B,A
            CALL    L6D4A
            JR      L6D18               ; (+003H)

L6D15:      CALL    L6DB1
L6D18:      LD      A,(HL)
            CP      02CH
            JR      Z,L6D1F             ; (+002H)
            CP      03BH
L6D1F:      JR      NZ,L6D22            ; (+001H)
            INC     HL
L6D22:      CALL    L5963
            RET     Z
            JR      L6CD9               ; (-04fH)

L6D28:      CALL    L6C81
            JP      C,06E30H
            CALL    L79A2
            CALL    L853D
            CALL    L79AA
            LD      IX,(ZDELT)
            CALL    _IOCALL
            SUB     E
            RET     NC
            NEG     
            LD      B,A
            CALL    L6C81
            LD      A,013H
            JR      Z,L6D4C             ; (+002H)
L6D4A:      LD      A,020H
L6D4C:      LD      DE,L11A5
            PUSH    BC
            PUSH    DE
            CALL    ?SETDE
            POP     DE
            POP     BC
            JR      L6DB6               ; (+05eH)

L6D58:      INC     HL
            CALL    L8561
            LD      A,B
            OR      A
            JP      Z,0636AH
            PUSH    HL
            LD      HL,L11A5
L6D65:      PUSH    HL
            PUSH    BC
            CALL    LDHLDE
            POP     BC
            LD      A,LSPAL
            LD      E,B
            LD      D,000H
            INC     DE
            RST     018H
            DB      02AH
            LD      (L7E39),HL
            LD      (L7E3B),HL
            POP     DE
            CALL    LDHLDE
            LD      (HL),000H
            POP     HL
L6D80:      CALL    L5963
            JR      Z,L6DA7             ; (+022H)
            INC     HL
            CP      02CH
            JR      Z,L6D8F             ; (+005H)
            CP      03BH
            JP      NZ,L6364
L6D8F:      CALL    L5963
            JR      Z,L6DAA             ; (+016H)
            CALL    L8584
            PUSH    HL
            LD      BC,(TMPEND)
            PUSH    BC
            CALL    L7E3D
            POP     DE
            CALL    L6DB4
            POP     HL
            JR      L6D80               ; (-027H)

L6DA7:      CALL    L6DB1
L6DAA:      LD      A,LSPAL
            RST     018H
            DB      02BH
            RET     

L6DAF:      DEC     C
            NOP     
L6DB1:      LD      DE,L6DAF
L6DB4:      RST     018H
            DB      017H
L6DB6:      CALL    L6C81
            JR      Z,L6DBE             ; (+003H)
            RST     018H
            DB      037H
            RET     

L6DBE:      PUSH    AF
            LD      A,(L7591)
            RST     018H
            DB      054H
            POP     AF
            RST     018H
            DB      037H
            LD      A,(L137B)
            RST     018H
            DB      054H
            RET     

L6DCD:      LD      A,08AH
            LD      (L1042),A
            JR      L6E0B               ; (+037H)

L6DD4:      CALL    L6EF9
            RST     018H
            DB      02EH
            JP      C,L6E2D
            BIT     2,A
            JP      NZ,L746A
            BIT     0,A
            JP      Z,06E30H
            CALL    L6F39
            CALL    L6C81
            JR      NZ,L6E0B            ; (+01dH)
            CALL    HLFTCH
            CP      022H
            LD      DE,L6E35
            LD      B,002H
            JR      NZ,L6E01            ; (+007H)
            CALL    L8561
            CALL    TESTX
            DB      03BH
L6E01:      LD      A,B
            OR      A
            JR      Z,L6E0B             ; (+006H)
L6E05:      LD      A,(DE)
            INC     DE
            RST     018H
            DB      003H
            DJNZ    L6E05               ; (-006H)
L6E0B:      LD      (06E64H),SP
            LD      DE,(VARED)
            LD      (TMPEND),DE
L6E17:      LD      DE,(TMPEND)
            CALL    L8C08
            CALL    L8B56
            PUSH    AF
            PUSH    BC
            CALL    L5963
            JR      Z,06E37H             ; (+00fH)
            CALL    L79B4
            JR      L6E17               ; (-016H)

L6E2D:      LD      A,02CH
            LD      HL,0BB3EH
            JP      ERRORJ

L6E35:      CCF     
            JR      NZ,06DE7H            ; (-051H)
            PUSH    AF
            PUSH    HL
            RST     018H
            DB      034H
            LD      HL,(06E64H)
            DEC     HL
L6E40:      LD      A,(HL)
            OR      A
            JR      Z,L6E62             ; (+01eH)
            DEC     HL
            DEC     HL
            LD      B,(HL)
            DEC     HL
            LD      C,(HL)
            DEC     HL
            PUSH    HL
            PUSH    AF
            PUSH    BC
            LD      DE,(TMPEND)
            CALL    L6E67
            LD      H,000H
            LD      L,B
            ADD     HL,DE
            LD      (HL),000H
            POP     DE
            POP     AF
            CALL    L6E71
            POP     HL
            JR      L6E40               ; (-022H)

L6E62:      POP     HL
            LD      SP,L0000
            RET     

L6E67:      LD      A,(L1042)
            CP      08AH
            JR      Z,L6EB0             ; (+042H)
            RST     018H
            DB      035H
            RET     

L6E71:      CP      003H
            JR      NZ,L6E7C            ; (+007H)
            LD      HL,(L107A)
            LD      A,B
            JP      L6546

L6E7C:      PUSH    DE
            LD      HL,(L107C)
            LD      DE,(TMPEND)
            EX      DE,HL
            CALL    HLFTCH
            CP      045H
            JP      Z,0636AH
            EX      DE,HL
            CALL    L7A0E
            EX      DE,HL
            CALL    TEST1
            DB      000H
            JP      NZ,0636AH
            EX      DE,HL
            POP     DE
            JP      L79C5

L6E9E:      XOR     A
            LD      (L9E5D),A
            CALL    L5963
            CALL    NZ,L5E19
            EX      DE,HL
            CALL    NZ,L6EE0
            EX      DE,HL
            JP      L67FE

L6EB0:      PUSH    HL
            PUSH    DE
            CALL    L6EBE
            POP     DE
            POP     HL
            RET     

L6EB8:      LD      HL,(L1070)
            CALL    L6EE0
L6EBE:      LD      A,(L9E5D)
            CP      001H
            JP      Z,0639AH
            JR      C,L6EB8             ; (-010H)
            LD      HL,(L9E5E)
            LD      C,03AH
            RST     018H
            DB      036H
            LD      (L9E5E),HL
            CALL    L5963
            SCF     
            CCF     
            RET     NZ
            DEC     HL
L6ED9:      CALL    L6A06
            OR      A
            JR      NZ,L6EEB            ; (+00cH)
            INC     HL
L6EE0:      LD      A,(HL)
            INC     HL
            OR      (HL)
            LD      A,001H
            JR      Z,L6EF5             ; (+00eH)
            INC     HL
            INC     HL
            JR      L6ED9               ; (-012H)

L6EEB:      CP      094H
            JR      NZ,L6ED9            ; (-016H)
            INC     HL
            LD      (L9E5E),HL
            LD      A,002H
L6EF5:      LD      (L9E5D),A
            RET     

L6EF9:      CALL    TEST1
            DB      023H
            JR      NZ,L6F24            ; (+025H)
            CALL    HLFTCH
            CP      020H
            JP      NC,L6364
            PUSH    DE
            PUSH    BC
            LD      DE,L9E9D
            PUSH    DE
            CALL    L874C
            EX      (SP),HL
            CALL    L7BEA
            LD      A,H
            OR      A
            JP      NZ,063A3H
            OR      L
            JP      Z,063A3H
            JP      M,063A3H
            POP     HL
            POP     BC
            POP     DE
            RET     

L6F24:      CALL    TEST1
            DB      0FBH
            LD      A,088H
            RET     NZ
            CALL    TEST1
            DB      050H
            LD      A,089H
            RET     Z
            CALL    TESTX
            DB      054H
            LD      A,080H
            RET     

L6F39:      LD      A,(L1042)
            OR      A
            RET     M
            JP      L79B1

L6F41:      CALL    L6FB1
            RST     018H
            DB      03AH
            RET     

L6F47:      CALL    L5963
            LD      B,000H
            CALL    NZ,L8561
            PUSH    HL
            RST     018H
            DB      02CH
            RST     018H
            DB      03CH
            POP     HL
            RET     

L6F56:      LD      A,001H
            LD      BC,L023E
            LD      BC,L043E
            PUSH    AF
            LD      (L1043),A
            CALL    L6EF9
            CP      088H
            JR      NZ,L6F6B            ; (+002H)
            LD      A,080H
L6F6B:      LD      (L1042),A
            CALL    L6F39
            CALL    L6FA4
            POP     AF
            CP      004H
            JR      Z,L6F7B             ; (+002H)
L6F79:      LD      A,003H
L6F7B:      LD      (L1000),A
            PUSH    AF
            RST     018H
            DB      033H
            LD      A,(L1000)
            POP     BC
            CP      B
            JP      NZ,063D1H
            RET     

L6F8A:      OR      0AFH
            LD      B,A
            CALL    L5963
            JR      Z,L6FA0             ; (+00eH)
L6F92:      CALL    L6EF9
            CP      088H
            RET     NC
            RST     018H
            DB      038H
            CALL    TEST1
            DB      02CH
            JR      L6F92               ; (-00eH)

L6FA0:      XOR     A
            RST     018H
            DB      038H
            RET     

L6FA4:      CALL    L5F15
            LD      B,000H
            CALL    NZ,L8561
            PUSH    HL
            RST     018H
            DB      02DH
            POP     HL
            RET     

L6FB1:      PUSH    HL
            CALL    HLFTCH
            LD      DE,L6FF9
            LD      B,001H
            CALL    L6FEC
            CALL    NC,L6FEC
            JR      C,L6FD9             ; (+017H)
            CALL    L6FEC
            CALL    L79F6
            CALL    L6FF2
            CALL    L5963
            JR      NZ,L6FD9            ; (+009H)
            LD      A,03AH
            LD      (DE),A
            POP     AF
            LD      DE,L6FF9
            JR      L6FE2               ; (+009H)

L6FD9:      POP     HL
            CALL    L5963
            LD      B,000H
            CALL    NZ,L8561
L6FE2:      PUSH    HL
            RST     018H
            DB      02CH
            INC     (HL)
            DEC     (HL)
            JP      NZ,063A0H
            POP     HL
            RET     

L6FEC:      CP      041H
            RET     C
            CP      05BH
            CCF     
L6FF2:      RET     C
            LD      (DE),A
            INC     HL
            INC     DE
            LD      A,(HL)
            INC     B
            RET     

L6FF9:      NOP     
            NOP     
            NOP     
            NOP     
L6FFD:      CALL    TEST1
            DB      LSE5
            JR      NZ,L7007            ; (+004H)
            XOR     A
L7004:      RST     018H
            DB      03BH
            RET     

L7007:      CALL    L6FA4
            CALL    TEST1
            DB      02CH
            JP      Z,L70C5
            PUSH    HL
            CALL    L7314
            DEC     A
            JR      Z,L7027             ; (+00fH)
            DEC     A
            JP      NZ,063D1H
            CALL    L7340
            CALL    L731D
            CALL    L7349
            JR      L7043               ; (+01cH)

L7027:      LD      HL,(ELMD22)
            PUSH    HL
            LD      DE,(MEMLMT)
            CALL    L704D
            LD      DE,(ELMD20)
            LD      BC,(MEMMAX)
            CALL    NC,L7048
            JP      C,0638BH
            POP     HL
            RST     018H
            DB      030H
L7043:      CALL    L737C
            POP     HL
            RET     

L7048:      ADD     HL,DE
            RET     C
            EX      DE,HL
            LD      H,B
            LD      L,C
L704D:      PUSH    HL
            OR      A
            SBC     HL,DE
            POP     HL
            RET     

L7053:      CALL    L6FA4
            CALL    L7314
            CP      002H
            JP      NZ,063D1H
            LD      A,(L9E68)
            OR      A
            JP      Z,L718B
            JP      L74F3

L7068:      CALL    L7340
            CALL    L6FA4
            CALL    TEST1
            DB      02CH
            JR      Z,070CBH             ; (+057H)
            RST     018H
            DB      02FH
            CP      002H
            JP      NZ,063D1H
            PUSH    HL
            LD      HL,(L1078)
            LD      (L107A),HL
            LD      BC,003E8H
            ADD     HL,BC
            JP      C,L63A7
            PUSH    HL
            LD      BC,(ELMD20)
            INC     B
            ADD     HL,BC
            JP      C,L63A7
            SBC     HL,SP
            JP      NC,L63A7
            POP     HL
            PUSH    HL
            RST     018H
            DB      030H
            POP     HL
            CALL    L70A2
            POP     HL
            RET     

L70A2:      CALL    LDDEMI
            LD      A,D
            OR      E
            RET     Z
            PUSH    DE
            CALL    LDDEMI
            PUSH    HL
            LD      H,D
            LD      L,E
            LD      (L9E4D),HL
            CALL    L622C
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
            CALL    L6003
            POP     HL
            POP     BC
            ADD     HL,BC
            DEC     HL
            DEC     HL
            DEC     HL
            DEC     HL
            JR      L70A2               ; (-023H)

L70C5:      CALL    L7340
            LD      A,001H
            LD      BC,L003E
            LD      BC,L023E
            PUSH    AF
            CALL    TESTX
            DB      041H
            CALL    L797A
            LD      A,001H
            LD      (L1043),A
            LD      A,081H
            LD      (L1042),A
            CALL    L6F79
            POP     AF
            PUSH    AF
            PUSH    HL
            LD      HL,L0000
            LD      DE,0FFFFH
            OR      A
            CALL    NZ,L622C
            LD      A,081H
            RST     018H
            DB      02EH
            LD      HL,(L1078)
            LD      (L107A),HL
            LD      BC,003E8H
            ADD     HL,BC
            JP      C,06373H
            PUSH    HL
            LD      (L7169),HL
L7107:      LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(07169H)
            SBC     HL,DE
            JP      C,06373H
            LD      DE,(TMPEND)
            RST     018H
            DB      035H
            LD      A,B
            OR      A
            JR      Z,L7154             ; (+036H)
            CALL    L8532
            LD      A,B
            OR      C
            JP      Z,0636AH
            LD      HL,(L7169)
            PUSH    HL
            INC     HL
            INC     HL
            LD      (HL),C
            INC     HL
            LD      (HL),B
            INC     HL
            PUSH    HL
            LD      H,D
            LD      L,E
            CALL    TEST1
            DB      000H
            JP      Z,0636AH
            POP     HL
            LD      A,(DE)
            CP      020H
            JR      NZ,L7141            ; (+001H)
            INC     DE
L7141:      CALL    L8216
            LD      (HL),000H
            INC     HL
            LD      (L7169),HL
            POP     DE
            OR      A
            SBC     HL,DE
            EX      DE,HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            JR      L7107               ; (-04dH)

L7154:      LD      HL,(L7169)
            CALL    L61C5
            CALL    L619B
            POP     HL
            CALL    L70A2
            POP     HL
            POP     AF
            CP      002H
            RET     NZ
            JP      L607C

L7169:      NOP     
            NOP     
L716B:      CALL    L6FA4
            PUSH    HL
            CALL    TEST1
            DB      02CH
            JR      NZ,L717D            ; (+008H)
            CALL    HLFTCH
            CP      041H
            JP      Z,070CEH
L717D:      CALL    L7314
            POP     HL
            DEC     A
            JR      Z,L7194             ; (+010H)
            DEC     A
            JP      NZ,063D1H
            CALL    L731D
L718B:      CALL    L7349
            CALL    L737C
            JP      L607C

L7194:      LD      D,000H
            LD      BC,0FF00H
            CALL    TEST1
            DB      02CH
            JR      NZ,L71A8            ; (+009H)
            CALL    TESTX
            DB      052H
            LD      D,001H
            LD      BC,0CFF0H
L71A8:      LD      A,D
            LD      (L11A4),A
            LD      HL,(L1014)
            LD      DE,(ELMD22)
            PUSH    HL
            CALL    L7048
            POP     DE
            LD      HL,$START
            LD      BC,0FF00H
            CALL    NC,L7048
            JP      C,L63A7
            LD      SP,L0000
            CALL    L61A3
            XOR     A
            LD      (L733F),A
            LD      A,036H
            OUT     (0D7H),A
            LD      A,001H
            OUT     (LSD3),A
            LD      HL,(ELMD22)
            LD      DE,(TMPEND)
            CALL    L704D
            JR      NC,L71F3            ; (+011H)
            PUSH    HL
            LD      HL,$START
            LD      (L1070),HL
            CALL    L61A3
            LD      HL,L122C
            LD      (L004F),HL
            POP     HL
L71F3:      LD      DE,(TMPEND)
            CALL    L704D
            JR      NC,L71FD            ; (+001H)
            EX      DE,HL
L71FD:      PUSH    AF
            PUSH    HL
            LD      HL,L720C
            LD      DE,L11A5
            PUSH    DE
            LD      BC,L00D0
            LDIR    
            RET     

L720C:      POP     HL
            RST     018H
            DB      030H
            LD      A,0C3H
            LD      HL,0038DH
            LD      (L1038),A
            LD      (L1039),HL
            LD      A,001H
            RST     018H
            DB      050H
            RST     018H
            DB      010H
            EX      AF,AF'
            LD      A,(L11A4)
            OR      A
            CALL    NZ,L1246
            EX      AF,AF'
            LD      HL,(L1018)
            LD      A,H
            OR      L
            EXX     
            LD      HL,(L107A)
            LD      DE,(ELMD22)
            LD      BC,(ELMD20)
            OR      D
            OR      E
            JR      Z,L7243             ; (+005H)
            LD      A,0E9H
            LD      (L123E),A
L7243:      EXX     
            POP     AF
            PUSH    HL
            LD      HL,L11EE
            LD      DE,0FF00H
            LD      BC,L0058
            LDIR    
            EXX     
            JP      0FF00H

            JR      NC,L7259            ; (+002H)
            LDIR    
L7259:      EX      AF,AF'
            RET     Z
            IN      A,(LSDMD)
            AND     002H
            LD      A,000H
            OUT     (LSDMD),A
            LD      HL,0FF53H
            LD      BC,00005H
            JR      NZ,L7284            ; (+019H)
            LD      A,008H
            OUT     (LSDMD),A
            IN      A,(LSE0)
            LD      HL,L1000
            LD      DE,0C000H
            LD      BC,L1000
            LDIR    
            IN      A,(LSE1)
            LD      HL,0FF45H
            LD      BC,0000EH
L7284:      LD      DE,0CFF0H
            LDIR    
            POP     HL
            LD      SP,L10F0
            LD      DE,ARAM
            JP      0CFF0H

            RST     018H
            DB      01BH
            RST     018H
            DB      043H
            RST     018H
            DB      010H
            HALT    
            OUT     (LSE4),A
L729C:      LD      A,071H
            LD      (DE),A
            INC     DE
            LD      A,D
            CP      LSE0
            JR      NZ,L729C            ; (-009H)
            OUT     (LSE0),A
            JP      (HL)

            OUT     (LSE0),A
            OUT     (LSE3),A
            JP      (HL)

            PUSH    AF
            DI      
            IM      1
            LD      HL,L1253
            LD      B,011H
            DW      L24DF
            DW      0C9F1H
            DW      0FC00H
            DW      0FCCFH
            DW      0FC3FH
            DW      0FC07H
            DW      0FD00H
            DW      0FDCFH
            DW      0FD00H
            DW      0FD07H
            DW      0D774H
            DW      0D7B0H
            DW      0D6C0H
L72D0:      DW      0D6A8H
            DW      0D5FBH
L72D4:      DW      0D53CH
            DW      0D305H
            LD      BC,001CDH
            CALL    Z,0782AH
            DJNZ    L7302               ; (+022H)
            LD      A,D
            DJNZ    L72D0               ; (-013H)
            LD      E,E
            LD      (HL),D
            DJNZ    L72D4               ; (-013H)
            LD      D,E
            ADD     HL,SP
            LD      (HL),E
            OR      A
            SBC     HL,DE
            LD      (L733B),HL
            LD      HL,0FF00H
            ADD     HL,SP
            LD      (L733D),HL
            LD      DE,(VARED)
            PUSH    HL
            OR      A
            SBC     HL,DE
            JP      C,L63A7
L7302:      EX      (SP),HL
            EX      DE,HL
            LD      BC,(0733BH)
            INC     BC
            LDDR    
            POP     DE
            RST     018H
            DB      018H
            LD      A,001H
            LD      (L733F),A
            RET     

L7314:      CALL    072DCH
            RST     018H
            DB      02FH
            LD      A,(L1000)
            RET     

L731D:      LD      HL,(L1078)
            XOR     A
            DEC     HL
            LD      (HL),A
            DEC     HL
            LD      (HL),A
            LD      (L1076),HL
            DEC     HL
            LD      (HL),A
            LD      (L1074),HL
            DEC     HL
            LD      (HL),A
            LD      (L1072),HL
            LD      HL,00004H
            LD      (L733B),HL
            RET     

L7339:      NOP     
            NOP     
L733B:      NOP     
            NOP     
L733D:      NOP     
            NOP     
L733F:      NOP     
L7340:      PUSH    AF
            CALL    L596B
            JP      NZ,0638EH
            POP     AF
            RET     

L7349:      LD      BC,(ELMD20)
            PUSH    BC
            LD      HL,(L1072)
            LD      DE,(TEXTST)
            OR      A
            SBC     HL,DE
            LD      L,000H
            SBC     HL,BC
            JP      C,L63A7
            LD      HL,L0000
            LD      (L7339),HL
            CALL    L6090
            LD      HL,L0000
            LD      (L9E51),HL
            LD      HL,(L1070)
            RST     018H
            DB      030H
            POP     BC
            LD      HL,(L1070)
            ADD     HL,BC
            LD      (L7339),HL
            RET     

L737C:      LD      A,081H
            LD      B,000H
            RST     018H
            DB      038H
            LD      HL,L733F
            LD      A,(HL)
            OR      A
            RET     Z
            LD      (HL),000H
            LD      HL,(L7339)
            LD      A,H
            OR      L
            JR      NZ,L7397            ; (+006H)
            LD      HL,(L1070)
            CALL    L61C5
L7397:      EX      DE,HL
            LD      HL,(L1072)
            LD      BC,(0733BH)
            LDIR    
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      DE,HL
            RST     018H
            DB      018H
            RET     

L73A9:      PUSH    HL
            CALL    L5F2F
            POP     HL
            CALL    L6FA4
            PUSH    HL
            RST     018H
            DB      02FH
            CP      002H
            JP      NZ,063D1H
            LD      HL,(L1070)
            RST     018H
            DB      032H
            POP     HL
            RET     

L73C0:      CALL    TEST1
            DB      LSE5
            LD      A,001H
            JP      Z,L7004
            PUSH    HL
            CALL    L5F2F
            POP     HL
            CALL    L6FA4
            CALL    TEST1
            DB      02CH
            JR      Z,L73F6             ; (+01fH)
            PUSH    HL
            LD      A,002H
            LD      (L1000),A
            LD      HL,(L1072)
            LD      DE,(TEXTST)
            OR      A
            SBC     HL,DE
            LD      (L1014),HL
            LD      A,(L1001)
            CP      00DH
            JP      Z,063CEH
            RST     018H
            DB      031H
            POP     HL
            RET     

L73F6:      CALL    TESTX
            DB      041H
            PUSH    HL
            LD      A,002H
            LD      (L1043),A
            LD      A,081H
            LD      (L1042),A
            CALL    L6F79
            POP     HL
            CALL    L6AC8
            CALL    L6DB1
            LD      B,001H
            LD      A,081H
            RST     018H
            DB      038H
            RET     

L7416:      XOR     A
            LD      BC,?SETDE
            PUSH    AF
            CALL    L8561
            RST     018H
            DB      02DH
            POP     AF
            RST     018H
            DB      03FH
            RET     

L7424:      CALL    L6EF9
            PUSH    AF
            RST     018H
            DB      02EH
            JP      C,L6E2D
            BIT     1,A
            JP      Z,06E30H
            CALL    L6F39
            CALL    L6FB1
            LD      B,A
            XOR     A
            RST     018H
            DB      039H
            LD      A,B
            RST     018H
            DB      03AH
            POP     AF
            RST     018H
            DB      039H
            RET     

L7443:      CALL    L8561
            RST     018H
            DB      02DH
            RST     018H
            DB      03DH
            RET     

L744B:      CALL    L8561
            RST     018H
            DB      02DH
            CALL    L79B1
            CALL    L8561
            RST     018H
            DB      03EH
            RET     

L7459:      CALL    L748F
L745C:      CALL    L6C87
            RST     018H
            DB      042H
            CALL    L5963
            RET     Z
            CALL    L79B4
            JR      L745C               ; (-00eH)

L746A:      CALL    L748F
            LD      DE,(TMPEND)
            CALL    L8C08
L7474:      CALL    L8B56
            PUSH    HL
            PUSH    AF
            PUSH    BC
            LD      DE,(TMPEND)
            RST     018H
            DB      041H
            POP     DE
            POP     AF
            CALL    L6E71
            POP     HL
            CALL    L5963
            RET     Z
            CALL    L79B4
            JR      L7474               ; (-01bH)

L748F:      CALL    TEST1
            DB      028H
            RET     NZ
            CALL    L8551
            LD      A,D
            OR      E
            JP      Z,0636AH
            RST     018H
            DB      040H
            CALL    L79AA
            CALL    TEST1
            DB      02CH
            RET     

L74A6:      LD      A,(L9E68)
            OR      A
            JP      NZ,0639DH
            PUSH    HL
            LD      B,000H
            RST     018H
            DB      02CH
            LD      (0755BH),DE
            LD      (L755D),A
            LD      HL,(L1072)
            LD      DE,(TEXTST)
            XOR     A
            SBC     HL,DE
            LD      (L1014),HL
            RST     018H
            DB      044H
            POP     HL
            CALL    L6FA4
            CALL    L797A
            LD      A,(L1050)
            BIT     5,A
            JP      Z,06E30H
            PUSH    HL
            LD      HL,(09E62H)
            ADD     HL,SP
            LD      SP,HL
            EX      DE,HL
            LD      HL,L9E4B
            LD      BC,(09E60H)
            LDIR    
            CALL    L7314
            CP      002H
            JP      NZ,063D1H
            LD      (074F4H),SP
L74F3:      LD      SP,L0000
            CALL    L7349
            CALL    L737C
            LD      HL,0FFFDH
            PUSH    HL
            PUSH    HL
            LD      A,001H
            LD      (L9E68),A
            LD      HL,(L1070)
            JP      L5909

L750C:      XOR     A
            LD      (L9E68),A
            POP     IX
L7512:      POP     BC
            LD      A,B
            CP      0FFH
            JP      NZ,0639DH
            LD      A,C
            CP      0FDH
            JR      Z,L7531             ; (+013H)
            CP      0FEH
            LD      HL,00004H
            JR      Z,L752D             ; (+008H)
            CP      012H
            LD      HL,00010H
            JP      NZ,0639DH
L752D:      ADD     HL,SP
            LD      SP,HL
            JR      L7512               ; (-01fH)

L7531:      LD      DE,(0755BH)
            LD      A,(L755D)
            RST     018H
            DB      03AH
            LD      B,000H
            RST     018H
            DB      02CH
            CALL    072DCH
            OR      0FFH
            RST     018H
            DB      044H
            CALL    L7349
            CALL    L737C
            LD      HL,L0000
            ADD     HL,SP
            LD      DE,L9E4B
            LD      BC,(09E60H)
            LDIR    
            LD      SP,HL
            POP     HL
            RET     

            NOP     
            NOP     
L755D:      NOP     
L755E:      POP     HL
            PUSH    HL
            LD      (L004F),HL
            LD      A,031H
            CALL    L7574
            LD      A,032H
            CALL    L7574
            LD      DE,L758B
            LD      B,005H
            JR      L757C               ; (+008H)

L7574:      LD      (L7581),A
            LD      DE,L757F
            DB      006H
            DB      00CH
L757C:      DB      0C3H
            DB      04FH
            DB      06FH
L757F:      DB      052H
            DB      053H
L7581:      DB      "?:0,$8C,13"
L758B:      DB      043H
            DB      04DH
            LD      D,H
            LD      A,(00054H)
L7591:      INC     BC
L7592:      OR      0AFH
            PUSH    AF
            CALL    L75FB
            RST     018H
            DB      047H
            POP     AF
            PUSH    HL
            EXX     
            RST     018H
            DB      048H
            POP     HL
            RET     

L75A1:      OR      0AFH
            LD      (075B7H),A
            CALL    L75FB
            CALL    L79B1
L75AC:      EXX     
            PUSH    HL
            PUSH    DE
            EXX     
            CALL    L75FE
            POP     DE
            EX      (SP),HL
            EXX     
            LD      A,000H
            RST     018H
            DB      049H
            POP     HL
            CALL    TEST1
            DB      02CH
            JR      Z,L75AC             ; (-015H)
            RST     018H
            DB      047H
            RET     

L75C4:      CALL    L768A
            CALL    L8551
            XOR     A
            BIT     7,D
            JR      Z,L75D8             ; (+009H)
            PUSH    HL
            LD      H,A
            LD      L,A
            SBC     HL,DE
            EX      DE,HL
            POP     HL
            LD      A,001H
L75D8:      EX      AF,AF'
            LD      A,D
            OR      A
            JR      NZ,L7616            ; (+039H)
            LD      A,E
            PUSH    AF
            EX      AF,AF'
            PUSH    AF
            CALL    L79B1
            CALL    L8561
            POP     AF
            LD      C,A
            POP     AF
            PUSH    HL
            LD      H,C
            RST     018H
            DB      04AH
            POP     HL
            CALL    L5963
            JR      NZ,L75C4            ; (-030H)
            RET     

L75F5:      CALL    L75FE
            RST     018H
            DB      047H
            RET     

L75FB:      CALL    L768A
L75FE:      CALL    L760F
            PUSH    DE
            CALL    TEST1
            DB      02CH
            CALL    L760F
            PUSH    DE
            EXX     
            POP     HL
            POP     DE
            EXX     
            RET     

L760F:      CALL    L8551
            LD      A,D
            ADD     A,040H
            RET     P
L7616:      JP      0636AH

L7619:      CALL    L5963
            JP      Z,L6364
            CALL    L7640
            CALL    L76DE
            AND     003H
            PUSH    AF
            LD      A,(L137E)
            LD      D,E
            SRL     D
            SRL     D
            CP      D
            JP      NZ,06397H
            CALL    TESTX
            DB      02CH
            CALL    L7640
            LD      B,A
            POP     AF
            RST     018H
            DB      052H
            RET     

L7640:      CALL    L853D
            CP      010H
            JR      NC,L7616            ; (-031H)
            RET     

L7648:      CALL    L75FB
            EXX     
            PUSH    HL
            PUSH    DE
            EXX     
            CALL    L79B1
            CALL    L75FE
            EXX     
            PUSH    HL
            PUSH    DE
            EXX     
            CALL    L5963
            JR      Z,L766B             ; (+00dH)
            CALL    L79B4
            CALL    L5963
            LD      A,(L7591)
            CALL    NZ,L76D9
            SCF     
L766B:      EXX     
            POP     DE
            POP     HL
            EXX     
            POP     DE
            EX      (SP),HL
            RST     018H
            DB      04BH
            POP     HL
            RET     

L7675:      CALL    L76B4
            LD      A,(L7591)
            RST     018H
            DB      054H
            LD      (L137B),A
            LD      A,(L109A)
            LD      (07590H),A
            CALL    L797A
            RET     

L768A:      CALL    TEST1
            DB      02CH
            CALL    TEST1
            DB      05BH
            JR      NZ,L76A5            ; (+011H)
            CALL    L76B4
            LD      A,(L7591)
            RST     018H
            DB      055H
            CALL    TESTX
            DB      05DH
            CALL    TEST1
            DB      02CH
            RET     

L76A5:      LD      A,(L137B)
            LD      (L7591),A
            RST     018H
            DB      055H
L76AD:      LD      A,(07590H)
            LD      (L109A),A
            RET     

L76B4:      CALL    TEST1
            DB      02CH
            JR      Z,L76D1             ; (+017H)
            CALL    L76D9
            LD      (L7591),A
            CALL    TEST1
            DB      02CH
            JR      NZ,L76AD            ; (-019H)
L76C6:      CALL    L853D
            CP      002H
            JR      NC,L76FA            ; (+02dH)
            LD      (L109A),A
            RET     

L76D1:      LD      A,(L137B)
            LD      (L7591),A
            JR      L76C6               ; (-013H)

L76D9:      PUSH    BC
            CALL    L853D
            POP     BC
L76DE:      LD      A,(L1379)
            RRA     
            JR      C,L76EA             ; (+006H)
            RRA     
            JR      C,L76F0             ; (+009H)
            RRA     
            JR      C,L76F6             ; (+00cH)
L76EA:      LD      A,E
            CP      004H
            JR      NC,L76FA            ; (+00bH)
            RET     

L76F0:      LD      A,E
            CP      010H
            JR      NC,L76FA            ; (+005H)
            RET     

L76F6:      LD      A,E
            CP      002H
            RET     C
L76FA:      JP      0636AH

L76FD:      CALL    L768A
            CALL    L75F5
            LD      B,000H
            LD      DE,L773C
            PUSH    DE
            CALL    L5963
            JR      Z,L7735             ; (+027H)
L770E:      CALL    L79B4
            PUSH    DE
            CALL    L76D9
            POP     DE
            LD      (DE),A
            INC     DE
            INC     B
            LD      A,B
            CP      010H
            JP      Z,L6364
            CALL    L5963
            JR      NZ,L770E            ; (-016H)
L7724:      EX      (SP),HL
            PUSH    HL
            LD      HL,0FDF1H
            ADD     HL,SP
            LD      (L137C),HL
            POP     HL
            RST     018H
            DB      04CH
            JP      C,06373H
            POP     HL
            RET     

L7735:      LD      A,(L7591)
            LD      (DE),A
            INC     B
            JR      L7724               ; (-018H)

L773C:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L774C:      PUSH    HL
            LD      HL,L0000
            LD      (0782FH),HL
            LD      (07829H),HL
            LD      (0782CH),HL
            LD      (07833H),HL
            LD      (07836H),HL
            LD      HL,L7905
            CALL    L909E
            LD      HL,L98C1
            LD      DE,L790A
            CALL    L79C5
            POP     HL
            CALL    L75FB
            RST     018H
            DB      047H
            CALL    L79B1
            CALL    L8551
            PUSH    HL
            LD      A,D
            AND     0C0H
            JP      NZ,0636AH
            EX      DE,HL
            LD      (0783AH),HL
            LD      (07829H),HL
            LD      (07833H),HL
            LD      HL,(L107C)
            LD      DE,L78F1
            CALL    L79C5
            POP     HL
            CALL    L5963
            JP      Z,L77EB
            CALL    L79B4
            CALL    TEST1
            DB      02CH
            JR      Z,L77B0             ; (+00cH)
            CALL    L7841
            CALL    L5963
            JP      Z,L77EB
            CALL    L79B4
L77B0:      CALL    TEST1
            DB      02CH
            JR      Z,L77CA             ; (+014H)
            LD      IX,07829H
            LD      IY,L7905
            CALL    L788E
            CALL    L5963
            JP      Z,L77EB
            CALL    L79B4
L77CA:      CALL    TEST1
            DB      02CH
            JR      Z,L77E4             ; (+014H)
            LD      IX,07833H
            LD      IY,L790A
            CALL    L788E
            CALL    L5963
            JP      Z,L77EB
            CALL    L79B4
L77E4:      CALL    TESTX
            DB      04FH
            SCF     
            JR      L77EC               ; (+001H)

L77EB:      XOR     A
L77EC:      PUSH    HL
            PUSH    AF
            LD      HL,L7905
            LD      DE,L790A
            CALL    L90B3
            CALL    L79C5
            LD      A,(L7905)
            OR      A
            LD      B,000H
            JR      Z,L781E             ; (+01cH)
            LD      HL,L7906
            RES     7,(HL)
            DEC     HL
            LD      DE,L98C6
            CALL    L9153
            LD      B,001H
            JR      C,L781E             ; (+00cH)
            LD      DE,L98C1
            CALL    L9153
            LD      B,002H
            JR      C,L781E             ; (+002H)
            LD      B,003H
L781E:      LD      A,(0790BH)
            AND     080H
            OR      B
            LD      B,A
            POP     AF
            LD      A,B
            EXX     
            LD      DE,L0000
            LD      HL,L0000
            LD      BC,L0000
            EXX     
            LD      DE,L0000
            LD      HL,L0000
            LD      IX,L0000
            RST     018H
            DB      04DH
            POP     HL
            OR      A
            RET     

L7841:      CALL    L8551
            CALL    PUSHR
            LD      HL,(L107C)
            INC     HL
            BIT     7,(HL)
            JP      NZ,0636AH
            DEC     HL
            LD      DE,L7C45
            CALL    L9153
            RET     Z
            LD      A,001H
            JR      C,L7870             ; (+014H)
            LD      HL,L7C45
            LD      DE,L78F6
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      DE,(INTFAC)
            CALL    L93D5
            LD      A,002H
L7870:      LD      (0782FH),A
            LD      DE,L78FB
            CALL    L92EA
            LD      DE,L7900
            CALL    L90BC
            CALL    L7BEA
            LD      A,L
            LD      (07830H),A
            BIT     0,H
            RET     Z
            XOR     A
            LD      (0782FH),A
            RET     

L788E:      PUSH    IX
            PUSH    IY
            CALL    L8551
            POP     DE
            POP     IX
            PUSH    HL
            PUSH    IX
            LD      HL,(L107C)
            CALL    L79C5
            LD      HL,(L107C)
            LD      D,H
            LD      E,L
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            CALL    L79C5
            CALL    L96F9
            LD      DE,L78F1
            CALL    L92EA
            CALL    L78D0
            LD      HL,(L107C)
            CALL    L9709
            LD      DE,L78F1
            CALL    L92EA
            CALL    L90A6
            CALL    L78D0
            POP     IX
            POP     HL
            RET     

L78D0:      INC     HL
            BIT     7,(HL)
            PUSH    AF
            RES     7,(HL)
            DEC     HL
            LD      DE,L7900
            CALL    L90BC
            POP     AF
            INC     HL
            JR      Z,L78E3             ; (+002H)
            SET     7,(HL)
L78E3:      DEC     HL
            CALL    L7BEA
            EX      DE,HL
            POP     HL
            EX      (SP),HL
            LD      (HL),E
            INC     HL
            DB      072H
            DS      2, 023H
            DB      LSE3
            DB      0E9H
L78F1:      DS      5, 000H
L78F6:      DS      5, 000H
L78FB:      DB      089H
            DS      4, 000H
L7900:      DB      080H
            DS      2, 000H
            DB      0A7H
            DB      0C6H
L7905:      DB      000H
L7906:      DS      4, 000H
L790A:      DS      5, 000H
L790F:      DB      LSRF
            DB      0FBH
            DB      075H
            DB      0DFH
            DB      047H
            DB      LSRF
            DB      0B1H
            DB      079H
            DB      LSRF
            DB      061H
            DB      085H
            LD      A,B
            OR      A
            PUSH    BC
            PUSH    HL
            LD      C,B
            LD      B,000H
            LD      HL,L27D0
            EX      DE,HL
            JR      Z,L7929             ; (+002H)
            LDIR    
L7929:      POP     HL
            CALL    L79B1
            CALL    L853D
            LD      A,D
            OR      E
            JR      Z,L793D             ; (+009H)
            PUSH    DE
            CALL    L79B1
            CALL    L853D
            LD      A,D
            OR      E
L793D:      JP      Z,0636AH
            LD      A,E
            POP     DE
            LD      D,A
            CALL    L5963
            PUSH    DE
            JR      Z,07957H             ; (+00eH)
            CALL    L79B1
            CALL    L853D
            LD      A,003H
            CP      E
            JP      C,0636AH
            LD      A,E
            LD      B,0AFH
            POP     DE
            POP     BC
            LD      C,A
            LD      A,B
            OR      A
            RET     Z
            LD      A,C
            PUSH    HL
            EX      DE,HL
            LD      DE,L27D0
            RST     018H
            DB      057H
            POP     HL
            RET     

L7968:      CALL    L797A
            PUSH    HL
            LD      A,000H
            RST     018H
            DB      04FH
            POP     HL
            RET     

L7972:      CALL    L797A
            PUSH    HL
            RST     018H
            DB      045H
            POP     HL
            RET     

L797A:      CALL    L5963
            RET     Z
            JP      L6364

L7981:      XOR     A
            LD      (L1091),A
            CALL    TEST1
            DB      0FBH
            RET     NZ
            CALL    TESTX
            DB      050H
            CALL    LA007
            LD      A,050H
            LD      (L1091),A
            CP      A
            RET     

L7998:      LD      DE,L9E6A
            LD      B,000H
            PUSH    DE
            RST     018H
            DB      016H
            POP     DE
            RET     

L79A2:      INC     HL
L79A3:      CALL    HLFTCH
L79A6:      CP      028H
            JR      L79B6               ; (+00cH)

L79AA:      CALL    HLFTCH
L79AD:      CP      029H
            JR      L79B6               ; (+005H)

L79B1:      CALL    HLFTCH
L79B4:      CP      02CH
L79B6:      INC     HL
            RET     Z
            JP      L6364

L79BB:      INC     DE
L79BC:      LD      A,(DE)
            CP      020H
            JR      Z,L79BB             ; (-006H)
            RET     

L79C2:      LD      HL,L7C45
L79C5:      LD      BC,00005H
            LDIR    
            RET     

L79CB:      CALL    L909E
            LD      A,E
            OR      D
            RET     Z
            BIT     7,D
            LD      A,07FH
            JR      Z,L79E0             ; (+009H)
            LD      A,D
            CPL     
            LD      D,A
            LD      A,E
            CPL     
            LD      E,A
            INC     DE
            LD      A,0FFH
L79E0:      LD      B,091H
L79E2:      DEC     B
            BIT     7,D
            JR      NZ,L79ED            ; (+006H)
            RL      E
            RL      D
            JR      L79E2               ; (-00bH)

L79ED:      LD      (HL),B
            INC     HL
            AND     D
            LD      (HL),A
            INC     HL
            LD      (HL),E
            DEC     HL
            DEC     HL
            RET     

L79F6:      CP      030H
            RET     C
            CP      03AH
            CCF     
            RET     

L79FD:      CP      05FH
            RET     Z
            CP      030H
            RET     C
            CP      05BH
            CCF     
            RET     C
            CP      03AH
            CCF     
            RET     NC
            CP      041H
            RET     

L7A0E:      CALL    L909E
            LD      (L7E34),A
            LD      (L7E35),A
            LD      (L7E36),A
            LD      (07AB6H),A
            LD      A,005H
            LD      (L9E9C),A
L7A22:      CALL    L79BC
            INC     DE
            CP      02BH
            JR      Z,L7A22             ; (-008H)
            CP      02DH
            JR      NZ,L7A34            ; (+006H)
            CALL    L7A22
            JP      L90A9

L7A34:      CP      024H
            JR      NZ,L7A44            ; (+00cH)
            PUSH    HL
            EX      DE,HL
            RST     018H
            DB      014H
            EX      (SP),HL
            CALL    L79CB
            POP     DE
            LD      A,005H
            RET     

L7A44:      CP      030H
            JR      NZ,L7A4E            ; (+006H)
            LD      A,(DE)
            INC     DE
            JR      L7A44               ; (-008H)

L7A4C:      LD      A,(DE)
            INC     DE
L7A4E:      CP      020H
            JR      Z,L7A4C             ; (-006H)
            CP      02EH
            JR      Z,L7A71             ; (+01bH)
            CALL    L79F6
            JR      C,L7AAB             ; (+050H)
            SUB     030H
            CALL    L7BDD
            CALL    L7B47
            LD      A,001H
            LD      (L7E35),A
            LD      A,(L7E34)
            INC     A
            LD      (L7E34),A
            JR      L7A4C               ; (-025H)

L7A71:      LD      A,001H
            LD      (07AB6H),A
            LD      C,A
L7A77:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L7A77             ; (-006H)
            CALL    L79F6
            JR      C,L7AA3             ; (+021H)
            INC     C
            SUB     030H
            JR      Z,L7A8E             ; (+007H)
            PUSH    AF
            LD      A,001H
            LD      (L7E35),A
            POP     AF
L7A8E:      PUSH    AF
            LD      A,(L7E35)
            LD      B,A
            LD      A,(L7E34)
            ADD     A,B
            LD      (L7E34),A
            POP     AF
            CALL    L7BDD
            CALL    L7B47
            JR      L7A77               ; (-02cH)

L7AA3:      DEC     C
            JR      Z,L7AAB             ; (+005H)
            CALL    L7B31
            JR      L7AA3               ; (-008H)

L7AAB:      CP      045H
            JR      Z,L7ABC             ; (+00dH)
L7AAF:      DEC     DE
            LD      A,(L7E36)
            OR      A
            RET     NZ
            LD      A,000H
            OR      A
            RET     NZ
            LD      A,005H
            RET     

L7ABC:      LD      A,(DE)
            CP      02DH
            JR      Z,L7ACA             ; (+009H)
            CP      02BH
            JR      Z,L7ACA             ; (+005H)
            CALL    L79F6
            JR      C,L7AAF             ; (-01bH)
L7ACA:      LD      A,001H
            LD      (07AB6H),A
            PUSH    HL
            LD      HL,L92EA
            LD      (07B2AH),HL
            LD      HL,L0000
            LD      A,(DE)
            INC     DE
            CP      02BH
            JR      Z,L7AEB             ; (+00cH)
            CP      02DH
            JR      NZ,L7AED            ; (+00aH)
            PUSH    HL
            LD      HL,L93D5
            LD      (07B2AH),HL
            POP     HL
L7AEB:      LD      A,(DE)
            INC     DE
L7AED:      SUB     030H
            JR      C,L7B0D             ; (+01cH)
            CP      00AH
            JR      NC,L7B0D            ; (+018H)
            PUSH    DE
            CALL    L7B42
            LD      E,L
            LD      D,H
            CALL    L7B42
            CALL    L7B42
            CALL    L7B3E
            LD      E,A
            LD      D,000H
            CALL    L7B3E
            POP     DE
            JR      L7AEB               ; (-022H)

L7B0D:      LD      A,H
            OR      A
            JR      NZ,L7B44            ; (+033H)
            LD      A,L
            POP     HL
            PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      DE,L9E9D
            PUSH    DE
            CALL    L79C2
            POP     HL
            LD      B,A
            INC     B
            JR      L7B25               ; (+003H)

L7B22:      CALL    L7BDD
L7B25:      DJNZ    L7B22               ; (-005H)
            EX      DE,HL
            POP     HL
            CALL    L0000
            POP     BC
            POP     DE
            JP      L7AAF

L7B31:      PUSH    AF
            PUSH    BC
            PUSH    DE
            LD      DE,L7C40
            CALL    L93D5
            POP     DE
            POP     BC
            POP     AF
            RET     

L7B3E:      ADD     HL,DE
            RET     NC
            JR      L7B44               ; (+002H)

L7B42:      ADD     HL,HL
            RET     NC
L7B44:      JP      06367H

L7B47:      PUSH    DE
            PUSH    HL
            LD      HL,L9E9D
            LD      E,A
            LD      D,000H
            CALL    L79CB
            EX      DE,HL
            POP     HL
            PUSH    BC
            CALL    L90BC
            POP     BC
            POP     DE
            RET     

L7B5B:      LD      A,005H
            LD      (L9E9C),A
            LD      A,(HL)
            OR      A
            JR      Z,L7B68             ; (+004H)
            INC     HL
            LD      A,(HL)
            DEC     HL
            RLCA    
L7B68:      LD      A,020H
            JR      NC,L7B71            ; (+005H)
            CALL    L90A9
            LD      A,02DH
L7B71:      PUSH    AF
            CALL    L7CE0
            CALL    L7D6D
            POP     AF
            DEC     DE
            LD      (DE),A
            RET     

L7B7C:      PUSH    BC
            CALL    L9153
            POP     BC
            RET     

L7B82:      CALL    PUSHR
            LD      A,(HL)
            CP      081H
            JP      C,L909E
            LD      A,(HL)
            CP      0A0H
            RET     NC
            INC     HL
            CALL    L7BB9
            PUSH    HL
            LD      L,(HL)
            LD      B,000H
L7B97:      SRL     E
            RR      D
            RR      C
            RR      L
            INC     A
            INC     B
            CP      0A0H
            JR      NZ,L7B97            ; (-00eH)
L7BA5:      SLA     L
            RL      C
            RL      D
            RL      E
            DJNZ    L7BA5               ; (-00aH)
            LD      A,L
            POP     HL
            LD      (HL),A
            DEC     HL
            LD      (HL),C
            DEC     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            RET     

L7BB9:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            LD      C,(HL)
            INC     HL
            RET     

L7BC0:      LD      A,(HL)
            CP      081H
            RET     C
            PUSH    DE
            PUSH    HL
            LD      DE,L7BD8
            PUSH    DE
            CALL    L79C5
            POP     HL
            CALL    L7B82
            EX      DE,HL
            POP     HL
            CALL    L90B3
            POP     DE
            RET     

L7BD8:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L7BDD:      PUSH    AF
            PUSH    BC
            PUSH    DE
            LD      DE,L7C40
            CALL    L92EA
            POP     DE
            POP     BC
            POP     AF
            RET     

L7BEA:      INC     HL
            BIT     7,(HL)
            JR      Z,L7BFA             ; (+00bH)
            CALL    L7BFA
            LD      A,H
            CPL     
            LD      H,A
            LD      A,L
            CPL     
            LD      L,A
            INC     HL
            RET     

L7BFA:      DEC     HL
            LD      A,(HL)
            CP      091H
            JP      NC,06367H
            CP      081H
            JR      C,L7C18             ; (+013H)
            PUSH    AF
            INC     HL
            LD      A,(HL)
            INC     HL
            LD      L,(HL)
            LD      H,A
            POP     AF
            SET     7,H
L7C0E:      CP      090H
            RET     Z
            INC     A
            SRL     H
            RR      L
            JR      L7C0E               ; (-00aH)

L7C18:      DB      03FH
            DB      021H
            DS      2, 000H
            DB      0C9H
L7C1D:      DB      09BH
            DB      03EH
            DB      0BCH
            DB      020H
            DB      000H
L7C22:      DB      098H
            DB      018H
            DB      096H
            DB      080H
            DB      000H
            DB      094H
            DB      074H
            DB      024H
            DS      2, 000H
            DB      091H
            DB      043H
            DB      050H
            DS      2, 000H
            DB      08EH
            DB      01CH
            DB      040H
            DS      2, 000H
            DB      08AH
            DB      07AH
            DS      3, 000H
            DB      087H
            DB      048H
            DS      3, 000H
L7C40:      DB      084H
            DB      020H
            DS      3, 000H
L7C45:      DB      081H
            DS      4, 000H
            LD      A,L
            LD      C,H
            CALL    Z,0CDCCH
L7C4F:      LD      H,(HL)
            DEC     HL
            CALL    Z,L1277
L7C54:      LD      HL,(L7E37)
            LD      B,000H
L7C59:      LD      DE,L7C40
            CALL    L7B7C
            JR      C,L7C67             ; (+006H)
            CALL    L7B31
            INC     B
            JR      L7C59               ; (-00eH)

L7C67:      LD      DE,L7C45
            CALL    L7B7C
            JR      NC,L7C75            ; (+006H)
            CALL    L7BDD
            DEC     B
            JR      L7C67               ; (-00eH)

L7C75:      PUSH    BC
            CALL    L7CE0
            CALL    L7D6D
            POP     BC
            PUSH    DE
            EX      DE,HL
L7C7F:      LD      A,(HL)
            OR      A
            JR      Z,L7C86             ; (+003H)
            INC     HL
            JR      L7C7F               ; (-007H)

L7C86:      DEC     HL
            LD      A,(HL)
            INC     HL
            CP      030H
            JR      NZ,L7C8F            ; (+002H)
            INC     B
            DEC     HL
L7C8F:      LD      A,045H
            LD      (HL),A
            INC     HL
            LD      A,B
            LD      B,02BH
            BIT     7,A
            JR      Z,L7C9E             ; (+004H)
            NEG     
            LD      B,02DH
L7C9E:      LD      (HL),B
            INC     HL
            LD      (HL),030H
L7CA2:      SUB     00AH
            JR      C,L7CA9             ; (+003H)
            INC     (HL)
            JR      L7CA2               ; (-007H)

L7CA9:      ADD     A,03AH
            INC     HL
            LD      (HL),A
            INC     HL
            LD      (HL),000H
            POP     DE
            RET     

L7CB2:      PUSH    HL
            CALL    L7BEA
            LD      DE,L9E75
            PUSH    DE
            LD      B,001H
            RST     018H
            DB      016H
            POP     HL
            LD      A,030H
            LD      B,005H
L7CC3:      CP      (HL)
            JR      NZ,L7CCB            ; (+005H)
            INC     HL
            DJNZ    L7CC3               ; (-006H)
            JR      L7CD4               ; (+009H)

L7CCB:      LD      A,B
            LD      (L7E34),A
            LD      A,001H
            LD      (L7E35),A
L7CD4:      LD      A,02EH
            LD      (L9E7A),A
            POP     HL
            CALL    L7BC0
            JP      L7D30

L7CE0:      LD      (L7E37),HL
            XOR     A
            LD      (L7E34),A
            LD      (L7E35),A
            PUSH    HL
            LD      HL,L9E71
            LD      (HL),0FFH
            LD      B,021H
            LD      A,030H
L7CF4:      INC     HL
            LD      (HL),A
            DJNZ    L7CF4               ; (-004H)
            LD      A,02EH
            LD      (L9E7A),A
            POP     HL
            LD      A,(HL)
            OR      A
            RET     Z
            LD      DE,L7C1D
            CALL    L9153
            CCF     
            RET     C
            LD      DE,L7C4F
            CALL    L9153
            RET     C
            LD      DE,L9EA5
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      A,(HL)
            CP      081H
            JR      C,L7D30             ; (+013H)
            CP      090H
            JP      C,L7CB2
            LD      IX,L9E72
            LD      DE,L7C22
            CALL    L7DF7
            CALL    L7E2B
            RET     NC
L7D30:      LD      IX,L9E7B
L7D34:      LD      DE,L7C1D
            PUSH    BC
            PUSH    IX
            CALL    L92EA
            POP     IX
            POP     BC
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            CALL    L7DF7
            CALL    L7E2B
            JR      C,L7D34             ; (-019H)
            RET     

L7D4E:      LD      A,005H
            LD      (L9E9C),A
            PUSH    HL
            LD      DE,L9EAD
            PUSH    DE
            CALL    L79C5
            POP     HL
            CALL    L7CE0
            CALL    L7D6A
            POP     HL
            RET     

L7D64:      LD      DE,L9E7A
            LD      (DE),A
            DEC     DE
            RET     

L7D6A:      JP      C,L7C54
L7D6D:      LD      HL,(L7E37)
            LD      A,(HL)
            OR      A
            JR      Z,L7D64             ; (-010H)
            LD      DE,L9E72
            DEC     DE
            EX      DE,HL
            LD      DE,00001H
L7D7C:      INC     HL
            LD      A,(HL)
            CP      02EH
            JR      NZ,L7D87            ; (+005H)
            LD      DE,L0000
            JR      L7D7C               ; (-00bH)

L7D87:      CP      030H
            JR      Z,L7D7C             ; (-00fH)
            ADD     HL,DE
            LD      DE,00008H
            ADD     HL,DE
            LD      A,(HL)
L7D91:      LD      (HL),030H
            CP      035H
            JR      C,L7DA6             ; (+00fH)
L7D97:      DEC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L7D97             ; (-006H)
            INC     A
            JR      Z,L7DE0             ; (+040H)
            LD      (HL),A
            CP      03AH
            JR      Z,L7D91             ; (-014H)
            INC     HL
L7DA6:      LD      DE,L9E7A
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      DE,HL
            JR      C,L7DB5             ; (+005H)
            LD      HL,L9E7A
            JR      L7DCC               ; (+017H)

L7DB5:      DEC     HL
            LD      A,(HL)
            CP      02EH
            DEC     HL
            JR      Z,L7DCB             ; (+00fH)
            INC     HL
            CP      030H
            JR      Z,L7DA6             ; (-01bH)
            PUSH    HL
            LD      DE,L9E83
            SBC     HL,DE
            POP     HL
            JP      NC,L7C54
L7DCB:      INC     HL
L7DCC:      LD      (HL),000H
            LD      DE,L9E72
L7DD1:      LD      A,(DE)
            CP      030H
            JR      NZ,L7DD9            ; (+003H)
            INC     DE
            JR      L7DD1               ; (-008H)

L7DD9:      OR      A
            RET     NZ
            DEC     DE
            LD      A,030H
            LD      (DE),A
            RET     

L7DE0:      LD      HL,L9E6A
            LD      DE,L7DF1
            PUSH    BC
            LD      BC,L0006
            LDIR    
            POP     BC
            LD      DE,L9E6A
            RET     

L7DF1:      LD      SP,L2B45
            JR      NC,L7E2E            ; (+038H)
            NOP     
L7DF7:      LD      A,(DE)
            CP      07DH
            RET     Z
L7DFB:      CALL    L9153
            JR      C,L7E13             ; (+013H)
            INC     (IX+000H)
            PUSH    IX
            PUSH    BC
            CALL    L90B3
            POP     BC
            POP     IX
            LD      A,001H
            LD      (L7E35),A
            JR      L7DFB               ; (-018H)

L7E13:      INC     IX
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            LD      A,(L7E35)
            LD      B,A
            LD      A,(L7E34)
            ADD     A,B
            LD      (L7E34),A
            DB      LSRF
            DB      02BH
            DB      07EH
            DB      LSD0
            DB      018H
            DB      LSWF
L7E2B:      DB      07EH
            DB      0B7H
            DB      0C8H
L7E2E:      DB      ":4~",0FEH
            ADD     HL,BC
            RET     

L7E34:      NOP     
L7E35:      NOP     
L7E36:      NOP     
L7E37:      NOP     
            NOP     
L7E39:      NOP     
            NOP     
L7E3B:      NOP     
            NOP     
L7E3D:      LD      HL,(L7E3B)
            PUSH    DE
L7E41:      LD      A,(HL)
            OR      A
            JP      Z,0636AH
            CALL    L7EDF
            JR      Z,L7E50             ; (+005H)
            LD      (BC),A
            INC     BC
            INC     HL
            JR      L7E41               ; (-00fH)

L7E50:      EX      AF,AF'
            LD      A,(L9E9C)
            CP      003H
            JP      NZ,L7F08
            EX      AF,AF'
            CP      021H
            JP      Z,L7E67
            CP      026H
            JP      Z,L7E8E
            JP      0636DH

L7E67:      EX      (SP),HL
            PUSH    BC
            CALL    L8570
            OR      A
            LD      A,020H
            JR      Z,L7E72             ; (+001H)
            LD      A,(DE)
L7E72:      POP     BC
            LD      (BC),A
            INC     BC
L7E75:      POP     HL
            INC     HL
L7E77:      LD      A,(HL)
            OR      A
            JR      Z,L7E85             ; (+00aH)
            CALL    L7EDF
            JR      Z,L7E88             ; (+008H)
            LD      (BC),A
            INC     BC
            INC     HL
            JR      L7E77               ; (-00eH)

L7E85:      LD      HL,(L7E39)
L7E88:      LD      (L7E3B),HL
            XOR     A
            LD      (BC),A
            RET     

L7E8E:      LD      D,002H
L7E90:      INC     HL
            LD      A,(HL)
            CP      026H
            JR      Z,L7E9E             ; (+008H)
            INC     D
            CP      020H
            JR      Z,L7E90             ; (-00bH)
            JP      0636AH

L7E9E:      EX      (SP),HL
            LD      A,(HL)
            CP      D
            JR      C,L7EB8             ; (+015H)
            INC     HL
            CALL    INDRCT
            PUSH    BC
            LD      BC,(STRST)
            ADD     HL,BC
            POP     BC
L7EAE:      LD      A,(HL)
            LD      (BC),A
            INC     BC
            INC     HL
            DEC     D
            JR      NZ,L7EAE            ; (-007H)
            JP      L7E75

L7EB8:      LD      E,(HL)
            INC     HL
            CALL    INDRCT
            LD      A,E
            OR      A
            JR      Z,L7ED5             ; (+014H)
            PUSH    BC
            LD      BC,(STRST)
            ADD     HL,BC
            POP     BC
L7EC8:      LD      A,(HL)
            LD      (BC),A
            INC     BC
            INC     HL
            DEC     E
            JR      Z,L7ED9             ; (+00aH)
            DEC     D
            JR      NZ,L7EC8            ; (-00aH)
            JP      L7E75

L7ED5:      LD      A,020H
            LD      (BC),A
            INC     BC
L7ED9:      DEC     D
            JR      NZ,L7ED5            ; (-007H)
            JP      L7E75

L7EDF:      CALL    CHKACC
            INC     B
            LD      HL,L2326
            DEC     HL
            RET     Z
            LD      E,A
            CP      02AH
            JR      Z,L7F02             ; (+015H)
            CALL    L80DF
            JR      Z,L7F02             ; (+010H)
            CP      02EH
            LD      E,023H
            JR      Z,L7F02             ; (+00aH)
            CP      0C4H
            RET     NZ
            INC     HL
            LD      A,(HL)
            OR      A
            JP      Z,0636AH
            RET     

L7F02:      INC     HL
            LD      A,(HL)
            CP      E
            DEC     HL
            LD      A,(HL)
            RET     

L7F08:      XOR     A
            LD      (0804FH),A
            LD      (0809FH),A
            LD      (L8087),A
            LD      (08045H),A
            LD      (07FFFH),A
            LD      (0802CH),A
            LD      (0804AH),A
            LD      (07FF8H),A
            DEC     A
            LD      (07FF5H),A
            EX      AF,AF'
            LD      D,000H
            CP      023H
            JP      Z,L7F64
            CP      02AH
            JP      Z,L7F45
            CALL    L80DF
            JP      Z,L7F56
            CP      02EH
            JP      Z,L7F66
            CP      02BH
            JP      Z,L7F5F
            JP      0636DH

L7F45:      LD      A,001H
            LD      (0809FH),A
            INC     HL
            INC     D
            INC     HL
            INC     D
            LD      A,(HL)
            CALL    L80DF
            JR      NZ,L7F66            ; (+012H)
            JR      L7F58               ; (+002H)

L7F56:      INC     HL
            INC     D
L7F58:      INC     HL
            INC     D
            LD      (L8087),A
            JR      L7F66               ; (+007H)

L7F5F:      LD      A,001H
            LD      (0804FH),A
L7F64:      INC     HL
            INC     D
L7F66:      EX      DE,HL
            DEC     H
L7F68:      INC     H
            LD      A,(DE)
            INC     DE
            CP      023H
            JR      Z,L7F68             ; (-007H)
            CP      02CH
            JR      NZ,L7F7A            ; (+007H)
            LD      A,001H
            LD      (07FFFH),A
            JR      L7F68               ; (-012H)

L7F7A:      CP      02EH
            JR      Z,L7FA1             ; (+023H)
            CP      02DH
            JR      NZ,L7F8A            ; (+008H)
            LD      A,001H
            LD      (08045H),A
            INC     DE
            JR      L7F9A               ; (+010H)

L7F8A:      CP      02BH
            JR      NZ,L7F9A            ; (+00cH)
            LD      A,(0804FH)
            OR      A
            JR      NZ,L7F9A            ; (+006H)
            LD      A,001H
            LD      (0804AH),A
            INC     DE
L7F9A:      DEC     DE
            LD      A,H
            LD      (0802CH),A
            JR      L7FD4               ; (+033H)

L7FA1:      LD      A,H
            LD      (0802CH),A
            LD      H,0FFH
L7FA7:      INC     H
            LD      A,(DE)
            INC     DE
            CP      023H
            JR      Z,L7FA7             ; (-007H)
            CP      02DH
            JR      NZ,L7FBA            ; (+008H)
            LD      A,001H
            LD      (08045H),A
            INC     DE
            JR      L7FCA               ; (+010H)

L7FBA:      CP      02BH
            JR      NZ,L7FCA            ; (+00cH)
            LD      A,(0804FH)
            OR      A
            JR      NZ,L7FCA            ; (+006H)
            LD      A,001H
            LD      (0804AH),A
            INC     DE
L7FCA:      DEC     DE
            LD      A,H
            LD      (07FF5H),A
            JR      L7FD4               ; (+003H)

L7FD1:      POP     DE
            JR      L7FE6               ; (+012H)

L7FD4:      LD      H,004H
            PUSH    DE
L7FD7:      LD      A,(DE)
            INC     DE
            CP      05EH
            JR      NZ,L7FD1            ; (-00cH)
            DEC     H
            JR      NZ,L7FD7            ; (-009H)
            POP     AF
            LD      A,001H
            LD      (07FF8H),A
L7FE6:      POP     HL
            PUSH    DE
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            DEC     HL
            LD      (0807CH),A
            LD      A,(0802CH)
            LD      D,A
            LD      A,000H
            LD      E,A
            LD      A,000H
            PUSH    BC
            CALL    L80E5
            POP     BC
            LD      A,000H
            OR      A
            JR      Z,L8044             ; (+041H)
            PUSH    BC
            PUSH    DE
            LD      A,(0802CH)
            LD      L,A
            LD      H,000H
            ADD     HL,DE
            LD      DE,L9E6A
            LD      C,000H
            DEC     HL
L8012:      LD      B,003H
L8014:      LD      A,(HL)
            CP      020H
            JR      Z,L802B             ; (+012H)
            INC     C
            LD      (DE),A
            INC     DE
            DEC     HL
            DJNZ    L8014               ; (-00bH)
            LD      A,(HL)
            CP      020H
            JR      Z,L802B             ; (+007H)
            LD      A,02CH
            LD      (DE),A
            INC     DE
            INC     C
            JR      L8012               ; (-019H)

L802B:      LD      A,000H
            CP      C
            JP      C,06367H
            LD      B,C
            LD      L,A
            LD      H,000H
            POP     DE
            PUSH    DE
            ADD     HL,DE
            LD      DE,L9E6A
            DEC     HL
L803C:      LD      A,(DE)
            LD      (HL),A
            DEC     HL
            INC     DE
            DJNZ    L803C               ; (-006H)
            POP     DE
            POP     BC
L8044:      LD      A,000H
            OR      A
            JR      NZ,L8086            ; (+03dH)
            LD      A,000H
            OR      A
            JR      NZ,L8086            ; (+038H)
            LD      A,000H
            OR      A
            JR      NZ,L807B            ; (+028H)
            LD      A,(0807CH)
            RLCA    
            JR      NC,L8086            ; (+02dH)
            LD      A,(DE)
            CP      020H
            LD      H,02DH
            JR      Z,L8065             ; (+005H)
            CP      030H
            JP      NZ,06367H
L8065:      PUSH    DE
L8066:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L8066             ; (-006H)
            CP      030H
            JR      Z,L8066             ; (-00aH)
            OR      A
            JR      NZ,L8074            ; (+001H)
            DEC     DE
L8074:      DEC     DE
            DEC     DE
            LD      A,H
            LD      (DE),A
            POP     DE
            JR      L8086               ; (+00bH)

L807B:      LD      A,000H
            RLCA    
            LD      H,02BH
            JR      NC,L8065            ; (-01dH)
            LD      H,02DH
            JR      L8065               ; (-021H)

L8086:      DB      03EH
L8087:      NOP     
            OR      A
            JR      Z,L809E             ; (+013H)
            LD      A,(DE)
            CP      020H
            JR      NZ,L809E            ; (+00eH)
            PUSH    DE
L8091:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L8091             ; (-006H)
            DEC     DE
            DEC     DE
            LD      A,(L8087)
            LD      (DE),A
            POP     DE
L809E:      LD      A,000H
            OR      A
            JR      Z,L80B0             ; (+00dH)
            PUSH    DE
L80A4:      LD      A,(DE)
            CP      020H
            JR      NZ,L80AF            ; (+006H)
            LD      A,02AH
            LD      (DE),A
            INC     DE
            JR      L80A4               ; (-00bH)

L80AF:      POP     DE
L80B0:      LD      A,(DE)
            OR      A
            JR      Z,L80B9             ; (+005H)
            LD      (BC),A
            INC     BC
            INC     DE
            JR      L80B0               ; (-009H)

L80B9:      LD      A,(0804AH)
            OR      A
            JR      Z,L80CD             ; (+00eH)
            LD      A,(0807CH)
            RLCA    
            LD      A,02BH
L80C5:      JR      NC,L80C9            ; (+002H)
            LD      A,02DH
L80C9:      LD      (BC),A
            INC     BC
            JR      L80DB               ; (+00eH)

L80CD:      LD      A,(08045H)
            OR      A
            JR      Z,L80DB             ; (+008H)
            LD      A,(0807CH)
            RLCA    
            LD      A,020H
            JR      L80C5               ; (-016H)

L80DB:      POP     HL
            JP      L7E77

L80DF:      CP      0FBH
            RET     Z
            CP      024H
            RET     

L80E5:      OR      A
            JP      Z,L8170
            PUSH    DE
            LD      A,(HL)
            OR      A
            JR      Z,L812D             ; (+03fH)
            PUSH    HL
            LD      A,D
            LD      DE,L9EA5
            PUSH    AF
            CALL    L79C2
            POP     AF
            OR      A
            JR      Z,L8106             ; (+00bH)
            LD      B,A
            LD      HL,L9EA5
            JR      L8104               ; (+003H)

L8101:      CALL    L7BDD
L8104:      DJNZ    L8101               ; (-005H)
L8106:      POP     HL
            LD      B,000H
L8109:      LD      DE,L9EA5
            CALL    L7B7C
            JR      C,L8117             ; (+006H)
            CALL    L7B31
            INC     B
            JR      L8109               ; (-00eH)

L8117:      PUSH    HL
            LD      HL,L9EA5
            CALL    L7B31
            POP     HL
L811F:      LD      DE,L9EA5
            CALL    L7B7C
            JR      NC,L812D            ; (+006H)
            CALL    L7BDD
            DEC     B
            JR      L811F               ; (-00eH)

L812D:      POP     DE
            PUSH    BC
            CALL    L818A
            POP     BC
            PUSH    DE
            LD      A,(DE)
            CP      02EH
            JR      NZ,L814B            ; (+012H)
            LD      DE,L9E7A
            DEC     DE
            LD      A,(DE)
            CP      031H
            POP     DE
            PUSH    DE
            JR      NZ,L8167            ; (+023H)
            EX      DE,HL
            INC     HL
            LD      (HL),031H
            DEC     HL
            JR      L8165               ; (+01aH)

L814B:      LD      A,(DE)
            CP      031H
            JR      NZ,L8167            ; (+017H)
            EX      DE,HL
            INC     HL
            LD      A,(HL)
            DEC     HL
            CP      02EH
            LD      A,030H
            JR      Z,L815C             ; (+002H)
            LD      A,020H
L815C:      LD      (HL),A
L815D:      INC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L815D             ; (-006H)
            LD      (HL),031H
L8165:      EX      DE,HL
            INC     B
L8167:      LD      A,(DE)
            INC     DE
            OR      A
            JR      NZ,L8167            ; (-005H)
            DEC     DE
            JP      L7C8F

L8170:      PUSH    DE
            CALL    L818A
            POP     AF
            OR      A
            RET     NZ
            PUSH    HL
            LD      HL,L9E7A
            DEC     HL
            LD      A,030H
            CP      (HL)
L817F:      JP      NZ,06367H
            DEC     HL
            LD      A,020H
            CP      (HL)
            JR      NZ,L817F            ; (-009H)
            POP     HL
            RET     

L818A:      PUSH    DE
            CALL    L7CE0
            JP      C,06367H
            POP     HL
            PUSH    HL
            LD      H,000H
            INC     L
            JR      Z,L8199             ; (+001H)
            DEC     L
L8199:      LD      DE,L9E7B
            ADD     HL,DE
            LD      A,(HL)
            LD      (HL),000H
            LD      DE,03036H
            CP      035H
            JR      C,L81B6             ; (+00fH)
L81A7:      DEC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L81A7             ; (-006H)
            INC     A
            JP      Z,06367H
            LD      (HL),A
            CP      03AH
            JR      Z,081A1H             ; (-015H)
L81B6:      LD      HL,L11A3
            LD      DE,L2000
L81BC:      LD      (HL),D
            INC     HL
            DEC     E
            JR      NZ,L81BC            ; (-005H)
            POP     HL
            PUSH    HL
            LD      E,H
            LD      D,000H
            LD      HL,L11A4
            ADD     HL,DE
            PUSH    HL
            LD      HL,L9E71
            LD      (HL),020H
            INC     HL
            LD      D,007H
L81D3:      LD      A,(HL)
            CP      030H
            JR      NZ,L81DE            ; (+006H)
            LD      (HL),020H
            INC     HL
            DEC     D
            JR      NZ,L81D3            ; (-00bH)
L81DE:      POP     HL
            PUSH    HL
            LD      B,E
            LD      A,B
            OR      A
            JR      Z,L81FC             ; (+017H)
            LD      DE,L9E7A
L81E8:      DEC     HL
            DEC     DE
            LD      A,(DE)
            LD      (HL),A
            CP      020H
            JR      Z,L81FC             ; (+00cH)
            DJNZ    L81E8               ; (-00aH)
            DEC     DE
            LD      A,(DE)
            CP      020H
            JR      Z,L81FC             ; (+004H)
            INC     A
            JP      NZ,06367H
L81FC:      POP     HL
            POP     DE
            INC     E
            JR      Z,L8210             ; (+00fH)
            LD      B,E
            LD      DE,L9E7B
            LD      (HL),02EH
L8207:      INC     HL
            DEC     B
            JR      Z,L8210             ; (+005H)
            LD      A,(DE)
            INC     DE
            LD      (HL),A
            JR      L8207               ; (-009H)

L8210:      LD      (HL),000H
            LD      DE,L11A4
            RET     

L8216:      PUSH    DE
            PUSH    BC
            LD      C,000H
            DEC     DE
L821B:      INC     DE
L821C:      CALL    L839C
            OR      A
            JR      Z,L8253             ; (+031H)
            CP      0FFH
            JR      Z,L8257             ; (+031H)
            CP      080H
            JP      NC,L6364
            CP      020H
            JR      C,L821B             ; (-014H)
            LD      IX,L821C
            PUSH    IX
            CP      022H
            JR      Z,L8272             ; (+039H)
            CP      027H
            JR      Z,L8265             ; (+028H)
            CP      03FH
            JR      Z,L825E             ; (+01dH)
            CP      02EH
            JP      Z,L83BF
            CP      024H
            JP      Z,L83D9
            CALL    L79F6
            JR      C,L829A             ; (+04aH)
            JP      L83A6

L8253:      LD      (HL),A
            POP     BC
            POP     DE
            RET     

L8257:      LD      (HL),LSE4
            CALL    L827E
            JR      L821C               ; (-042H)

L825E:      LD      A,08FH
            CALL    L827D
            JR      L82D5               ; (+070H)

L8265:      LD      (HL),03AH
            CALL    L827E
            LD      (HL),027H
            CALL    L827F
            JP      L833C

L8272:      LD      (HL),A
            CALL    L827E
L8276:      LD      A,(DE)
            OR      A
            RET     Z
            CP      022H
            JR      NZ,L8272            ; (-00bH)
L827D:      LD      (HL),A
L827E:      INC     DE
L827F:      INC     HL
L8280:      INC     C
            RET     NZ
            JP      06379H

L8285:      POP     BC
            LD      A,(DE)
            CALL    L79FD
            JR      C,L827D             ; (-00fH)
L828C:      CALL    L827D
            LD      A,(DE)
            CP      024H
            JR      Z,L827D             ; (-017H)
            CALL    L79F6
            RET     C
            JR      L828C               ; (-00eH)

L829A:      PUSH    BC
            LD      BC,CTBL1
            CALL    L834B
            JR      NC,L82D1            ; (+02eH)
            LD      BC,GTABL
            CALL    L834B
            LD      C,0FEH
            JR      NC,L82B7            ; (+00aH)
            LD      BC,CTBL2
            CALL    L834B
            LD      C,0FFH
            JR      C,L8285             ; (-032H)
L82B7:      LD      (HL),C
            INC     HL
            LD      (HL),A
            POP     BC
            CALL    L8280
            CALL    L827F
            CP      0B4H
            RET     NZ
            CALL    L839C
            CP      03DH
            RET     NZ
            LD      (HL),SIOAD
            CALL    L827E
            JR      L8311               ; (+040H)

L82D1:      POP     BC
            CALL    L827F
L82D5:      CP      097H
            JR      Z,L833C             ; (+063H)
            CP      094H
            JR      Z,L833C             ; (+05fH)
            CP      0C2H
            JR      Z,L8332             ; (+051H)
            CP      LSE2
            JR      Z,L8311             ; (+02cH)
            CP      LSE0
            RET     NC
            PUSH    AF
            CALL    L839C
            CP      02FH
            JR      NZ,L82FD            ; (+00dH)
            LD      (HL),0FBH
            CALL    L827E
            CALL    L79BC
            CALL    L827D
            JR      L830D               ; (+010H)

L82FD:      CP      023H
            JR      NZ,L830D            ; (+00cH)
            CALL    L827D
            CALL    L79BC
            CALL    L79F6
            CALL    NC,L83A6
L830D:      POP     AF
            CP      08DH
            RET     NC
L8311:      CALL    L839C
            CP      022H
            JR      NZ,L831D            ; (+005H)
            CALL    L8272
            JR      L8311               ; (-00cH)

L831D:      CP      02CH
            RET     C
            CP      02FH
            JR      C,L832D             ; (+009H)
            CALL    L79F6
            RET     C
            CALL    L83D0
            JR      L8311               ; (-01cH)

L832D:      CALL    L827D
            JR      L8311               ; (-021H)

L8332:      DB      02BH
            LD      (HL),03AH
            INC     HL
            LD      (HL),A
            CALL    L827F
            JR      L8311               ; (-02bH)

L833C:      LD      A,(DE)
            CALL    L5966
            RET     Z
            CALL    L827D
            CP      022H
            CALL    Z,L8276
            JR      L833C               ; (-00fH)

L834B:      PUSH    HL
            PUSH    DE
            LD      H,B
            LD      L,C
            LD      B,07FH
L8351:      POP     DE
            PUSH    DE
            INC     B
            LD      A,(HL)
            CP      0FFH
            JR      NZ,L835D            ; (+004H)
            POP     DE
            POP     HL
            SCF     
            RET     

L835D:      CP      02EH
            JR      NZ,L836A            ; (+009H)
            INC     HL
            DEC     DE
            LD      A,(DE)
            INC     DE
            CALL    L79FD
            JR      NC,L8389            ; (+01fH)
L836A:      LD      A,(DE)
            CP      020H
            JR      NZ,L837B            ; (+00cH)
            LD      A,(HL)
            AND     07FH
            SUB     041H
            CP      01AH
            JR      C,L8389             ; (+011H)
            CALL    L79BB
L837B:      LD      C,(HL)
            INC     HL
            INC     DE
            CP      02EH
            JR      Z,L8391             ; (+00fH)
            SUB     C
            JR      Z,L836A             ; (-01bH)
            CP      080H
            JR      Z,L8397             ; (+00eH)
L8389:      DEC     HL
L838A:      BIT     7,(HL)
            INC     HL
            JR      Z,L838A             ; (-005H)
            JR      L8351               ; (-040H)

L8391:      LD      A,B
            CP      0E8H
            JR      NC,L8389            ; (-00dH)
            CCF     
L8397:      POP     HL
            POP     HL
            LD      (HL),B
            LD      A,B
            RET     

L839C:      LD      A,(DE)
            CP      020H
            RET     NZ
            LD      (HL),A
            CALL    L827E
            JR      L839C               ; (-00aH)

L83A6:      EX      AF,AF'
            PUSH    DE
            CALL    L79BB
            POP     DE
            CALL    L79F6
            JR      NC,L83BF            ; (+00eH)
            CP      02EH
            JR      Z,L83BF             ; (+00aH)
            CP      045H
            JR      Z,L83BF             ; (+006H)
            EX      AF,AF'
            SUB     02FH
            JP      L83BF

L83BF:      PUSH    BC
            LD      (HL),015H
            INC     HL
            PUSH    HL
            CALL    L7A0E
            POP     HL
            LD      BC,00005H
            ADD     HL,BC
            LD      A,006H
            JR      L83F3               ; (+023H)

L83D0:      PUSH    BC
            CALL    L8532
            LD      (HL),00BH
            INC     HL
            JR      L83ED               ; (+014H)

L83D9:      LD      (HL),A
            INC     DE
            LD      A,(DE)
            RST     018H
            DB      015H
            JP      C,L827F
            PUSH    BC
            LD      (HL),011H
            INC     HL
            PUSH    HL
            EX      DE,HL
            RST     018H
            DB      014H
            LD      B,D
            LD      C,E
            EX      DE,HL
            POP     HL
L83ED:      LD      A,003H
            LD      (HL),C
            INC     HL
            LD      (HL),B
            INC     HL
L83F3:      POP     BC
            ADD     A,C
            JP      C,06379H
            LD      C,A
L83F9:      DEC     DE
            LD      A,(DE)
            CP      020H
            JR      Z,L83F9             ; (-006H)
            INC     DE
            RET     

L8401:      PUSH    HL
            PUSH    DE
            PUSH    BC
            EXX     
            LD      B,000H
            EXX     
            LD      C,000H
L840A:      LD      A,(HL)
            OR      A
            JR      Z,L843E             ; (+030H)
            LD      BC,L840A
            PUSH    BC
            CP      027H
            JR      Z,L8458             ; (+042H)
            INC     HL
            LD      BC,CTBL1
            CP      020H
            JR      C,L8480             ; (+062H)
            CP      022H
            JR      Z,L8469             ; (+047H)
            CP      03AH
            JR      Z,L8476             ; (+050H)
            CP      097H
            JR      Z,L8454             ; (+02aH)
            CP      094H
            JR      Z,L8454             ; (+026H)
            CP      LSE4
            JR      Z,L8443             ; (+011H)
            CP      0FEH
            JR      NC,L8448            ; (+012H)
            CP      080H
            JP      NC,L84C4
            JP      L84E1

L843E:      LD      (DE),A
            POP     BC
            POP     DE
            POP     HL
            RET     

L8443:      LD      A,0FFH
            JP      L84E1

L8448:      LD      BC,CTBL2
            JR      NZ,L8450            ; (+003H)
            LD      BC,GTABL
L8450:      LD      A,(HL)
            INC     HL
            JR      L84C4               ; (+070H)

L8454:      CALL    L84C4
            RET     Z
L8458:      LD      A,(HL)
            CALL    L5966
            RET     Z
            CALL    L84E1
            LD      A,(HL)
            INC     HL
            CP      022H
            CALL    Z,L846C
            JR      L8458               ; (-011H)

L8469:      CALL    L84E1
L846C:      LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            CP      022H
            JR      NZ,L8469            ; (-00bH)
            JR      L84E1               ; (+06bH)

L8476:      LD      (DE),A
            LD      A,(HL)
            CP      0C2H
            RET     Z
            CP      027H
            RET     Z
            JR      L84E4               ; (+064H)

L8480:      CP      015H
            JR      Z,L84B4             ; (+030H)
            CP      00BH
            JR      NC,L848D            ; (+005H)
            DEC     A
            OR      030H
            JR      L84E1               ; (+054H)

L848D:      PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            PUSH    HL
            CP      012H
            JR      Z,L84A3             ; (+00cH)
            CP      00CH
            JR      C,L84A3             ; (+008H)
            JR      NZ,L84F0            ; (+053H)
            EX      DE,HL
            INC     HL
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L84A3:      EX      DE,HL
            CALL    L7998
            LD      B,D
            LD      C,E
            POP     HL
            POP     DE
L84AB:      LD      A,(BC)
            OR      A
            RET     Z
            CALL    L84E1
            INC     BC
            JR      L84AB               ; (-009H)

L84B4:      PUSH    HL
            PUSH    DE
            CALL    L7D4E
            LD      B,D
            LD      C,E
            POP     DE
            POP     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            JR      L84AB               ; (-019H)

L84C4:      CP      080H
            JR      Z,L84D2             ; (+00aH)
            EX      AF,AF'
L84C9:      LD      A,(BC)
            RLCA    
            INC     BC
            JR      NC,L84C9            ; (-005H)
            EX      AF,AF'
            DEC     A
            JR      L84C4               ; (-00eH)

L84D2:      LD      A,(BC)
            BIT     7,A
            JR      NZ,L84DF            ; (+008H)
            CP      02EH
            CALL    NZ,L84E1
            INC     BC
            JR      L84D2               ; (-00dH)

L84DF:      AND     07FH
L84E1:      LD      (DE),A
            OR      A
            RET     Z
L84E4:      INC     DE
            EXX     
            INC     B
            EXX     
            RET     NZ
            XOR     A
            LD      (DE),A
            DEC     DE
            EXX     
            DEC     B
            EXX     
            RET     

L84F0:      LD      A,024H
            EX      AF,AF'
            EX      DE,HL
            CALL    L8501
            LD      B,D
            LD      C,E
            POP     HL
            POP     DE
            EX      AF,AF'
            CALL    L84E1
            JR      L84AB               ; (-056H)

L8501:      LD      DE,L9E76
            PUSH    DE
            LD      A,H
            CALL    L851A
            LD      A,L
            CALL    L851A
            XOR     A
            LD      (DE),A
            POP     DE
            LD      B,003H
L8512:      LD      A,(DE)
            CP      030H
            RET     NZ
            INC     DE
            DJNZ    L8512               ; (-007H)
            RET     

L851A:      PUSH    AF
            RRCA    
            RRCA    
            RRCA    
            RRCA    
            AND     00FH
            CALL    L8527
            POP     AF
            AND     00FH
L8527:      ADD     A,030H
            CP      03AH
            JR      C,L852F             ; (+002H)
            ADD     A,007H
L852F:      LD      (DE),A
            INC     DE
            RET     

L8532:      PUSH    HL
            EX      DE,HL
            RST     018H
            DB      013H
            LD      B,D
            LD      C,E
            EX      DE,HL
            DB      LSE1
            DB      0C3H
            DB      0F9H
            DB      083H
L853D:      DB      LSRF
            LD      D,C
            ADD     A,L
L8540:      LD      A,D
            OR      A
            JP      NZ,0636AH
            LD      A,E
            RET     

L8547:      CALL    L858E
            DEC     DE
            DEC     DE
            DEC     DE
            DEC     DE
            DEC     DE
            JR      L8554               ; (+003H)

L8551:      CALL    L857C
L8554:      PUSH    AF
            PUSH    HL
            EX      DE,HL
            CALL    L903F
            CALL    L7BEA
            EX      DE,HL
            POP     HL
            POP     AF
            RET     

L8561:      CALL    L857C
            PUSH    AF
            CALL    L9036
            PUSH    HL
            EX      DE,HL
            CALL    L8570
            POP     HL
            POP     AF
            RET     

L8570:      LD      B,(HL)
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            EX      DE,HL
            LD      A,B
            RET     

L857C:      LD      DE,(VARED)
            LD      (TMPEND),DE
L8584:      LD      DE,(INTFAC)
            PUSH    DE
            CALL    L858E
            POP     DE
            RET     

L858E:      PUSH    DE
            LD      DE,(TMPEND)
            CALL    L8C08
            POP     DE
            CALL    L85B2
L859A:      CP      0EAH
            RET     NZ
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            CALL    L85B2
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    0959CH
            POP     HL
            POP     AF
            JR      L859A               ; (-018H)

L85B2:      CALL    L85CD
L85B5:      CP      0EBH
            RET     NZ
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            CALL    L85CD
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    09599H
            POP     HL
            POP     AF
            JR      L85B5               ; (-018H)

L85CD:      CALL    L85E8
L85D0:      CP      0ECH
            RET     NZ
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            CALL    L85E8
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L9596
            POP     HL
            POP     AF
            JR      L85D0               ; (-018H)

L85E8:      CALL    TEST1
            DB      0EDH
            JR      NZ,L85FD            ; (+00fH)
            CALL    L85FD
            PUSH    AF
            PUSH    HL
            LD      HL,0FFFBH
            ADD     HL,DE
            CALL    L9586
            POP     HL
            POP     AF
            RET     

L85FD:      CALL    L8667
L8600:      CP      0EEH
            RET     C
            PUSH    AF
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            CALL    L8667
            POP     BC
            EX      (SP),HL
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L9153
            EX      AF,AF'
            POP     AF
            CP      0F6H
            JR      NZ,L863A            ; (+01eH)
            EX      AF,AF'
            JR      C,L8635             ; (+016H)
L861F:      LD      BC,L0000
L8622:      LD      (HL),C
            INC     HL
            LD      (HL),B
            INC     HL
            XOR     A
            LD      (HL),A
            INC     HL
            LD      (HL),A
            INC     HL
            LD      (HL),A
            LD      A,005H
            LD      (L9E9C),A
            POP     AF
            POP     HL
            JR      L8600               ; (-035H)

L8635:      LD      BC,08081H
            JR      L8622               ; (-018H)

L863A:      CP      SIOBD
            JR      NZ,L8645            ; (+007H)
            EX      AF,AF'
            JR      Z,L861F             ; (-022H)
            JR      C,L861F             ; (-024H)
            JR      L8635               ; (-010H)

L8645:      CP      SIOAD
            JR      NZ,L864E            ; (+005H)
            EX      AF,AF'
            JR      Z,L8635             ; (-017H)
            JR      L861F               ; (-02fH)

L864E:      CP      PSGA
            JR      C,L8657             ; (+005H)
            EX      AF,AF'
            JR      NC,L8635            ; (-020H)
            JR      L861F               ; (-038H)

L8657:      CP      LSPAL
            JR      C,L8662             ; (+007H)
            EX      AF,AF'
            JR      Z,L8635             ; (-029H)
            JR      C,L8635             ; (-02bH)
            JR      L861F               ; (-043H)

L8662:      EX      AF,AF'
            JR      Z,L861F             ; (-046H)
            JR      L8635               ; (-032H)

L8667:      CALL    L8692
L866A:      CP      SIOBC
            RET     C
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            JR      Z,L8684             ; (+010H)
            CALL    L8692
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L90B3
L8680:      POP     HL
            POP     AF
            JR      L866A               ; (-01aH)

L8684:      CALL    L8692
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L90BC
            JR      L8680               ; (-012H)

L8692:      CALL    L86BD
L8695:      CP      0F9H
            RET     C
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            JR      Z,L86AF             ; (+010H)
            CALL    L86BD
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L95F2
L86AB:      POP     HL
            POP     AF
            JR      L8695               ; (-01aH)

L86AF:      CALL    L86BD
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L9611
            JR      L86AB               ; (-012H)

L86BD:      CALL    L86E8
L86C0:      CP      0FBH
            RET     C
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            JR      Z,L86DA             ; (+010H)
            CALL    L86E8
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L92EA
L86D6:      POP     HL
            POP     AF
            JR      L86C0               ; (-01aH)

L86DA:      CALL    L86E8
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L93D5
            JR      L86D6               ; (-012H)

L86E8:      CALL    TEST1
            DB      SIOBC
            JR      Z,L86E8             ; (-006H)
            CP      0F8H
            JR      NZ,L86F8            ; (+006H)
            INC     HL
            CALL    L86F8
            JR      L8721               ; (+029H)

L86F8:      CALL    L872D
L86FB:      CP      0FDH
            RET     NZ
            LD      A,(L9E9C)
            PUSH    AF
            INC     HL
            CALL    L8713
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L8BE5
            CALL    L950A
            POP     HL
            POP     AF
            JR      L86FB               ; (-018H)

L8713:      CALL    TEST1
            DB      SIOBC
            JR      Z,L8713             ; (-006H)
            CP      0F8H
            JR      NZ,L872D            ; (+010H)
            INC     HL
            CALL    L872D
L8721:      PUSH    AF
            PUSH    HL
            LD      HL,0FFFBH
            ADD     HL,DE
            CALL    L90A6
            POP     HL
            POP     AF
            RET     

L872D:      CALL    L5963
            JP      Z,L6364
            CALL    L8739
            JP      HLFTCH

L8739:      PUSH    HL
            LD      HL,(L107E)
            SCF     
            SBC     HL,DE
            JP      C,06373H
            POP     HL
            CP      LSE4
            JR      Z,L8756             ; (+00eH)
            CP      020H
            JR      NC,L8796            ; (+04aH)
L874C:      INC     HL
            CP      015H
            JR      C,L8765             ; (+014H)
            CALL    L79C5
            JR      L875F               ; (+009H)

L8756:      INC     HL
            PUSH    HL
            LD      HL,L98C6
            CALL    L79C5
            POP     HL
L875F:      LD      A,005H
L8761:      LD      (L9E9C),A
            RET     

L8765:      CP      00BH
            JR      NC,L8772            ; (+009H)
            DEC     A
            JP      M,L6364
            LD      B,000H
            LD      C,A
            JR      L8783               ; (+011H)

L8772:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            INC     HL
            CP      00CH
            JR      NZ,L8783            ; (+009H)
            INC     BC
            INC     BC
            LD      A,(BC)
            INC     BC
            EX      AF,AF'
            LD      A,(BC)
            LD      B,A
            EX      AF,AF'
            LD      C,A
L8783:      PUSH    HL
            PUSH    DE
            EX      DE,HL
            LD      E,C
            LD      D,B
            CALL    L79CB
            POP     DE
            POP     HL
            LD      A,005H
L878F:      INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            JR      L8761               ; (-035H)

L8796:      CP      022H
            JR      NZ,L87C9            ; (+02fH)
            INC     HL
            PUSH    HL
            CALL    L8BF0
            EX      (SP),HL
            PUSH    HL
            LD      HL,(L107A)
            PUSH    BC
            LD      BC,(STRST)
            OR      A
            SBC     HL,BC
            POP     BC
            EX      DE,HL
            LD      (HL),B
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            INC     HL
            INC     HL
            POP     DE
            PUSH    HL
            LD      HL,(L107A)
            CALL    L8BFC
            LD      (L107A),HL
            POP     DE
            POP     HL
            LD      A,003H
            LD      (L9E9C),A
            RET     

L87C9:      CP      028H
            JR      NZ,L87D4            ; (+007H)
            INC     HL
            CALL    L858E
            JP      L79AD

L87D4:      OR      A
            JP      P,L8E15
            CP      0E7H
            INC     HL
            JR      NZ,L87E4            ; (+007H)
            LD      B,005H
            LD      A,0A8H
            PUSH    AF
            JR      L8813               ; (+02fH)

L87E4:      CP      0FFH
            JP      NZ,L6364
            LD      A,(HL)
            INC     HL
            CP      0A0H
            JP      Z,L889F
            CP      0C8H
            JP      NC,L6364
            CP      0BAH
            JR      NC,L8843            ; (+04aH)
            CP      09CH
            JR      Z,L8843             ; (+046H)
            CP      09DH
            JP      Z,L8843
            PUSH    AF
            CP      0B3H
            JR      NC,L8834            ; (+02dH)
            LD      B,003H
            CP      0ABH
            JR      NC,L8813            ; (+006H)
            LD      B,005H
            CP      088H
            JR      Z,L882E             ; (+01bH)
L8813:      CALL    L79A3
L8816:      PUSH    BC
            CALL    L858E
            CALL    L79AD
            POP     AF
            CALL    L9032
L8821:      POP     AF
            PUSH    DE
            PUSH    HL
            LD      HL,0FFFBH
            ADD     HL,DE
            CALL    L8843
            POP     HL
            POP     DE
            RET     

L882E:      CALL    TEST1
            DB      028H
            JR      Z,L8816             ; (-01eH)
L8834:      LD      A,005H
            LD      (L9E9C),A
            PUSH    HL
            LD      HL,L7C45
            CALL    L79C5
            POP     HL
            JR      L8821               ; (-022H)

L8843:      PUSH    HL
            ADD     A,A
            LD      L,A
            LD      H,000H
            LD      BC,L5D79
            ADD     HL,BC
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            EX      (SP),HL
            RET     

L8852:      EX      DE,HL
            LD      HL,0FDF1H
            ADD     HL,SP
            LD      BC,(TMPEND)
            OR      A
            SBC     HL,BC
            EX      DE,HL
            JR      NC,L8880            ; (+01fH)
            XOR     A
            JR      L887D               ; (+019H)

L8864:      LD      A,(L1082)
            JR      L887D               ; (+014H)

L8869:      LD      A,(01083H)
            JR      L887D               ; (+00fH)

L886E:      LD      DE,(POINTX)
            JR      L8880               ; (+00cH)

L8874:      LD      DE,(POINTY)
            JR      L8880               ; (+006H)

L887A:      LD      A,(L9E53)
L887D:      LD      E,A
            LD      D,000H
L8880:      LD      A,005H
            LD      (L9E9C),A
            JP      L79CB

L8888:      LD      DE,(09E55H)
            CALL    L79CB
            INC     HL
            BIT     7,(HL)
            DEC     HL
            RET     Z
            LD      DE,L889A
            JP      L90BC

L889A:      SUB     C
            NOP     
            NOP     
            NOP     
            NOP     
L889F:      CALL    L79A3
            LD      B,000H
L88A4:      PUSH    BC
            PUSH    DE
            CALL    L8547
            CALL    L8540
            POP     DE
            POP     BC
            PUSH    AF
            INC     B
            CALL    TEST1
            DB      02CH
            JR      Z,L88A4             ; (-012H)
            CALL    L79AD
            LD      A,B
            EXX     
            LD      B,A
            LD      HL,(L107A)
            CALL    ADDHLA
            LD      D,H
            LD      E,L
            CALL    L8C08
L88C7:      DEC     HL
            POP     AF
            LD      (HL),A
            DJNZ    L88C7               ; (-005H)
            EXX     
            LD      A,B
            EXX     
            LD      B,A
L88D0:      LD      (TMPEND),DE
            LD      DE,(STRST)
            OR      A
            SBC     HL,DE
            PUSH    HL
            LD      A,B
            EXX     
            EX      DE,HL
            LD      (HL),A
            INC     HL
            POP     BC
            LD      (HL),C
            INC     HL
            LD      (HL),B
            LD      BC,L0003
            ADD     HL,BC
L88E9:      EX      DE,HL
            LD      A,003H
            LD      (L9E9C),A
            RET     

L88F0:      PUSH    HL
            CALL    L7BEA
            CALL    L8501
            RST     018H
            DB      017H
L88F9:      LD      A,B
            OR      A
            JR      Z,L890D             ; (+010H)
            LD      HL,(L107A)
            PUSH    HL
            PUSH    BC
            CALL    L8BFC
            POP     BC
            EX      DE,HL
            POP     HL
            EXX     
            POP     DE
            EXX     
            JR      L88D0               ; (-03dH)

L890D:      POP     HL
            CALL    L909E
            JR      L88E9               ; (-02aH)

L8913:      PUSH    HL
            CALL    L8924
            LD      B,A
            LD      C,A
            OR      A
            LD      A,020H
            PUSH    DE
            CALL    NZ,?SETDE
            POP     DE
            LD      B,C
            JR      L88F9               ; (-02bH)

L8924:      CALL    L7BEA
            LD      DE,L11A4
            LD      A,H
            OR      A
            JP      NZ,0636AH
            LD      A,L
            RET     

L8931:      PUSH    HL
            CALL    L7B5B
            LD      A,(DE)
            CP      020H
            JR      NZ,L893B            ; (+001H)
            INC     DE
L893B:      RST     018H
            DB      017H
            JR      L88F9               ; (-046H)

L893F:      CALL    L79A3
            CALL    L6EF9
            LD      B,A
            CALL    L79AA
            LD      A,B
            PUSH    HL
            PUSH    DE
            RST     018H
            DB      029H
            LD      DE,0FFFFH
            JR      C,L895B             ; (+008H)
            INC     HL
            BIT     7,(HL)
            JR      NZ,L895B            ; (+003H)
            LD      DE,L0000
L895B:      POP     HL
            CALL    L79CB
            LD      A,005H
            LD      (L9E9C),A
L8964:      INC     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            EX      DE,HL
            POP     HL
            RET     

L896C:      CALL    L79A3
            PUSH    DE
            CALL    L8547
            LD      B,D
            LD      C,E
            POP     DE
            PUSH    DE
            PUSH    BC
            CALL    L79B4
            CALL    L8547
            CALL    L79AD
            EX      (SP),HL
            EX      DE,HL
            RST     018H
            DB      04EH
            INC     A
            JP      Z,0636AH
            DEC     A
            POP     DE
            POP     HL
            PUSH    DE
            CALL    L887D
            JR      L8964               ; (-02eH)

L8992:      PUSH    HL
            CALL    L8570
            OR      A
            JR      Z,L899A             ; (+001H)
            LD      A,(DE)
L899A:      JR      L89A0               ; (+004H)

L899C:      PUSH    HL
            CALL    L8570
L89A0:      POP     HL
            JP      L887D

L89A4:      PUSH    HL
            CALL    L8570
            LD      HL,(L107A)
            PUSH    HL
            CALL    L8BFC
            LD      (HL),000H
            POP     DE
            POP     HL
            JP      L7A0E

L89B6:      CALL    L8A32
            CALL    L79AD
            CALL    L8A2B
            EX      DE,HL
            LD      A,(HL)
            CP      C
            JR      NC,L89C5            ; (+001H)
            LD      C,A
L89C5:      LD      (HL),C
            LD      BC,00005H
L89C9:      LD      A,003H
            ADD     HL,BC
            EX      DE,HL
            LD      (L9E9C),A
            JP      HLFTCH

L89D3:      CALL    L8A32
            CALL    L79AD
            CALL    L8A2B
            EX      DE,HL
            LD      A,(HL)
            SUB     C
            JR      NC,L89E3            ; (+002H)
            XOR     A
            LD      C,(HL)
L89E3:      LD      (HL),C
            INC     HL
            ADD     A,(HL)
            LD      (HL),A
            INC     HL
            JR      NC,L89EB            ; (+001H)
            INC     (HL)
L89EB:      LD      BC,L0003
            JR      L89C9               ; (-027H)

L89F0:      CALL    L8A32
            CALL    L8A2B
            OR      A
            JP      Z,0636AH
            PUSH    AF
            CALL    TEST1
            DB      029H
            LD      A,0FFH
            JR      Z,L8A17             ; (+014H)
            CALL    L79B1
            PUSH    DE
            EX      DE,HL
            LD      BC,00005H
            ADD     HL,BC
            EX      DE,HL
            CALL    L8547
            CALL    L79AD
            CALL    L8540
            POP     DE
L8A17:      POP     BC
            LD      C,A
            EX      DE,HL
            LD      A,(HL)
            SUB     B
            JR      C,L8A27             ; (+009H)
            INC     A
            CP      C
            JR      NC,L8A23            ; (+001H)
            LD      C,A
L8A23:      LD      A,B
            DEC     A
            JR      L89E3               ; (-044H)

L8A27:      XOR     A
            LD      C,A
            JR      L89E3               ; (-048H)

L8A2B:      LD      A,B
            OR      A
            JP      NZ,0636AH
            LD      A,C
            RET     

L8A32:      CALL    L79A3
            PUSH    DE
            CALL    L858E
            CALL    L79B4
            CALL    L9036
            CALL    L8547
            LD      C,E
            LD      B,D
            POP     DE
            RET     

L8A46:      PUSH    HL
            PUSH    DE
            LD      HL,(L107A)
            PUSH    HL
            LD      A,030H
            LD      B,006H
            CALL    ?SETHL
            RST     018H
            DB      025H
            POP     HL
            OR      A
            JR      Z,L8A5E             ; (+005H)
            INC     (HL)
            INC     HL
            INC     (HL)
            INC     (HL)
            DEC     HL
L8A5E:      EX      DE,HL
            LD      BC,08CA0H
            CALL    L8AD5
            LD      BC,L0E10
            CALL    L8AD5
            CP      03AH
            JR      C,L8A79             ; (+00aH)
            SUB     00AH
            DEC     DE
            LD      (DE),A
            DEC     DE
            LD      A,(DE)
            INC     A
            LD      (DE),A
            INC     DE
            INC     DE
L8A79:      DEC     DE
            DEC     DE
            LD      A,(DE)
            INC     DE
            LD      B,A
            LD      A,(DE)
            INC     DE
            LD      C,A
            LD      A,B
            CP      032H
            JR      NZ,L8A97            ; (+011H)
            LD      A,C
            CP      034H
            JR      NZ,L8A97            ; (+00cH)
            LD      HL,(L107A)
            LD      A,030H
            LD      B,006H
            CALL    ?SETHL
            JR      L8AAD               ; (+016H)

L8A97:      LD      BC,L0258
            CALL    L8AD5
            LD      BC,0003CH
            CALL    L8AD5
            LD      BC,0000AH
            CALL    L8AD5
            LD      A,030H
            ADD     A,L
            LD      (DE),A
L8AAD:      LD      HL,(L107A)
            LD      DE,L0006
            EX      DE,HL
            ADD     HL,DE
            LD      (L107A),HL
            EX      DE,HL
            LD      DE,(STRST)
            OR      A
            SBC     HL,DE
            EX      DE,HL
            POP     HL
            LD      (HL),006H
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            INC     HL
            INC     HL
            EX      DE,HL
            POP     HL
            LD      A,003H
            LD      (L9E9C),A
            JP      HLFTCH

L8AD5:      OR      A
            SBC     HL,BC
            JR      C,L8ADF             ; (+005H)
            LD      A,(DE)
            INC     A
            LD      (DE),A
            JR      L8AD5               ; (-00aH)

L8ADF:      ADD     HL,BC
            INC     DE
            RET     

L8AE2:      CALL    TESTX
            DB      SIOAD
            CALL    L8561
            LD      A,B
            CP      006H
            JP      NZ,0636AH
            PUSH    HL
            PUSH    DE
            LD      HL,L0000
            CALL    L8B23
            CP      018H
            JP      NC,0636AH
            CP      00CH
            LD      A,000H
            JR      C,L8B0B             ; (+009H)
            PUSH    DE
            LD      DE,L000C
            OR      A
            SBC     HL,DE
            POP     DE
            INC     A
L8B0B:      PUSH    AF
            CALL    L8B23
            CP      03CH
            JP      NC,0636AH
            CALL    L8B23
            CP      03CH
            JP      NC,0636AH
            POP     AF
            EX      DE,HL
            RST     018H
            DB      026H
            POP     DE
            POP     HL
            RET     

L8B23:      PUSH    DE
            LD      D,H
            LD      E,L
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,DE
            LD      D,H
            LD      E,L
            ADD     HL,HL
            ADD     HL,DE
            ADD     HL,HL
            ADD     HL,HL
            POP     DE
            LD      A,(DE)
            INC     DE
            SUB     030H
            JP      C,0636AH
            CP      00AH
            JP      NC,0636AH
            PUSH    BC
            LD      C,A
            ADD     A,A
            ADD     A,A
            ADD     A,C
            ADD     A,A
            LD      C,A
            LD      A,(DE)
            INC     DE
            SUB     030H
            JP      C,0636AH
            CP      00AH
            JP      NC,0636AH
            ADD     A,C
            LD      C,A
            LD      B,000H
            ADD     HL,BC
            POP     BC
            RET     

L8B56:      LD      DE,(VARED)
            LD      (TMPEND),DE
            LD      DE,(INTFAC)
L8B62:      PUSH    DE
            CALL    L8BB5
L8B66:      LD      A,(HL)
            CP      028H
            JP      Z,L8C1B
            PUSH    HL
            CALL    L8ED6
            JR      NC,L8B78            ; (+006H)
            LD      A,C
            LD      C,L
            LD      B,H
            POP     HL
            POP     DE
            RET     

L8B78:      LD      A,(DE)
            ADD     A,C
            ADD     A,002H
            PUSH    BC
            EX      DE,HL
            LD      HL,(L107A)
            PUSH    HL
            OR      A
            SBC     HL,DE
            INC     HL
            LD      C,L
            LD      B,H
            POP     HL
            PUSH    DE
            EX      DE,HL
            LD      L,A
            LD      H,000H
            ADD     HL,DE
            EX      DE,HL
            CALL    L8C08
            LDDR    
            LD      E,A
            LD      D,000H
            RST     018H
            DB      01AH
            POP     HL
            POP     BC
            LD      DE,L11A4
            LD      (HL),C
            INC     HL
            SCF     
            SBC     A,C
            LD      B,A
L8BA4:      LD      A,(DE)
            LD      (HL),A
            INC     DE
            INC     HL
            DJNZ    L8BA4               ; (-006H)
            PUSH    HL
            LD      B,C
            CALL    ?CLRHL
            LD      (HL),A
            LD      A,C
            POP     BC
            POP     HL
            POP     DE
            RET     

L8BB5:      CALL    HLFTCH
            SUB     041H
            CP      01AH
            JP      NC,L6364
            LD      DE,L11A4
            LD      B,000H
L8BC4:      INC     DE
            LD      A,(HL)
            CALL    L79FD
            JR      C,L8BD6             ; (+00bH)
            LD      (DE),A
            INC     B
            LD      A,B
            CP      003H
            JR      C,L8BD3             ; (+001H)
            DEC     B
L8BD3:      INC     HL
            JR      L8BC4               ; (-012H)

L8BD6:      LD      DE,L11A4
            EX      DE,HL
            LD      (HL),B
            EX      DE,HL
            LD      C,005H
            CP      024H
            RET     NZ
            LD      C,003H
            INC     HL
            RET     

L8BE5:      LD      HL,0FFFBH
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            ADD     HL,DE
            LD      A,B
            JP      L9032

L8BF0:      LD      B,0FFH
L8BF2:      INC     B
            LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            CP      022H
            RET     Z
            JR      L8BF2               ; (-00aH)

L8BFC:      LD      A,B
            OR      A
            RET     Z
            CALL    LDHLDE
            EX      DE,HL
            CALL    L8C08
            EX      DE,HL
            RET     

L8C08:      PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            SBC     HL,DE
            POP     HL
            RET     NC
            JP      L63A7

L8C14:      LD      DE,(INTFAC)
            PUSH    DE
            JR      L8C23               ; (+008H)

L8C1B:      XOR     A
            LD      (L8E14),A
            INC     HL
            LD      (L8E12),HL
L8C23:      LD      B,000H
            EXX     
            POP     HL
            PUSH    HL
            PUSH    HL
            LD      HL,(L107A)
            LD      DE,L11A4
            PUSH    HL
            LD      A,(DE)
            LD      (HL),A
            INC     DE
            INC     HL
            LD      B,A
            CALL    L8BFC
            POP     DE
            LD      (L107A),HL
            LD      HL,(L1076)
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      (SP),HL
            PUSH    HL
            EXX     
L8C46:      POP     DE
            PUSH    DE
            PUSH    BC
            LD      BC,(08E12H)
            LD      A,(L8E14)
            PUSH    BC
            PUSH    AF
            LD      BC,(09E6AH)
            PUSH    BC
            CALL    L8547
            BIT     7,D
            JP      NZ,0636AH
            EX      AF,AF'
            POP     BC
            LD      (09E6AH),BC
            POP     AF
            LD      (L8E14),A
            POP     BC
            LD      (08E12H),BC
            EX      AF,AF'
            INC     HL
            CP      029H
            JR      Z,L8C8C             ; (+018H)
            CP      02CH
            JP      NZ,L6364
            POP     BC
            INC     B
            LD      A,B
            CP      004H
            JP      NC,0636AH
            EXX     
            POP     HL
            POP     DE
            EXX     
            PUSH    DE
            EXX     
            PUSH    DE
            PUSH    HL
            EXX     
            JR      L8C46               ; (-046H)

L8C8C:      POP     BC
            EXX     
            POP     HL
            POP     DE
            EXX     
            INC     B
            PUSH    DE
            PUSH    HL
            EXX     
            LD      HL,(L1076)
            ADD     HL,DE
            LD      B,(HL)
            INC     B
            LD      DE,L11A4
            CALL    LDDEHL
            EXX     
            SET     7,C
            CALL    L8ED6
            RES     7,C
            JR      NC,L8D01            ; (+056H)
            LD      A,B
            CP      (HL)
            JP      NZ,06376H
            INC     HL
            EX      DE,HL
            POP     HL
            LD      (L9E6A),HL
            EXX     
            LD      HL,L0000
            EXX     
            EX      DE,HL
L8CBC:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            EX      (SP),HL
            PUSH    DE
            EXX     
            POP     DE
            CALL    L8DE8
            EXX     
            PUSH    HL
            OR      A
            SBC     HL,DE
            JP      NC,0636AH
            EXX     
            POP     DE
            CALL    L8DE4
            EXX     
            POP     HL
            DJNZ    L8CBC               ; (-01cH)
            PUSH    HL
            EXX     
            LD      A,C
            LD      D,B
            BIT     6,A
            JR      NZ,L8CF4            ; (+014H)
            AND     00FH
            LD      E,A
            PUSH    AF
            CALL    L8DE8
            PUSH    HL
            EXX     
            POP     BC
            POP     AF
            POP     HL
            ADD     HL,BC
            LD      C,L
            LD      B,H
L8CEF:      LD      HL,(L9E6A)
            POP     DE
            RET     

L8CF4:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            POP     HL
            LD      C,L
            LD      B,H
            LD      (HL),E
            INC     HL
            LD      (HL),D
            AND     00FH
            JR      L8CEF               ; (-012H)

L8D01:      EXX     
            LD      A,(L8E14)
            OR      A
            JP      Z,0636AH
            POP     HL
            LD      (L9E6A),HL
            EXX     
            LD      DE,(TMPEND)
            LD      L,B
            LD      H,000H
            ADD     HL,HL
            ADD     HL,DE
            EX      DE,HL
            INC     DE
            CALL    L8C08
            LD      (HL),B
            INC     HL
            EXX     
            LD      HL,00001H
            EXX     
L8D23:      POP     DE
            LD      A,(L8E14)
            OR      A
            JR      NZ,L8D36            ; (+00cH)
            PUSH    HL
            EX      DE,HL
            LD      DE,0000AH
            SCF     
            SBC     HL,DE
            JP      NC,0636AH
            POP     HL
L8D36:      INC     DE
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            PUSH    DE
            EXX     
            POP     DE
            CALL    L8DE8
            EXX     
            DJNZ    L8D23               ; (-021H)
            DB      059H
            LD      D,000H
            PUSH    BC
            PUSH    DE
            EXX     
            POP     DE
            CALL    L8DE8
            PUSH    HL
            EXX     
            POP     BC
            PUSH    BC
            EX      DE,HL
            LD      HL,(L107A)
            LD      L,(HL)
            LD      H,000H
            ADD     HL,HL
            LD      A,(L11A4)
            ADD     A,005H
            ADD     A,L
            LD      L,A
            LD      A,000H
            ADC     A,H
            LD      H,A
            JR      C,L8D6C             ; (+005H)
            ADD     HL,BC
            JR      C,L8D6C             ; (+002H)
            PUSH    HL
            ADD     HL,DE
L8D6C:      JP      C,L63A7
            EX      DE,HL
            CALL    L8C08
            PUSH    HL
            EXX     
            POP     HL
            LD      BC,(STRST)
            DEC     BC
            OR      A
            SBC     HL,BC
            PUSH    HL
            EXX     
            POP     BC
            LDDR    
            POP     DE
            RST     018H
            DB      01AH
            POP     BC
            PUSH    DE
            EXX     
            POP     DE
            LD      H,B
            LD      L,C
            POP     BC
            LD      A,C
            OR      080H
            LD      (HL),A
            INC     HL
            DEC     DE
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            LD      DE,L11A4
            LD      A,(DE)
            INC     A
            LD      B,A
            CALL    LDHLDE
            LD      DE,(TMPEND)
            LD      A,(DE)
            LD      (HL),A
            INC     HL
            INC     DE
            ADD     A,A
            LD      B,A
            CALL    LDHLDE
            PUSH    HL
            EXX     
            POP     HL
L8DB0:      XOR     A
            LD      (HL),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L8DB0            ; (-008H)
            LD      (HL),A
            EXX     
            POP     DE
            LD      A,(L8E14)
            OR      A
            JR      Z,L8DC5             ; (+004H)
            LD      HL,(L9E6A)
            RET     

L8DC5:      LD      HL,(L8E12)
            PUSH    DE
            JP      L8C23

L8DCC:      LD      A,0FFH
            LD      (L8E14),A
L8DD1:      CALL    L8BB5
            LD      A,(HL)
            CALL    L79A6
            CALL    L8C14
            CALL    HLFTCH
            CP      02CH
            RET     NZ
            INC     HL
            JR      L8DD1               ; (-013H)

L8DE4:      ADD     HL,DE
            RET     NC
            JR      L8E0F               ; (+027H)

L8DE8:      PUSH    BC
            EX      DE,HL
            LD      C,L
            LD      A,H
            LD      HL,L0000
            CALL    L8DF8
            LD      A,C
            CALL    L8DF8
            POP     BC
            RET     

L8DF8:      OR      A
            JR      Z,L8E09             ; (+00eH)
            LD      B,008H
L8DFD:      ADD     HL,HL
            JR      C,L8E0F             ; (+00fH)
            RLCA    
            JR      NC,L8E06            ; (+003H)
            ADD     HL,DE
            JR      C,L8E0F             ; (+009H)
L8E06:      DJNZ    L8DFD               ; (-00bH)
            RET     

L8E09:      LD      A,H
            LD      H,L
            LD      L,000H
            OR      A
            RET     Z
L8E0F:      JP      06373H

L8E12:      NOP     
            NOP     
L8E14:      NOP     
L8E15:      SUB     041H
            CP      01AH
            JP      NC,L6364
            LD      BC,(09048H)
            LD      A,B
            OR      C
            JR      NZ,L8E36            ; (+012H)
            CALL    L8B62
L8E27:      PUSH    DE
            PUSH    HL
            LD      L,C
            LD      H,B
            LD      B,A
            LD      C,A
            CALL    LDDEHL
            POP     HL
            LD      A,C
            POP     DE
            JP      L878F

L8E36:      PUSH    DE
            CALL    L8BB5
            PUSH    HL
            INC     B
            LD      DE,L11A4
            LD      HL,(L107A)
            CALL    L8BFC
            LD      B,000H
            LD      HL,(L9048)
            CALL    HLFTCH
            CP      SIOAD
            JR      Z,L8E80             ; (+02fH)
            CP      028H
            JR      NZ,L8E7D            ; (+028H)
L8E55:      INC     HL
            INC     B
            PUSH    BC
            CALL    L8BB5
            LD      A,C
            POP     DE
            CP      E
            LD      C,E
            JR      NZ,L8E72            ; (+011H)
            PUSH    DE
            LD      C,B
            INC     C
            PUSH    HL
            LD      HL,(L107A)
            LD      DE,L11A4
            CALL    L904C
            POP     HL
            POP     BC
            JR      Z,L8E96             ; (+024H)
L8E72:      CALL    HLFTCH
            CP      029H
            JR      Z,L8E80             ; (+007H)
            CP      02CH
            JR      Z,L8E55             ; (-028H)
L8E7D:      JP      L6364

L8E80:      LD      HL,(L107A)
            LD      DE,L11A4
            LD      A,(HL)
            LD      (DE),A
            LD      B,A
L8E89:      INC     HL
            INC     DE
            LD      A,(HL)
            LD      (DE),A
            DJNZ    L8E89               ; (-006H)
            POP     HL
            POP     DE
            CALL    L8ED2
            JR      L8E27               ; (-06fH)

L8E96:      LD      HL,(L904A)
            CALL    L79A3
            DEC     B
            JR      Z,L8EB7             ; (+018H)
            DEC     HL
L8EA0:      PUSH    BC
L8EA1:      CALL    L6A0A
            CALL    L5963
            JP      Z,L6364
            CP      029H
            JP      Z,L6364
            CP      02CH
            JR      NZ,L8EA1            ; (-012H)
            POP     BC
            DJNZ    L8EA0               ; (-016H)
            INC     HL
L8EB7:      EX      DE,HL
            POP     HL
            EX      (SP),HL
            EX      DE,HL
            LD      BC,(09048H)
            PUSH    BC
            LD      BC,L0000
            LD      (09048H),BC
            CALL    L858E
            POP     HL
            LD      (L9048),HL
            POP     HL
            JP      HLFTCH

L8ED2:      PUSH    DE
            JP      L8B66

L8ED6:      LD      HL,(L1074)
L8ED9:      LD      DE,L11A4
            LD      A,(HL)
            OR      A
            RET     Z
            CP      040H
            JR      NC,L8F0A            ; (+027H)
            CP      C
            JR      NZ,L8EFF            ; (+019H)
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L8EFD            ; (+012H)
            LD      B,A
L8EEC:      INC     DE
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L8EF7            ; (+005H)
            DJNZ    L8EEC               ; (-008H)
            INC     HL
            SCF     
            RET     

L8EF7:      INC     HL
            DJNZ    L8EF7               ; (-003H)
            LD      A,C
            JR      L8F04               ; (+007H)

L8EFD:      LD      A,C
            DEC     HL
L8EFF:      AND     00FH
            INC     HL
            ADD     A,(HL)
            INC     HL
L8F04:      LD      E,A
            LD      D,000H
            ADD     HL,DE
            JR      L8ED9               ; (-031H)

L8F0A:      CP      C
            JR      Z,L8F21             ; (+014H)
            INC     HL
L8F0E:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            DEC     HL
            ADD     HL,DE
            JR      L8ED9               ; (-03cH)

L8F15:      LD      A,C
            SUB     B
            CPL     
            LD      C,A
            LD      B,0FFH
            ADD     HL,BC
            POP     BC
L8F1D:      DEC     HL
            DEC     HL
            JR      L8F0E               ; (-013H)

L8F21:      LD      A,(HL)
            EXX     
            LD      C,A
            LD      B,000H
            EXX     
            INC     HL
            PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            POP     DE
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L8F1D            ; (-018H)
            PUSH    BC
            LD      B,A
            LD      C,A
L8F38:      INC     HL
            INC     DE
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L8F15            ; (-029H)
            DJNZ    L8F38               ; (-008H)
            INC     HL
            POP     BC
            SCF     
            RET     

L8F44:      CALL    L8BB5
            SET     6,C
            PUSH    HL
            CALL    L8ED6
            JP      C,06376H
            LD      (HL),C
            EX      (SP),HL
            PUSH    HL
            DEC     HL
L8F54:      CALL    L6A0A
            OR      A
            JR      Z,L8F5E             ; (+004H)
            CP      03AH
            JR      NZ,L8F54            ; (-00aH)
L8F5E:      POP     DE
            PUSH    HL
            INC     HL
            SBC     HL,DE
            LD      A,(L11A4)
            ADD     A,004H
            LD      C,A
            LD      B,000H
            LD      A,L
            ADD     HL,BC
            LD      B,A
            PUSH    HL
            EXX     
            POP     BC
            PUSH    BC
            PUSH    HL
            PUSH    DE
            PUSH    BC
            LD      HL,L0000
            ADD     HL,SP
            LD      DE,(TMPEND)
            DEC     H
            OR      A
            SBC     HL,DE
            LD      A,00CH
            JP      C,L63A9
            POP     BC
            POP     DE
            POP     HL
            LD      HL,(L107A)
            PUSH    HL
            ADD     HL,BC
            EX      (SP),HL
            PUSH    HL
            LD      DE,(STRST)
            OR      A
            SBC     HL,DE
            LD      C,L
            LD      B,H
            POP     HL
            POP     DE
            LDDR    
            POP     DE
            RST     018H
            DB      01AH
            DEC     DE
            POP     HL
            EX      (SP),HL
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            LD      DE,L11A4
            LD      A,(DE)
            LD      (HL),A
            LD      B,A
L8FAE:      INC     DE
            INC     HL
            LD      A,(DE)
            LD      (HL),A
            DJNZ    L8FAE               ; (-006H)
            INC     HL
            PUSH    HL
            EXX     
            POP     HL
            CALL    LDHLDE
            LD      (HL),000H
            POP     HL
            RET     

L8FBF:      PUSH    DE
            CALL    L8BB5
            POP     IX
            PUSH    BC
            SET     6,C
            LD      DE,(0904AH)
            LD      (L904A),HL
            PUSH    DE
            CALL    L8ED6
            JP      NC,06382H
            LD      DE,(09048H)
            LD      (L9048),HL
            PUSH    DE
            PUSH    IX
            DEC     HL
L8FE1:      CALL    L6A0A
            CALL    L5963
            JP      Z,L6364
            CP      SIOAD
            JR      NZ,L8FE1            ; (-00dH)
            INC     HL
            POP     DE
            PUSH    DE
            CALL    L858E
            POP     DE
            LD      HL,(L904A)
            POP     BC
            LD      (09048H),BC
            POP     BC
            LD      (0904AH),BC
            EX      DE,HL
            POP     BC
            LD      A,C
            CALL    L9032
            LD      BC,00005H
            ADD     HL,BC
            EX      DE,HL
            CALL    HLFTCH
            CP      028H
            RET     NZ
            PUSH    DE
            LD      B,001H
L9016:      PUSH    BC
            CALL    L6A0A
            POP     BC
            CALL    L5966
            JP      Z,L6364
            CP      028H
            JR      NZ,L9026            ; (+001H)
            INC     B
L9026:      CP      029H
            JR      NZ,L9016            ; (-014H)
            DJNZ    L9016               ; (-016H)
            INC     HL
            CALL    HLFTCH
            POP     DE
            RET     

L9032:      CP      003H
            JR      NZ,L903F            ; (+009H)
L9036:      LD      A,(L9E9C)
            CP      003H
            RET     Z
            JP      0636DH

L903F:      LD      A,(L9E9C)
            CP      003H
            RET     NZ
            JP      0636DH

L9048:      NOP     
            NOP     
L904A:      NOP     
            NOP     
L904C:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      B,C
L9053:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L905C            ; (+005H)
            INC     DE
            INC     HL
            DJNZ    L9053               ; (-008H)
            XOR     A
L905C:      POP     HL
            POP     DE
            POP     BC
            RET     

L9060:      CALL    L79A3
            PUSH    DE
            CALL    L8547
            CALL    L8540
            CP      003H
            JP      NC,0636AH
            POP     DE
            PUSH    AF
            CALL    L79AA
            POP     AF
            RST     018H
            DB      01EH
            EX      DE,HL
            PUSH    DE
            CALL    L887D
            JP      L8964

L907F:      CALL    L79A3
            PUSH    DE
            CALL    L8547
            CALL    L8540
            CP      005H
            JP      NC,0636AH
            POP     DE
            PUSH    AF
            CALL    L79AA
            POP     AF
            RST     018H
            DB      01FH
            EX      DE,HL
            PUSH    DE
            CALL    L887D
            JP      L8964

L909E:      PUSH    HL
            LD      B,005H
            CALL    ?CLRHL
            POP     HL
            RET     

L90A6:      CALL    L903F
L90A9:      LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            LD      A,(HL)
            XOR     080H
            LD      (HL),A
            DEC     HL
            RET     

L90B3:      CALL    L903F
            LD      C,A
            LD      A,080H
            JP      L90C6

L90BC:      LD      A,(L9E9C)
            CP      003H
            JP      Z,L9110
            LD      C,A
            XOR     A
L90C6:      LD      (L94C0),HL
            PUSH    DE
            PUSH    HL
            LD      (094C3H),SP
            INC     HL
            INC     DE
            LD      B,(HL)
            XOR     (HL)
            EX      DE,HL
            XOR     (HL)
            DEC     HL
            DEC     DE
            EX      DE,HL
            RLCA    
            LD      A,B
            LD      (L94C2),A
            JP      C,L91D1
            XOR     A
            CP      (HL)
            JP      Z,L9105
            LD      A,(DE)
            OR      A
            JR      Z,L90ED             ; (+004H)
            SUB     (HL)
            JP      L9214

L90ED:      LD      SP,(094C3H)
            POP     HL
            POP     DE
            EI      
            LD      A,(HL)
            OR      A
            JP      Z,L95BD
            LD      A,(L94C2)
            AND     080H
            INC     HL
            RES     7,(HL)
            OR      (HL)
            LD      (HL),A
            DEC     HL
            RET     

L9105:      LD      B,000H
            LD      A,005H
            LD      C,A
            EX      DE,HL
            LDIR    
            JP      L90ED

L9110:      LD      B,(HL)
            LD      A,(DE)
            ADD     A,B
            JP      C,06370H
            LD      C,A
            PUSH    DE
            PUSH    HL
            PUSH    DE
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            EX      DE,HL
            LD      HL,(L107A)
            CALL    L8BFC
            EX      (SP),HL
            LD      B,(HL)
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            EX      DE,HL
            POP     HL
            CALL    L8BFC
            LD      A,C
            LD      DE,(TMPEND)
            LD      BC,(STRST)
            EX      DE,HL
            OR      A
            SBC     HL,BC
            EX      DE,HL
            LD      (L107A),HL
            POP     HL
            LD      (HL),A
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            DEC     HL
            DEC     HL
            POP     DE
            RET     

L9153:      LD      A,(L9E9C)
            CP      003H
            JR      NZ,L918E            ; (+034H)
            PUSH    DE
            PUSH    HL
            LD      A,(DE)
            OR      (HL)
            JR      Z,L918B             ; (+02bH)
            LD      A,(DE)
            CP      (HL)
            JR      C,L9165             ; (+001H)
            LD      A,(HL)
L9165:      OR      A
            JR      Z,L9185             ; (+01dH)
            INC     HL
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            EX      DE,HL
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            ADD     HL,BC
            EX      DE,HL
            LD      B,A
            OR      A
            JR      Z,L918B             ; (+00eH)
L917D:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L918B            ; (+00aH)
            INC     DE
            INC     HL
            DJNZ    L917D               ; (-008H)
L9185:      POP     DE
            POP     HL
            LD      A,(DE)
            CP      (HL)
            EX      DE,HL
            RET     

L918B:      POP     HL
            POP     DE
            RET     

L918E:      INC     DE
            INC     HL
            LD      A,(DE)
            DEC     DE
            XOR     (HL)
            RLCA    
            JR      NC,L919A            ; (+004H)
            LD      A,(HL)
            DEC     HL
            RLCA    
            RET     

L919A:      LD      A,(HL)
            DEC     HL
            RLCA    
            JR      NC,L91A5            ; (+006H)
            CALL    L91A5
            RET     Z
            CCF     
            RET     

L91A5:      PUSH    DE
            PUSH    HL
            EX      DE,HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L91C6            ; (+01aH)
            INC     DE
            INC     HL
            LD      A,(HL)
            OR      080H
            LD      B,A
            LD      A,(DE)
            OR      080H
            CP      B
            JR      NZ,L91C6            ; (+00eH)
            LD      A,(L9E9C)
            LD      B,A
            DEC     B
            DEC     B
L91BE:      INC     DE
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L91C6            ; (+002H)
            DJNZ    L91BE               ; (-008H)
L91C6:      POP     HL
            POP     DE
            RET     

L91C9:      POP     HL
            PUSH    HL
            CALL    L909E
            JP      L90ED

L91D1:      CALL    L91A5
            JR      Z,L91C9             ; (-00dH)
            JR      NC,L91E1            ; (+009H)
            LD      A,(L94C2)
            XOR     080H
            LD      (L94C2),A
            SCF     
L91E1:      EX      AF,AF'
            LD      A,(HL)
            OR      A
            JP      Z,L9105
            LD      A,(DE)
            OR      A
            JP      Z,L90ED
            SUB     (HL)
            JR      C,L91F6             ; (+007H)
            CP      020H
            JP      NC,L9105
            JR      L91FD               ; (+007H)

L91F6:      NEG     
            CP      020H
            JP      NC,L90ED
L91FD:      EX      AF,AF'
            JR      C,L9201             ; (+001H)
            EX      DE,HL
L9201:      EX      AF,AF'
            JP      L929B

L9205:      LD      SP,(094C3H)
            EI      
            POP     HL
            POP     DE
            LD      A,(094CAH)
            OR      A
            JP      Z,06367H
            RET     

L9214:      JR      NC,L9220            ; (+00aH)
            NEG     
            CP      020H
            JP      NC,L90ED
            EX      DE,HL
            JR      L9225               ; (+005H)

L9220:      CP      020H
            JP      NC,L9105
L9225:      CALL    L925B
            LD      A,H
            EXX     
            ADC     A,H
            EXX     
            LD      H,A
            LD      A,L
            EXX     
            ADC     A,L
            EXX     
            LD      L,A
            LD      A,D
            EXX     
            ADC     A,D
            EXX     
            LD      D,A
            LD      A,E
            EXX     
            ADC     A,E
            EXX     
            JR      NC,L9248            ; (+00bH)
            RRA     
            RR      D
            RR      L
            RR      H
            INC     C
            JP      Z,L9205
L9248:      LD      E,A
            LD      A,C
            EXX     
            LD      BC,00005H
            LD      HL,(L94C0)
            LD      (HL),A
            ADD     HL,BC
            DI      
            LD      SP,HL
            EXX     
            PUSH    HL
            PUSH    DE
            JP      L90ED

L925B:      DI      
            LD      (094C5H),SP
            EX      AF,AF'
            INC     HL
            LD      SP,HL
            EXX     
            POP     DE
            SET     7,E
            POP     HL
            OR      A
L9269:      EX      AF,AF'
            CP      008H
            JR      C,L927A             ; (+00cH)
            SUB     008H
            EX      AF,AF'
            RL      H
            LD      H,L
            LD      L,D
            LD      D,E
            LD      E,000H
            JR      L9269               ; (-011H)

L927A:      OR      A
            JR      Z,L928B             ; (+00eH)
L927D:      EX      AF,AF'
            OR      A
            RR      E
            RR      D
            RR      L
            RR      H
            EX      AF,AF'
            DEC     A
            JR      NZ,L927D            ; (-00eH)
L928B:      EXX     
            EX      DE,HL
            LD      C,(HL)
            INC     HL
            LD      SP,HL
            POP     DE
            SET     7,E
            POP     HL
            EX      AF,AF'
            LD      SP,(094C5H)
            EI      
            RET     

L929B:      CP      020H
            JP      NC,L90ED
            CALL    L925B
            LD      A,H
            EXX     
            SBC     A,H
            EXX     
            LD      H,A
            LD      A,L
            EXX     
            SBC     A,L
            EXX     
            LD      L,A
            LD      A,D
            EXX     
            SBC     A,D
            EXX     
            LD      D,A
            LD      A,E
            EXX     
            SBC     A,E
            EXX     
L92B6:      OR      A
            JR      Z,L92CF             ; (+016H)
L92B9:      BIT     7,A
            JR      NZ,L92CB            ; (+00eH)
            RL      H
            RL      L
            RL      D
            RLA     
            DEC     C
            JP      NZ,L92B9
            JP      L91C9

L92CB:      LD      E,A
            JP      L9248

L92CF:      LD      A,C
            SUB     008H
            LD      C,A
            LD      A,D
            LD      D,L
            LD      L,H
            LD      H,000H
            JR      Z,L92DC             ; (+002H)
            JR      NC,L92B6            ; (-026H)
L92DC:      JP      L91C9

L92DF:      LD      C,A
            INC     HL
            INC     DE
            LD      A,(DE)
            XOR     (HL)
            LD      (L94C2),A
            DEC     HL
            DEC     DE
            RET     

L92EA:      CALL    L903F
            CALL    L92DF
            PUSH    DE
            PUSH    HL
            LD      (094C3H),SP
            LD      A,(HL)
            OR      A
            JP      Z,L91C9
            LD      A,(DE)
            OR      A
            JP      Z,L91C9
            INC     DE
            PUSH    DE
            POP     IX
            ADD     A,(HL)
            LD      E,A
            LD      A,000H
            ADC     A,A
            LD      D,A
            LD      (094C8H),DE
            INC     HL
            XOR     A
            LD      (L94C7),A
            LD      D,(HL)
            SET     7,D
            INC     HL
            LD      E,(HL)
            INC     HL
            PUSH    HL
            LD      H,A
            LD      L,A
            EXX     
            POP     HL
            LD      D,(HL)
            INC     HL
            LD      E,(HL)
            LD      B,A
            LD      C,A
            LD      H,A
            LD      L,A
            EXX     
            LD      A,(IX+000H)
            OR      080H
            LD      C,004H
L932D:      LD      B,008H
            OR      A
            JP      Z,L93C2
L9333:      RLCA    
            JR      NC,L9348            ; (+012H)
            EX      AF,AF'
            EXX     
            LD      A,C
            ADD     A,B
            LD      C,A
            ADC     HL,DE
            EXX     
            ADC     HL,DE
            JR      NC,L9347            ; (+005H)
            LD      A,001H
            LD      (L94C7),A
L9347:      EX      AF,AF'
L9348:      SRL     D
            RR      E
            EXX     
            RR      D
            RR      E
            RR      B
            EXX     
            DJNZ    L9333               ; (-023H)
L9356:      INC     IX
            LD      A,(IX+000H)
            DEC     C
            JR      NZ,L932D            ; (-031H)
            EXX     
            LD      A,(L94C7)
            OR      A
            JR      Z,L937B             ; (+016H)
            LD      DE,(094C8H)
            INC     DE
            LD      (094C8H),DE
            EXX     
            SCF     
            RR      H
            RR      L
            EXX     
            RR      H
            RR      L
            RR      C
L937B:      BIT     7,C
            JR      Z,L9399             ; (+01aH)
            LD      DE,00001H
            ADD     HL,DE
            EXX     
            LD      DE,L0000
            ADC     HL,DE
            EXX     
            JR      NC,L9399            ; (+00dH)
            LD      DE,(094C8H)
            INC     DE
            LD      (094C8H),DE
            EXX     
            LD      H,080H
            EXX     
L9399:      POP     IX
            PUSH    IX
            LD      (IX+004H),L
            LD      (IX+003H),H
            EXX     
            LD      (IX+002H),L
            LD      (IX+001H),H
            LD      HL,(094C8H)
            OR      A
            LD      DE,L0081
            SBC     HL,DE
            LD      A,H
            ADD     A,000H
            JP      M,L93CE
            JP      NZ,L9205
            LD      (IX+000H),L
            JP      L90ED

L93C2:      LD      A,E
            EXX     
            LD      B,E
            LD      E,D
            LD      D,A
            EXX     
            LD      E,D
            LD      D,000H
            JP      L9356

L93CE:      LD      SP,(094C3H)
            JP      L91C9

L93D5:      CALL    L903F
            CALL    L92DF
            PUSH    DE
            PUSH    HL
            LD      (094C3H),SP
            LD      A,(DE)
            OR      A
            JP      Z,06367H
            EX      AF,AF'
            LD      A,(HL)
            OR      A
            JP      Z,L91C9
            EXX     
            ADD     A,081H
            LD      B,A
            LD      A,000H
            ADC     A,A
            EX      AF,AF'
            LD      C,A
            LD      A,B
            SUB     C
            LD      C,A
            EX      AF,AF'
            LD      B,A
            EX      AF,AF'
            LD      A,B
            SBC     A,000H
            JP      C,L93CE
            JP      NZ,L9205
            LD      A,C
            PUSH    AF
            EXX     
            INC     DE
            INC     HL
            LD      B,(HL)
            SET     7,B
            INC     HL
            LD      C,(HL)
            INC     HL
            PUSH    HL
            EX      DE,HL
            LD      D,(HL)
            SET     7,D
            INC     HL
            LD      E,(HL)
            INC     HL
            PUSH    HL
            LD      H,B
            LD      L,C
            EXX     
            POP     HL
            LD      D,(HL)
            INC     HL
            LD      E,(HL)
            POP     HL
            LD      A,(HL)
            INC     HL
            LD      L,(HL)
            LD      H,A
            EXX     
            LD      C,005H
L9427:      LD      B,008H
            XOR     A
L942A:      BIT     7,H
            JR      NZ,L943E            ; (+010H)
            OR      A
L942F:      RLA     
            EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            DJNZ    L942A               ; (-00dH)
            PUSH    AF
            DEC     C
            JR      NZ,L9427            ; (-014H)
            JP      L9478

L943E:      OR      A
            EXX     
            SBC     HL,DE
            EXX     
            SBC     HL,DE
            CCF     
            JR      C,L942F             ; (-019H)
            EXX     
            ADD     HL,DE
            EXX     
            ADC     HL,DE
            OR      A
            RLA     
            EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            DJNZ    L945D               ; (+007H)
            PUSH    AF
            LD      B,008H
            DEC     C
            JP      Z,L9478
L945D:      EXX     
            OR      A
            SBC     HL,DE
            EXX     
            SBC     HL,DE
            SCF     
            RLA     
            DJNZ    L946E               ; (+006H)
            PUSH    AF
            LD      B,008H
            DEC     C
            JR      Z,L9478             ; (+00aH)
L946E:      EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            JR      C,L945D             ; (-018H)
            JP      L942A

L9478:      POP     AF
            LD      H,A
            EXX     
            POP     AF
            LD      E,A
            POP     AF
            LD      D,A
            POP     AF
            LD      C,A
            POP     AF
            LD      B,A
            POP     AF
L9484:      BIT     7,B
            JR      NZ,L949B            ; (+013H)
            EXX     
            SLA     H
            EXX     
            RL      E
            RL      D
            RL      C
            RL      B
            DEC     A
            JP      NZ,L9484
            JP      L91C9

L949B:      EXX     
            RL      H
            EXX     
            JR      NC,L94B2            ; (+011H)
            LD      HL,00001H
            ADD     HL,DE
            EX      DE,HL
            LD      HL,L0000
            ADC     HL,BC
            LD      B,H
            LD      C,L
            JR      NC,L94B2            ; (+003H)
            LD      B,080H
            INC     A
L94B2:      POP     HL
            PUSH    HL
            LD      (HL),A
            INC     HL
            LD      (HL),B
            INC     HL
            LD      (HL),C
            INC     HL
            LD      (HL),D
            INC     HL
            LD      (HL),E
            JP      L90ED

L94C0:      NOP     
            NOP     
L94C2:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L94C7:      NOP     
            NOP     
            NOP     
            NOP     
L94CB:      INC     HL
            BIT     7,(HL)
            DEC     HL
            RET     

L94D0:      INC     (HL)
            RET     NZ
            JP      06367H

L94D5:      LD      A,(HL)
            OR      A
            RET     Z
            DEC     (HL)
            RET     NZ
            JP      L909E

L94DD:      PUSH    HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            EX      DE,HL
            LD      HL,(MEMMAX)
            DEC     HL
            SBC     HL,DE
            JP      C,06373H
            POP     HL
            RET     

L94EF:      PUSH    HL
            LD      (L9BA0),HL
            CALL    L94DD
            EX      DE,HL
            LD      (L9BA2),HL
            CALL    L94DD
            EX      DE,HL
            LD      (L9BA4),HL
            CALL    L94DD
            LD      (09BA6H),DE
            POP     HL
            RET     

L950A:      CALL    L903F
            EX      DE,HL
            LD      A,(HL)
            OR      A
            JP      Z,L956C
            EX      DE,HL
            LD      A,(HL)
            OR      A
            JP      Z,L909E
            CALL    L94CB
            JR      Z,L9546             ; (+028H)
            CALL    L90A9
            EX      DE,HL
            PUSH    DE
            PUSH    HL
            LD      DE,L9EA5
            CALL    L79C5
L952A:      LD      HL,L9EA5
            CALL    L7BC0
            LD      A,(HL)
            OR      A
            JP      NZ,0636AH
            POP     HL
            PUSH    HL
            CALL    L7BEA
            BIT     0,L
            POP     DE
            POP     HL
            JR      Z,L9546             ; (+006H)
            CALL    L9546
            JP      L90A9

L9546:      EX      DE,HL
            LD      A,(HL)
            OR      A
            JR      Z,L956C             ; (+021H)
            CALL    L94CB
            JR      Z,L9572             ; (+022H)
            CALL    L90A9
            CALL    L9572
            PUSH    DE
            PUSH    HL
            LD      DE,L9EA5
            CALL    L79C2
            LD      HL,L9EA5
            POP     DE
            CALL    L93D5
            PUSH    DE
            CALL    L79C5
            POP     HL
            POP     DE
            RET     

L956C:      PUSH    DE
            CALL    L79C2
            POP     HL
            RET     

L9572:      PUSH    DE
            LD      DE,L9EA5
            CALL    L79C5
            POP     HL
            CALL    L9A4F
            LD      DE,L9EA5
            CALL    L92EA
            JP      L992B

L9586:      CALL    L903F
            PUSH    DE
            PUSH    HL
            CALL    L7BEA
            LD      A,L
            CPL     
            LD      E,A
            LD      A,H
            CPL     
            LD      D,A
            JR      L95B7               ; (+021H)

L9596:      LD      A,0A2H
            LD      BC,0B23EH
            LD      BC,0AA3EH
            LD      (L95B2),A
            INC     A
            LD      (L95B5),A
            CALL    L903F
            PUSH    DE
            PUSH    HL
            CALL    L7BEA
            EX      DE,HL
            CALL    L7BEA
            LD      A,H
L95B2:      AND     D
            LD      D,A
            LD      A,L
L95B5:      AND     E
            LD      E,A
L95B7:      POP     HL
            CALL    L79CB
            POP     DE
            RET     

L95BD:      INC     HL
            RES     7,(HL)
            DEC     HL
            RET     

L95C2:      CALL    L94CB
            JP      Z,L7B82
            CALL    L95E7
            CALL    L7B82
            LD      DE,L9EA5
            CALL    L9153
            RET     Z
            LD      DE,L7C45
            JP      L90B3

L95DB:      LD      DE,L7C45
            JP      L90BC

L95E1:      LD      DE,L7C45
            JP      L9153

L95E7:      PUSH    HL
            PUSH    DE
            LD      DE,L9EA5
            CALL    L79C5
            POP     DE
            POP     HL
            RET     

L95F2:      CALL    L7B82
            EX      DE,HL
            CALL    L7B82
            EX      DE,HL
            CALL    L95E7
            CALL    L93D5
            CALL    L7B82
            CALL    L92EA
            PUSH    DE
            LD      DE,L9EA5
            CALL    L90B3
            POP     DE
            JP      L90A9

L9611:      CALL    L7B82
            EX      DE,HL
            CALL    L7B82
            EX      DE,HL
            CALL    L93D5
            JP      L7B82

L961F:      LD      A,(HL)
            OR      A
            RET     Z
            CALL    L94CB
            JP      NZ,0636AH
            CALL    L9A4F
            CALL    L94D5
            JP      L992B

L9631:      PUSH    HL
            EX      DE,HL
            CALL    L79C2
            POP     HL
            POP     BC
            RET     

L9639:      LD      A,(HL)
            LD      C,H
L963B:      ADD     A,B
            DEC     HL
L963D:      PUSH    BC
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            DEC     HL
            PUSH    AF
            CALL    L964E
            POP     AF
            POP     BC
            RLCA    
            RET     NC
            JP      L90A9

L964E:      CALL    L95E1
            JR      C,L9671             ; (+01eH)
            CALL    L94DD
            PUSH    DE
            PUSH    HL
            CALL    L79C5
            POP     DE
            PUSH    DE
            CALL    L79C2
            POP     HL
            POP     DE
            CALL    L93D5
            CALL    L9671
            LD      DE,L98CB
            CALL    L90B3
            JP      L95BD

L9671:      LD      A,0FFH
            LD      (L97E7),A
            LD      DE,L9639
            CALL    L9153
            JR      C,096CDH             ; (+04fH)
            LD      DE,L963B
            CALL    L9153
            PUSH    AF
            CALL    L94DD
            POP     AF
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            JR      C,L96A5             ; (+014H)
            CALL    L95DB
            EX      (SP),HL
            CALL    L90B3
            POP     DE
            CALL    L93D5
            CALL    096CDH
            LD      DE,L98D0
            JP      L90BC

L96A5:      LD      DE,L96C8
            CALL    L92EA
            CALL    L95DB
            EX      (SP),HL
            LD      DE,L96C8
            CALL    L90B3
            POP     DE
            CALL    L93D5
            CALL    096CDH
            CALL    L94D0
            LD      DE,L98D0
            CALL    L90BC
            JP      L94D5

L96C8:      LD      A,A
            LD      D,H
            INC     DE
            CALL    Z,0C5D0H
            PUSH    HL
            CALL    L94EF
            POP     HL
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      E,L
            LD      D,H
            CALL    L92EA
            LD      DE,(09BA4H)
            POP     HL
            PUSH    HL
            CALL    L79C5
            LD      A,(L9E9C)
            DEC     A
            CP      004H
            LD      B,A
            LD      HL,L986E
            JP      Z,L9774
            LD      B,00AH
            JP      L9774

L96F9:      PUSH    BC
            LD      A,(HL)
            OR      A
            JP      Z,L9631
            LD      DE,L98CB
            CALL    L90B3
            CALL    L90A9
            POP     BC
L9709:      PUSH    BC
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            AND     080H
            CPL     
            LD      (L97E7),A
            DEC     HL
            LD      DE,L98C1
            PUSH    HL
            CALL    L9153
            JR      C,L9727             ; (+009H)
            CALL    L93D5
            CALL    L7BC0
            CALL    L92EA
L9727:      LD      DE,L98C6
            CALL    L9153
            JR      C,L973A             ; (+00bH)
            CALL    L90B3
L9732:      LD      A,(L97E7)
            XOR     080H
            LD      (L97E7),A
L973A:      LD      DE,L98CB
            CALL    L9153
            JR      C,L974B             ; (+009H)
            LD      DE,L98C6
            CALL    L90B3
            CALL    L95BD
L974B:      CALL    L94EF
            POP     HL
            PUSH    DE
            LD      DE,L98D0
            CALL    L9153
            JR      NC,L97BD            ; (+065H)
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      E,L
            LD      D,H
            CALL    L92EA
            LD      DE,(09BA4H)
            POP     HL
            PUSH    HL
            CALL    L79C5
            LD      A,(L9E9C)
            LD      B,A
            LD      HL,L981E
L9774:      PUSH    BC
            PUSH    HL
            LD      HL,(L9BA4)
            LD      DE,(09BA6H)
            CALL    L92EA
            POP     HL
            PUSH    HL
            LD      DE,(09BA2H)
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      DE,(09BA4H)
            CALL    L92EA
            EX      DE,HL
            LD      HL,(L9BA0)
            CALL    L90BC
            POP     HL
            LD      DE,00005H
            ADD     HL,DE
            POP     BC
            DJNZ    L9774               ; (-02dH)
            POP     HL
            POP     BC
            LD      A,(L97E7)
            INC     HL
            XOR     (HL)
            CPL     
            LD      (HL),A
            DEC     HL
            LD      A,(L9E9C)
            CP      008H
            LD      A,(HL)
            JR      Z,L97B9             ; (+006H)
            CP      05CH
L97B5:      RET     NC
            JP      L909E

L97B9:      CP      04DH
            JR      L97B5               ; (-008H)

L97BD:      LD      DE,L98CB
            CALL    L90B3
            CALL    L95BD
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      E,L
            LD      D,H
            CALL    L92EA
            LD      DE,(09BA4H)
            CALL    L79C2
            POP     DE
            PUSH    DE
            CALL    L79C2
            LD      A,(L9E9C)
            LD      B,A
            LD      HL,L9846
            JR      L9774               ; (-073H)

L97E7:      NOP     
L97E8:      PUSH    BC
            PUSH    HL
            CALL    L94DD
            EX      DE,HL
            LD      (L9BA8),HL
            CALL    L94DD
            LD      (09BAAH),DE
            POP     HL
            PUSH    HL
            CALL    L79C5
            LD      HL,(L9BA8)
            EX      DE,HL
            POP     HL
            PUSH    HL
            CALL    L79C5
            LD      HL,(09BAAH)
            CALL    L9709
            POP     DE
            PUSH    DE
            CALL    L79C5
            LD      HL,(L9BA8)
            CALL    L96F9
            EX      DE,HL
            DB      LSE1                ; SINTBL - Sine Taylor series coefficients
            DB      LSRF
            DB      0D5H
            DB      093H
            DB      0C1H
            DB      0C9H
L981E:      DB      07EH
            DS      3, 0AAH
            DB      0ABH
            DB      07AH
            DB      008H
            DS      2, 088H
            DB      089H
            DB      074H
            DB      LSD0
            DB      00DH
            DB      000H
            DB      LSD0
            DB      06EH,038H,0EFH,01DH,02BH,067H,0D7H,"2+@`0",092H,030H,09DH,058H,0D7H,03FH,09FH,":PJ",096H,03BH,082H
L9846:      DS      2, 080H
            DS      3, 000H
            DB      07CH
            DB      02AH
            DS      2, 0AAH
            DB      0ABH,077H,0B6H,00BH,060H,0B6H,071H,050H,00DH,000H
            DB      LSD0
            DB      06BH
            DB      093H
            DB      PSGA
            DB      07DH,0BCH,064H,00FH,076H,0C7H,080H,05CH,0C9H,0CBH,0A5H,"FTW?",09FH,03AH
L986E:      DB      07FH
            DS      3, 0AAH
            DB      0ABH
            DB      07EH
            DB      04CH
            DB      LSWF
            DB      LSWF
            DB      LSRF
            DB      07EH,092H,049H,024H,092H,07DH,063H,08EH,038H
            DB      LSE4
            DB      07DH,0BAH,02EH,08BH,0A3H,07DH,01DH,089H,0D8H,09EH,07DH
            DS      3, 088H
            DB      089H
            DB      07CH
            DB      070H
            DB      LSPAL
            DB      LSPAL
            DB      0F1H
            DB      07CH
            DB      0D7H
            DB      094H
            DB      035H
            DB      LSE5
            DB      07CH,043H,00CH,030H,0C3H
L98A0:      DB      011H
            DS      2, 000H
            DB      07EH
            DB      0B7H
            DB      028H
            DB      008H
            DB      LSRF
            DB      0CBH
            DB      094H
            DB      013H
            DB      028H
            DB      002H
            DS      2, 01BH
            DB      LSRF
            DB      0CBH
            DB      079H
            DB      0C9H
L98B3:      DB      011H
            DB      0D5H
            DB      098H
            DB      018H
            DB      003H
L98B8:      DB      011H
            DB      0C6H
            DB      098H
            DB      0C5H
            DB      LSRF
            DB      0EAH
            DB      092H
            DB      0C1H
            DB      0C9H
L98C1:      DB      083H
            DB      049H
            DB      00FH
            DB      0DAH
            DB      0A2H
L98C6:      DB      082H
            DB      049H
            DB      00FH
            DB      0DAH
            DB      0A2H
L98CB:      DB      081H
            DB      049H
            DB      00FH
            DB      0DAH
            DB      0A2H
L98D0:      DB      080H
            DB      049H
            DB      00FH
            DB      0DAH
            DB      0A2H
            LD      A,E
            LD      C,0FAH
            DEC     (HL)
            INC     DE
L98DA:      PUSH    HL
            CALL    L7BEA
            LD      E,(HL)
            LD      D,000H
            POP     HL
            CALL    L79CB
            RET     

L98E6:      LD      A,(HL)
            OR      A
            JR      Z,L98EF             ; (+005H)
            CALL    L94CB
            JR      Z,L98FA             ; (+00bH)
L98EF:      PUSH    HL
            LD      HL,L4193
            LD      (L9929),HL
            POP     HL
            XOR     A
            LD      R,A
L98FA:      PUSH    BC
            LD      DE,(09929H)
            LD      A,R
            XOR     D
            RRC     A
            RRC     A
            RRC     A
            LD      D,A
            LD      A,R
            XOR     E
            RLC     A
            RLC     A
            LD      E,D
            LD      D,A
            LD      (09929H),DE
            PUSH    HL
            INC     HL
            RES     7,D
            LD      (HL),D
            INC     HL
            LD      (HL),E
            INC     HL
            LD      A,R
            LD      (HL),A
            POP     HL
            LD      (HL),081H
            DB      LSRF
            DB      0D5H
            DB      095H
            DB      0C1H
            DB      0C9H
L9929:      DB      093H
            DB      041H
L992B:      DB      0C5H,07EH,0B7H,0CAH,031H,096H,"#~2"
            LD      B,C
            SBC     A,D
            RES     7,(HL)
            DEC     HL
            LD      DE,L9B96
            CALL    L92EA
            PUSH    HL
            CALL    L94DD
            PUSH    DE
            CALL    L79C5
            POP     HL
            CALL    L7B82
            PUSH    HL
            CALL    L7BEA
            XOR     A
            CP      H
            JP      NZ,06367H
            LD      A,L
            LD      (L9A40),A
            POP     DE
            POP     HL
            PUSH    HL
            CALL    L90B3
            PUSH    DE
            PUSH    HL
            CALL    L79C2
            POP     DE
            POP     HL
            CALL    L94D5
            EX      DE,HL
            XOR     A
            LD      B,008H
L996C:      PUSH    BC
            PUSH    AF
            CALL    L9153
            JR      C,L997A             ; (+007H)
            CALL    L90B3
            POP     AF
            SET     7,A
            PUSH    AF
L997A:      POP     AF
            RLC     A
            EX      DE,HL
            PUSH    AF
            CALL    L94D5
            POP     AF
            EX      DE,HL
            POP     BC
            DJNZ    L996C               ; (-01bH)
            LD      (L9A42),A
            PUSH    DE
            LD      DE,L9B8C
            LD      A,(L9E9C)
            BIT     3,A
            JR      NZ,L9998            ; (+003H)
            LD      DE,L9B91
L9998:      CALL    L92EA
            POP     DE
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      A,(L9E9C)
            BIT     3,A
            JP      Z,L9A30
            CALL    L94D0
            LD      DE,L7C40
            CALL    L90BC
            CALL    L94D5
            POP     DE
            PUSH    DE
            CALL    L92EA
            LD      DE,L7C40
            CALL    L94D5
            CALL    L90BC
            CALL    L94D0
            POP     DE
            PUSH    DE
            CALL    L92EA
            LD      DE,L9B87
            CALL    L92EA
            CALL    L94D0
            CALL    L95DB
            CALL    L94D5
            POP     DE
            PUSH    DE
            CALL    L92EA
            CALL    L95DB
            POP     DE
            PUSH    DE
            CALL    L92EA
L99E7:      CALL    L95DB
            EX      (SP),HL
            EX      DE,HL
            PUSH    DE
            CALL    L79C2
            POP     HL
            LD      DE,L9B37
            LD      A,(L9A42)
            LD      B,008H
L99F9:      RLC     A
            JR      NC,L9A04            ; (+007H)
            PUSH    AF
            PUSH    BC
            CALL    L92EA
            POP     BC
            POP     AF
L9A04:      INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            DJNZ    L99F9               ; (-012H)
            LD      A,(L9A40)
            ADD     A,(HL)
            JP      C,06367H
            LD      (HL),A
            POP     DE
            CALL    L92EA
            POP     BC
            LD      A,(09A41H)
            RLC     A
            RET     NC
            PUSH    BC
            PUSH    DE
            PUSH    HL
            CALL    L79C5
            POP     DE
            PUSH    DE
            CALL    L79C2
            POP     HL
            POP     DE
            CALL    L93D5
            POP     BC
            RET     

L9A30:      POP     DE
            PUSH    DE
            CALL    L92EA
            LD      A,(HL)
            OR      A
            CALL    NZ,L94D5
            CALL    L90BC
            JP      L99E7

L9A40:      NOP     
            NOP     
L9A42:      NOP     
L9A43:      PUSH    BC
            CALL    L9A4F
            LD      DE,L9B28
            CALL    L92EA
            POP     BC
            RET     

L9A4F:      PUSH    BC
            CALL    L94CB
            JP      NZ,0636AH
            LD      A,(HL)
            OR      A
            JP      Z,0636AH
            SUB     081H
            LD      (L9B27),A
            LD      (HL),081H
            XOR     A
            LD      B,008H
            LD      DE,L9B37
L9A68:      PUSH    BC
            PUSH    AF
            CALL    L9153
            JR      C,L9A7E             ; (+00fH)
            PUSH    HL
            LD      HL,00028H
            ADD     HL,DE
            EX      DE,HL
            EX      (SP),HL
            CALL    L92EA
            POP     DE
            POP     AF
            SET     7,A
            PUSH    AF
L9A7E:      POP     AF
            RLC     A
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            POP     BC
            DJNZ    L9A68               ; (-021H)
            DB      022H
            AND     B
            SBC     A,E
            CALL    L94DD
            EX      DE,HL
            LD      E,A
            LD      D,000H
            CALL    L79CB
            LD      A,(HL)
            OR      A
            JR      Z,L9A9D             ; (+003H)
            SUB     008H
            LD      (HL),A
L9A9D:      LD      A,(L9B27)
            CP      080H
            JR      C,L9AA6             ; (+002H)
            NEG     
L9AA6:      PUSH    HL
            CALL    L94DD
            EX      DE,HL
            LD      (L9BA2),HL
            LD      E,A
            LD      D,000H
            CALL    L79CB
            LD      A,(L9B27)
            AND     080H
            INC     HL
            OR      (HL)
            LD      (HL),A
            DEC     HL
            EX      DE,HL
            POP     HL
            CALL    L90BC
            LD      A,(L9E9C)
            LD      DE,09B9BH
            CP      005H
            JR      Z,L9ACF             ; (+003H)
            LD      DE,L9B8C
L9ACF:      CALL    L92EA
            PUSH    HL
            LD      DE,(09BA2H)
            LD      HL,(L9BA0)
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            CALL    L95DB
            EX      (SP),HL
            CALL    L90B3
            POP     DE
            CALL    L93D5
            PUSH    DE
            CALL    L79C5
            POP     HL
            PUSH    DE
            LD      E,L
            LD      D,H
            CALL    L92EA
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L79C5
            POP     HL
            LD      DE,L9B32
            CALL    L90BC
            EX      DE,HL
            POP     HL
            CALL    L92EA
            LD      DE,L7C40
            CALL    L94D0
            CALL    L90BC
            CALL    L94D5
            EX      DE,HL
            LD      HL,(L9BA0)
            CALL    L92EA
            LD      DE,L9B2D
            CALL    L92EA
            POP     DE
            CALL    L90BC
            POP     BC
            RET     

L9B27:      NOP     
L9B28:      LD      A,A
            LD      E,(HL)
            LD      E,E
            RET     C
            XOR     C
L9B2D:      LD      A,A
            LD      C,H
            CALL    Z,0CDCCH
L9B32:      DB      081H
            DS      3, 055H
            DB      056H
L9B37:      DB      081H,035H,004H,0F3H,034H,081H,018H,037H
            DB      LSPAL
            DB      052H
            DB      081H
            DB      00BH
            DB      095H
            DB      0C1H
            DB      LSE4
            DB      081H
            DB      005H
            DB      0AAH
            DB      0C3H
            DB      068H
            DB      081H
            DB      002H
            DB      LSRF
            DB      086H
            DB      099H
            DB      081H
            DB      001H
            DB      064H
            DB      LSD1
            DB      SIOAD
            DB      081H
            DB      000H
            DB      0B1H
            DB      0EDH
            DB      050H
            DB      081H
            DB      000H
            DB      058H
            DB      0D7H
            DB      LSD3
            DB      080H,035H,004H,0F3H,034H,080H,057H,044H
            DB      LSFC
            DB      0CBH,080H,06AH,0C0H,0C6H,0E8H,080H,"u%}",016H,080H,07AH,083H,0B2H,0DCH,080H,07DH,03EH,00CH,00DH,080H,07EH,09EH,011H,05DH,080H,07FH,04EH,0CBH,05AH
L9B87:      DB      07AH
            DB      008H
            DS      2, 088H
            DB      089H
L9B8C:      DB      080H
            DB      031H
            DB      072H
            DB      017H
            DB      0F8H
L9B91:      DB      080H
            DB      031H
            DB      072H
            DB      017H
            DB      0F8H
L9B96:      DB      081H
            DB      038H
            DB      0AAH
            DEC     SP
            LD      HL,(03180H)
            LD      (HL),D
            RLA     
            RET     M
L9BA0:      NOP     
            NOP     
L9BA2:      NOP     
            NOP     
L9BA4:      NOP     
            NOP     
            NOP     
            NOP     
L9BA8:      NOP     
            NOP     
            NOP     
            NOP     
L9BAC:      CALL    TEST1
            DB      SIOAD
            JR      NZ,L9BBE            ; (+00cH)
            CALL    L79A3
            CALL    L853D
            CP      010H
            SET     7,A
            JR      L9BC3               ; (+005H)

L9BBE:      CALL    L853D
            CP      054H
L9BC3:      JP      NC,0636AH
            PUSH    AF
            CALL    L79B1
            CALL    L8551
            POP     AF
            PUSH    AF
            OR      A
            CALL    M,L79AA
            POP     AF
            PUSH    HL
            RST     018H
            DB      022H
            POP     HL
            RET     

L9BD9:      CALL    L853D
            DEC     A
            CP      007H
            INC     A
            JP      L0041

L9BE3:      LD      A,008H
            LD      BC,0073EH
            LD      (L9CEB),A
            CALL    HLFTCH
            LD      B,003H
            CP      0BEH
            JR      Z,L9C07             ; (+013H)
            DEC     B
            CP      099H
            JR      Z,L9C07             ; (+00eH)
            CP      0DCH
            JR      NZ,L9C0D            ; (+010H)
            LD      DE,L9CDF
            LD      B,004H
            LD      A,002H
            CALL    ?SETDE
L9C07:      PUSH    HL
            RST     018H
            DB      023H
            POP     HL
            INC     HL
            RET     

L9C0D:      CALL    L5963
            RET     Z
            XOR     A
            LD      (L9CE7),A
            LD      (L9CE8),A
            LD      B,A
            LD      A,00DH
            LD      DE,L27D0
            LD      (09CE9H),DE
            LD      (DE),A
            CALL    ?SETDE
            LD      A,(L9CEB)
            LD      (L9CEC),A
L9C2C:      LD      DE,L9CEC
            LD      A,(DE)
            RRC     A
            LD      (DE),A
            PUSH    AF
            LD      B,000H
            JR      NC,L9C42            ; (+00aH)
            CALL    HLFTCH
            CP      03BH
            JR      Z,L9C42             ; (+003H)
            CALL    L8561
L9C42:      PUSH    HL
            LD      A,(L9CE8)
            CP      004H
            JP      Z,L6364
            INC     A
            LD      (L9CE8),A
            INC     B
            JP      Z,06370H
            LD      A,(L9CE7)
            ADD     A,B
            JP      C,06370H
            LD      (L9CE7),A
            LD      HL,(L9CE9)
            CALL    LDHLDE
            LD      (L9CE9),HL
            DEC     HL
            LD      (HL),00DH
            POP     HL
            POP     AF
            JR      NC,L9C2C            ; (-041H)
            CALL    L5963
            JR      Z,L9C7E             ; (+00cH)
            CALL    TEST1
            DB      02CH
            JR      Z,L9C7E             ; (+006H)
            CALL    TEST1
            DB      03BH
            JR      L9C2C               ; (-052H)

L9C7E:      PUSH    HL
            LD      HL,L27D0
            PUSH    HL
            POP     IX
            LD      IY,L9CDF
            LD      B,004H
L9C8B:      PUSH    BC
            PUSH    HL
            PUSH    IX
            POP     HL
            LD      DE,L27D0
            XOR     A
            SBC     HL,DE
            LD      (IY+004H),L
            POP     HL
            LD      (09CA2H),SP
            CALL    L9CED
L9CA1:      LD      SP,L0000
            POP     BC
            INC     HL
            INC     IY
            DJNZ    L9C8B               ; (-01fH)
            LD      B,003H
            RST     018H
            DB      023H
            LD      BC,00100H
            LD      HL,L27D0
            LD      DE,L2ED0
            LDIR    
            LD      B,004H
            LD      HL,L9CE3
L9CBE:      LD      E,(HL)
            LD      D,000H
            INC     HL
            PUSH    HL
            LD      HL,L2ED0
            ADD     HL,DE
            LD      A,(HL)
            CP      0FFH
            JR      Z,L9CD4             ; (+008H)
            LD      A,004H
            SUB     B
            PUSH    BC
            EX      DE,HL
            RST     018H
            DB      021H
            POP     BC
L9CD4:      POP     HL
            DJNZ    L9CBE               ; (-019H)
            LD      B,001H
            RST     018H
            DB      023H
            POP     HL
            JP      L9C0D

L9CDF:      LD      (BC),A
            LD      (BC),A
            LD      (BC),A
            LD      (BC),A
L9CE3:      NOP     
            NOP     
            NOP     
            NOP     
L9CE7:      NOP     
L9CE8:      NOP     
L9CE9:      NOP     
            NOP     
L9CEB:      NOP     
L9CEC:      NOP     
L9CED:      CALL    L9E36
L9CF0:      CALL    HLFTCH
            CALL    L9E0C
            JR      C,L9CFF             ; (+007H)
            LD      C,000H
            CALL    L9D60
            JR      L9D1F               ; (+020H)

L9CFF:      CALL    L9E16
            JP      Z,L9E1E
            LD      B,00CH
            EX      DE,HL
            LD      HL,L9D26
L9D0B:      CP      (HL)
            INC     HL
            JR      Z,L9D17             ; (+008H)
            DEC     B
            JP      Z,0636AH
            INC     HL
            INC     HL
            JR      L9D0B               ; (-00cH)

L9D17:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            EX      DE,HL
            INC     HL
            CALL    L9D24
L9D1F:      JP      C,0636AH
            JR      L9CF0               ; (-034H)

L9D24:      PUSH    BC
            RET     

L9D26:      INC     HL
            LD      D,A
            SBC     A,L
            DEC     HL
            LD      C,L
            SBC     A,L
            RST     010H
            LD      C,L
            SBC     A,L
            DEC     L
            LD      C,D
            SBC     A,L
            RST     008H
            LD      C,D
            DB      09DH,04FH,091H,09DH,04EH,0A0H,09DH,054H,0AAH,09DH,056H,0BCH,09DH,053H,0DEH,09DH,04DH,0ECH,09DH,04CH
            DB      LSRF
            DB      09DH
            DB      00EH
            DB      SIOAD
            DB      011H
            DB      00EH
            DB      00CH
            DB      LSRF
            DB      064H,001H,023H,020H,001H,00CH,011H,00EH,001H
            DB      LSRF
            DB      05EH
            DB      001H
            DB      LSRF
            DB      00CH
            DB      09EH
            DB      0D8H
L9D60:      DB      047H
            DB      023H
            DB      LSRF
            DB      LSFC
            DB      09DH,03FH,0DCH,0D4H,09DH,0D8H,078H,0FEH,052H
            JR      Z,L9D85             ; (+016H)
            PUSH    HL
            LD      HL,09DFDH
            CALL    ADDHLA
            LD      B,(IY+000H)
            INC     B
            LD      A,(HL)
            POP     HL
            ADD     A,C
            SUB     00CH
L9D7F:      ADD     A,00CH
            DJNZ    L9D7F               ; (-004H)
            JR      L9DA4               ; (+01fH)

L9D85:      XOR     A
L9D86:      PUSH    AF
            CALL    L9E29
            POP     AF
L9D8B:      LD      (IX+000H),A
            INC     IX
            RET     

            CALL    L9DFC
            JR      NC,L9D98            ; (+002H)
            LD      A,002H
L9D98:      CP      007H
            CCF     
            RET     C
            LD      (IY+000H),A
            RET     

            CALL    L9DFC
            RET     C
L9DA4:      CP      054H
            CCF     
            RET     C
            JR      L9D86               ; (-024H)

            CALL    L9DFC
            JR      NC,L9DB1            ; (+002H)
            LD      A,004H
L9DB1:      DEC     A
            CP      007H
            CCF     
            RET     C
            ADD     A,06AH
            LD      (L9E45),A
            RET     

            CALL    L9DFC
            JR      NC,L9DC3            ; (+002H)
            LD      A,00FH
L9DC3:      CP      010H
            CCF     
            RET     C
            ADD     A,080H
            LD      (L9E46),A
            RET     

            CALL    L9DFC
            JR      NC,L9DD4            ; (+002H)
            LD      A,005H
L9DD4:      CP      00AH
            CCF     
            RET     C
            ADD     A,060H
            LD      (L9E47),A
            RET     

            CALL    L9DFC
            RET     C
            CP      009H
            CCF     
            RET     C
            ADD     A,090H
            LD      (L9E48),A
            RET     

            CALL    L9DFC
            RET     C
            OR      A
            SCF     
            RET     Z
            LD      B,A
            LD      C,0A0H
            LD      (09E49H),BC
            OR      A
            RET     

L9DFC:      CALL    HLFTCH
            CALL    L9E16
            SCF     
            CALL    NZ,L79F6
            RET     C
            RST     018H
            DB      013H
            JP      L8540

L9E0C:      CP      052H
            RET     Z
            CP      041H
            RET     C
            CP      048H
            CCF     
            RET     

L9E16:      OR      A
            RET     Z
            CP      00DH
            RET     Z
            CP      0C8H
            RET     

L9E1E:      CALL    L9E29
            LD      A,0FFH
            CALL    L9D8B
            JP      L9CA1

L9E29:      LD      DE,L9E45
            LD      B,006H
L9E2E:      LD      A,(DE)
            OR      A
            CALL    NZ,L9D8B
            INC     DE
            DJNZ    L9E2E               ; (-008H)
L9E36:      LD      DE,L9E45
            LD      B,006H
            JP      ?CLRDE

            ADD     HL,BC
            DEC     BC
            NOP     
            LD      (BC),A
            INC     B
            DEC     B
            RLCA    
L9E45:      NOP     
L9E46:      NOP     
L9E47:      NOP     
L9E48:      NOP     
            NOP     
            NOP     
L9E4B:      DS      2, 000H
L9E4D:      DS      2, 000H
L9E4F:      DS      2, 000H
L9E51:      DS      2, 000H
L9E53:      DB      000H
L9E54:      DB      000H
L9E55:      DS      2, 000H
L9E57:      DS      2, 000H
L9E59:      DS      4, 000H
L9E5D:      DB      000H
L9E5E:      DS      2, 000H
            DB      015H
            DB      000H
            DB      0EBH
            DB      0FFH
            DS      2, 000H
L9E66:      DS      2, 000H
L9E68:      DS      2, 000H
L9E6A:      DS      7, 000H
L9E71:      DB      000H
L9E72:      DS      3, 000H
L9E75:      DB      000H
L9E76:      DS      4, 000H
L9E7A:      DB      000H
L9E7B:      DS      8, 000H
L9E83:      DS      25, 000H
L9E9C:      DB      008H
L9E9D:      DS      8, 000H
L9EA5:      DS      8, 000H
L9EAD:      DS      8, 000H
L9EB5:      DB      016H
            DB      00DH
            DB      020H
            DS      38, 0D7H
            DS      4, 020H
            DB      "BASIC ",005H,"INTERPRETER"
            DS      2, 020H
            DB      006H,"MZ-5Z"
            DS      2, 030H
            DB      "9 V1.0A"
            DS      2, 020H
            DB      00DH
            DS      3, 020H
            DB      043H,005H,"OPYRIGHT ",006H,"(C) 1984 ",005H,"BY ",006H,"SHARP CORP."
            DS      5, 020H
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
L9F40:      DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      LSSCR
            DB      020H
            DB      00DH
            DB      020H
            DB      005H
            DS      2, 032H
            DB      "340 BYTES FR"
            DS      2, 045H
            DS      2, 00DH
            DS      93, 000H
            LD      C,(HL)
L9FCF:      LD      BC,063CBH
            LD      DE,L9FF7
L9FD5:      LD      A,(DE)
            INC     DE
            ADD     A,A
            JR      Z,L9FE5             ; (+00bH)
            LD      HL,L5C5B
            CALL    ADDHLA
            LD      (HL),C
            INC     HL
            LD      (HL),B
            JR      L9FD5               ; (-010H)

L9FE5:      XOR     A
            LD      (L108F),A
            LD      A,(L1097)
            DEC     A
            CALL    NZ,LA04B
            LD      HL,LA015
            LD      (L1070),HL
            RET     

L9FF7:      AND     D
            AND     E
            AND     H
            AND     L
            AND     (HL)
            AND     A
            XOR     B
            XOR     (HL)
L9FFF:      XOR     A
            OR      B
            OR      C
            OR      E
            CP      E
            CP      H
            CP      L
            NOP     
LA007:      LD      B,001H
            JR      LA00D               ; (+002H)

LA00B:      LD      B,002H
LA00D:      LD      A,(L1097)
            CP      B
            RET     Z
            JP      L63B7

LA015:      CALL    LA01D
            XOR     A
            LD      (L1095),A
            RET     

LA01D:      LD      A,(L108F)
            OR      A
            JP      NZ,L63B7
            CALL    LA468
            CALL    TEST1
            DB      047H
            JP      Z,LA06F
            CALL    TESTX
            DB      054H
            CALL    TEST1
            DB      04EH
            JR      Z,LA042             ; (+00aH)
            CALL    TEST1
            DB      04CH
            DB      028H
            DB      004H
            DB      LSRF
            DB      06EH
            DB      001H
            DB      053H
LA042:      DB      032H
            DB      LSDMD
            DB      09FH
            DB      LSRF
            DB      07AH
            DB      079H
            DB      LSRF
            DB      067H
            DB      0A0H
LA04B:      DB      03EH
            LD      BC,L9732
            DJNZ    0A030H               ; (-021H)
            DB      006H
            LD      A,(09FCEH)
            CP      04EH
            RET     Z
            CP      04CH
            LD      A,00BH
            JR      Z,LA064             ; (+006H)
LA05E:      LD      A,009H
            RST     018H
            DB      006H
            RST     018H
            DB      006H
LA064:      RST     018H
            DB      006H
            RET     

LA067:      LD      A,00AH
            RST     018H
            DB      006H
            LD      A,003H
            JR      LA064               ; (-00bH)

LA06F:      INC     HL
            CALL    L797A
            LD      A,002H
            LD      (L1097),A
            JR      LA064               ; (-016H)

LA07A:      CALL    LA468
            CALL    LA007
            CALL    L8551
            LD      A,E
            OR      A
            RET     Z
            CP      0ECH
            JR      NC,LA08F            ; (+005H)
            CP      015H
            JP      NC,0636AH
LA08F:      CALL    L797A
            BIT     7,E
            JR      NZ,LA09E            ; (+008H)
LA096:      LD      A,00AH
            RST     018H
            DB      006H
            DEC     E
            JR      NZ,LA096            ; (-007H)
            RET     

LA09E:      LD      A,003H
            RST     018H
            DB      006H
            INC     E
            JR      NZ,LA09E            ; (-007H)
            RET     

LA0A6:      PUSH    HL
            LD      HL,L03E7
            JR      LA0B0               ; (+004H)

LA0AC:      PUSH    HL
            LD      HL,L01E0
LA0B0:      PUSH    HL
            ADD     HL,DE
            POP     HL
            JR      C,LA0BA             ; (+005H)
            SBC     HL,DE
            JP      C,0636AH
LA0BA:      POP     HL
            RET     

LA0BC:      LD      C,044H
            LD      DE,04A0EH
            LD      DE,L4D0E
            LD      DE,0520EH
            CALL    LA468
            CALL    LA00B
            LD      A,C
            LD      (0A111H),A
            CP      04DH
            JR      NC,LA0F7            ; (+022H)
            CALL    TEST1
            DB      025H
            JR      NZ,LA0F7            ; (+01cH)
            CALL    L853D
            LD      A,E
            DEC     A
            CP      010H
            JP      NC,0636AH
            DEC     DE
            LD      A,04CH
            RST     018H
            DB      006H
            CALL    LA3CD
            CALL    LA156
            CALL    L5963
            RET     Z
            CALL    L79B4
LA0F7:      CALL    L8551
            CALL    L79B4
            CALL    LA0AC
            PUSH    DE
            CALL    L8551
            CP      02CH
            JR      Z,LA10B             ; (+003H)
            CALL    L797A
LA10B:      CALL    LA0A6
            POP     BC
            PUSH    DE
            LD      A,000H
            RST     018H
            DB      006H
            LD      E,C
            LD      D,B
            CALL    LA3CD
            CALL    LA15A
            POP     DE
            CALL    LA3CD
            CALL    LA156
            CALL    L5963
            RET     Z
            INC     HL
            JR      LA0F7               ; (-033H)

LA12A:      CALL    LA468
            CALL    L853D
            LD      A,E
            CP      004H
            JP      NC,0636AH
            CALL    L797A
            LD      A,(L1097)
            CP      002H
            JR      Z,LA14D             ; (+00dH)
            CALL    LA067
            LD      A,002H
            RST     018H
            DB      006H
            CALL    LA14D
            JP      LA45A

LA14D:      LD      A,043H
            RST     018H
            DB      006H
            LD      A,E
            OR      030H
            RST     018H
            DB      006H
LA156:      LD      A,00DH
            JR      LA15C               ; (+002H)

LA15A:      LD      A,02CH
LA15C:      RST     018H
            DB      006H
            RET     

LA15F:      LD      C,048H
            LD      DE,L490E
            CALL    LA00B
            CALL    L797A
            LD      A,C
            JR      LA15C               ; (-011H)

LA16D:      CALL    LA468
            CALL    LA00B
            CALL    TEST1
            DB      05BH
            JR      NZ,LA1B1            ; (+038H)
            CALL    L853D
            CP      040H
            JP      NC,0636AH
            PUSH    DE
            CALL    L79B1
            CALL    L853D
            CP      004H
            JP      NC,0636AH
            PUSH    DE
            CALL    TESTX
            DB      05DH
            POP     BC
            POP     DE
            PUSH    BC
            LD      A,053H
            RST     018H
            DB      006H
            CALL    LA3CD
            CALL    LA15A
            POP     DE
            LD      A,051H
            RST     018H
            DB      006H
            CALL    LA3CD
            CALL    LA156
            CALL    L5963
            RET     Z
            CALL    L79B4
LA1B1:      CALL    L8561
            CALL    L5963
            JR      Z,LA1BD             ; (+004H)
            CALL    L79B4
            DEC     HL
LA1BD:      LD      A,B
            OR      A
            JR      Z,LA1CE             ; (+00dH)
            LD      A,050H
            RST     018H
            DB      006H
LA1C5:      LD      A,(DE)
            RST     018H
            DB      006H
            INC     DE
            DJNZ    LA1C5               ; (-006H)
            CALL    LA156
LA1CE:      CALL    L5963
            RET     Z
            INC     HL
            JR      LA1B1               ; (-024H)

LA1D5:      CALL    LA00B
            CALL    L853D
            CP      002H
            JP      NC,0636AH
            PUSH    AF
            CALL    L79B1
            CALL    L8551
            PUSH    DE
            CALL    L79B4
            CALL    L853D
            OR      A
            JP      Z,0636AH
            CALL    L797A
            LD      A,058H
            RST     018H
            DB      006H
            POP     BC
            POP     AF
            PUSH    DE
            PUSH    BC
            OR      030H
            RST     018H
            DB      006H
            CALL    LA15A
            POP     DE
            CALL    LA0A6
            CALL    LA3CD
            CALL    LA15A
            POP     DE
            CALL    LA3CD
            JP      LA156

LA215:      CALL    LA00B
            PUSH    HL
            LD      DE,L0000
            LD      HL,LA3AF
            CALL    L79CB
            LD      DE,L0168
            LD      HL,LA3B4
            CALL    L79CB
            LD      HL,L7C40
            LD      DE,LA3B9
            CALL    L79C5
            POP     HL
            CALL    L857C
            CALL    L79B4
            PUSH    HL
            LD      HL,LA3A0
            EX      DE,HL
            CALL    L79C5
            POP     HL
            CALL    L857C
            CALL    L79B4
            PUSH    HL
            LD      HL,LA3A5
            EX      DE,HL
            CALL    L79C5
            POP     HL
            CALL    L857C
            PUSH    HL
            PUSH    AF
            LD      HL,LA3AA
            EX      DE,HL
            CALL    L79C5
            LD      A,(0A3ABH)
            RLCA    
            JP      C,0636AH
            POP     AF
            CP      02CH
            JR      NZ,LA2A5            ; (+03aH)
            POP     HL
            INC     HL
            CALL    L857C
            PUSH    HL
            PUSH    AF
            LD      HL,LA3AF
            EX      DE,HL
            CALL    L79C5
            POP     AF
            CP      02CH
            JR      NZ,LA2A5            ; (+027H)
            POP     HL
            INC     HL
            CALL    L857C
            PUSH    HL
            PUSH    AF
            LD      HL,LA3B4
            EX      DE,HL
            CALL    L79C5
            POP     AF
            CP      02CH
            JR      NZ,LA2A5            ; (+014H)
            POP     HL
            INC     HL
            CALL    L857C
            PUSH    HL
            LD      HL,LA3B9
            EX      DE,HL
            CALL    L79C5
            LD      A,(0A3BAH)
            RLCA    
            JP      C,0636AH
LA2A5:      POP     HL
            CALL    L797A
            PUSH    HL
            LD      HL,LA3B4
            LD      DE,LA3AF
            LD      A,(LA3B9)
            OR      A
            CALL    NZ,L9153
            JP      C,0636AH
            CALL    LA356
            LD      HL,LA3BE
            LD      (0A32EH),HL
            LD      HL,LA3C3
            LD      (0A339H),HL
            CALL    0A32AH
            LD      A,(LA3B9)
            OR      A
            JR      Z,LA304             ; (+032H)
LA2D2:      LD      HL,LA3AF
            LD      DE,LA3B9
            CALL    L90BC
            LD      DE,LA3B4
            CALL    L9153
            JR      NC,LA2EF            ; (+00cH)
            CALL    LA356
            CALL    LA327
            RST     018H
            DB      00EH
            JR      NZ,LA2D2            ; (-01bH)
            POP     HL
            RET     

LA2EF:      CALL    LA2F7
            CALL    LA327
            POP     HL
            RET     

LA2F7:      LD      HL,LA3B4
            LD      DE,LA3AF
            LD      BC,00005H
            LDIR    
            JR      LA356               ; (+052H)

LA304:      LD      HL,LA3A0
            LD      (0A32EH),HL
            LD      HL,LA3A5
            LD      (0A339H),HL
            CALL    LA327
            CALL    LA2F7
            LD      HL,LA3BE
            LD      (0A32EH),HL
            LD      HL,LA3C3
            LD      (0A339H),HL
            CALL    LA327
            POP     HL
            RET     

LA327:      LD      A,044H
            LD      HL,04D3EH
            PUSH    AF
            LD      HL,LA3A0
            CALL    L7BEA
            PUSH    HL
            EX      DE,HL
            CALL    LA0A6
            LD      HL,LA3A5
            CALL    L7BEA
            PUSH    HL
            EX      DE,HL
            CALL    LA0A6
            POP     HL
            POP     DE
            POP     AF
            RST     018H
            DB      006H
            PUSH    HL
            CALL    LA3CD
            CALL    LA15A
            POP     DE
            CALL    LA3CD
            JP      LA156

LA356:      LD      DE,(INTFAC)
            LD      HL,LA3AF
            CALL    L79C5
            LD      HL,(L107C)
            CALL    L98B3
            CALL    L96F9
            LD      DE,LA3AA
            CALL    L92EA
            LD      DE,LA3A0
            CALL    L90BC
            LD      DE,LA3BE
            CALL    L79C5
            LD      DE,(INTFAC)
            LD      HL,LA3AF
            CALL    L79C5
            LD      HL,(L107C)
            CALL    L98B3
            CALL    L9709
            LD      DE,LA3AA
            CALL    L92EA
            LD      DE,LA3A5
            CALL    L90BC
            LD      DE,LA3C3
            JP      L79C5

LA3A0:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3A5:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3AA:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3AF:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3B4:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3B9:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3BE:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3C3:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
LA3CD:      PUSH    AF
            PUSH    HL
            LD      HL,(L107C)
            CALL    L79CB
            CALL    L7B5B
            RST     018H
            DB      017H
LA3DA:      LD      A,(DE)
            RST     018H
            DB      006H
            INC     DE
            DJNZ    LA3DA               ; (-006H)
            POP     HL
            POP     AF
            RET     

LA3E3:      CALL    LA468
            DB      LSRF
            DB      007H
            DB      0A0H
            DB      LSRF
            DB      "zy>",004H,0DFH,006H,0C9H
LA3F1:      DB      LSRF
            DB      007H
            DB      0A0H
            DB      LSRF
            DB      051H,085H,07BH,0B7H,0CAH,06AH,063H,0FEH,049H
            DB      LSD2
            DB      06AH
            DB      063H
            DB      LSRF
            DB      "zy>",009H,0DFH,006H,0DFH,006H,03AH,092H,010H,0CBH,047H,028H,006H
            DB      LSRF
            CALL    0C3A3H
            LD      D,(HL)
            AND     C
            LD      A,E
            LD      DE,L11A4
            CALL    L851A
            DEC     DE
            DEC     DE
            LD      A,(DE)
            RST     018H
            DB      006H
            INC     DE
            LD      A,(DE)
            RST     018H
            DB      006H
            RET     

LA428:      LD      A,(HL)
            CP      09DH
            JR      Z,LA438             ; (+00bH)
            CP      0A1H
            JP      NZ,L6364
            XOR     A
LA433:      LD      (L108F),A
            INC     HL
            RET     

LA438:      CALL    LA007
            CALL    LA468
            LD      A,(09FCEH)
            CP      04CH
            JP      Z,L63B7
            CALL    LA45A
            LD      A,(L108F)
            OR      A
            JR      NZ,LA433            ; (-01cH)
            CALL    L6A8D
            LD      A,016H
            RST     018H
            DB      003H
            OR      001H
            JR      LA433               ; (-027H)

LA45A:      LD      A,001H
            RST     018H
            DB      006H
            LD      A,(L137A)
            CP      003H
            RET     C
            CALL    LA05E
            RET     

LA468:      LD      A,(PSEL)
            BIT     0,A
            JP      Z,L63B7
            RET     

EXECSTART:  XOR     A                   ; Execution entry point
            LD      DE,L0000
            CALL    TIMST
           ;LD      HL,(DTEFG)
           ;PUSH    HL
            LD      DE,L0000
            LD      HL,BASICEND - L0000
            OR      A
            SBC     HL,DE
            LD      C,L
            LD      B,H
            LD      HL,TAPECOPY
            OUT     (LSE0),A
            LDIR    
           ;POP     HL
           ;LD      (L0054),HL
            JP      L0000

            DS      0,11
BASICEND:
