; Disassembly of the file "mz2z009e.bin"
; 
; CPU Type: Z80
; 
; Created with dZ80 2.1
; 
; on Tuesday, 17 of March 2026 at 05:57 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
LSE6        EQU     0E6H
EM_P0       EQU     0EAH
EM_P1       EQU     0EBH
LSPAL       EQU     0F0H
QDPA        EQU     0F2H
QDPB        EQU     0F3H
QDPC        EQU     0F4H
QDPD        EQU     0F5H
FDPA        EQU     0F8H
FDPB        EQU     0F9H
FDPC        EQU     0FAH
FDPD        EQU     0FBH
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
LPT_TM      EQU     01094H
LPOSB       EQU     01095H
PSMAL       EQU     01096H
PNMODE      EQU     01097H
DMD         EQU     01098H
MEMOP       EQU     01099H
PWMODE      EQU     0109AH
CMODE       EQU     0109BH
CPLANE      EQU     0109CH
MAXCF       EQU     0109DH
PMASK       EQU     0109EH
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
SUMDT       EQU     01197H
CSMDT       EQU     01199H
TEMPW       EQU     0119EH
KEYBM1      EQU     011A3H
KEYBUF      EQU     011A4H
KEY262      EQU     012AAH
KEY264      EQU     012ACH
KEY266      EQU     012AEH
FUNBUF      EQU     012B2H
INBUFC      EQU     01352H
INBUFL      EQU     01353H
INBUF       EQU     01354H
TIMST       EQU     00033H
LINLIM      EQU     01364H
KEYDAT      EQU     01365H
AMPM        EQU     01366H
SECD        EQU     01367H
XS          EQU     01369H
XE          EQU     0136AH
CWIDTH      EQU     0136BH
CSIZE       EQU     0136DH
YS          EQU     0136FH
YE          EQU     01370H
YW          EQU     01371H
SOF         EQU     01372H
SW          EQU     01374H
SSA         EQU     01375H
SEA         EQU     01376H
SSW         EQU     01377H
CRTMD1      EQU     01379H
CRTMD2      EQU     0137AH
SELCOL      EQU     0137BH
PAIWED      EQU     0137CH
PALBK       EQU     0137EH
PALAD       EQU     0137FH
PALTBL      EQU     01381H
PAL2T       EQU     01385H
PAL4T       EQU     01389H
PAL16T      EQU     0138DH
CURDT1      EQU     01391H
CURDT2      EQU     01399H
CURDT3      EQU     013A1H
SCRNT0      EQU     013A9H
EMFLG       EQU     013C3H
EMPTR       EQU     013C4H
EMWP0       EQU     013C6H
EMWP1       EQU     013C8H
PBCN        EQU     013CEH
HERRF       EQU     013D9H
CTABLE      EQU     013DAH
FONTBF      EQU     01000H
TEXTBF      EQU     02000H
BITBUF      EQU     08000H
IBUFE       EQU     010F0H
ERRTXT      EQU     0FDA0H
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 2Z-009E   ", 0Dh                              ; Title/Name (17 bytes).
            ENDIF
            IF BUILD_RFS = 1
              DB    "BASIC 2Z-009ERFS", 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      L0CAF               ; Cold start entry - JP to initialization

L0003:      JP      L028C

L0006:      JP      L05EC

            JP      L05E8

L000C:      JP      L0BFD

L000F:      JP      L05F1

L0012:      JP      L0BFF

L0015:      JP      L0BEE

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

            JP      L041C

BRKCHK:     JP      L05C1

            JP      L30CB

            JP      L30D2

L0027:      JP      L3114

            JP      L311B

            JP      L3153

L0030:      JP      L14BC

            JP      L0955

L0036:      LD      B,B
            NOP     
RST38:      JP      BREAKZ              ; RST 38H - Interrupt handler

            JP      L098F

L003E:      JP      L0D3F

L0041:      JP      L0D30

            JP      L0D05

            JP      L0D20

            JP      L028C

L004D:      DB      000H                ; System status / work area
L004E:      DB      000H
L004F:      DB      0FFH
L0050:      DB      000H
            DB      0C3H
            DB      0EEH
            DB      00BH
L0054:      DS      2, 000H
L0056:      DB      000H
L0057:      DB      018H
            DB      0C3H
            DB      08AH
            DB      003H
L005B:      DB      000H
            DB      027H
L005D:      DB      071H
            DB      000H
L005F:      DB      000H
L0060:      DB      0EFH
            DB      0C3H
            DB      037H
            DB      00AH
L0064:      DB      000H
L0065:      DB      000H
L0066:      DB      000H
L0067:      DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      0ADH
            DB      007H
            DB      0F1H
            DB      008H
L0071:      DB      015H
            DB      008H
            DB      012H
            DB      008H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
L0080:      DB      000H
L0081:      DB      0ADH
            DB      007H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      01EH
            DB      008H
            DB      LSWF
            DB      007H
            DB      LSPAL
            DB      007H
            DB      LSD1
            DB      007H
            DB      QDPD
            DB      007H
            DB      054H
            DB      007H
            DB      074H
            DB      007H
            DB      018H
            DB      008H
            DB      0BAH
            DB      008H
            DB      012H
            DB      008H
            DB      LSE5
            DB      000H
            DB      0ADH
            DB      007H
            DB      LSE5
L00A0:      DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      LSE5
.NOP:       DB      000H
.HL:        DS      11, 000H
.RET:       DS      8, 000H
PUSHRA:     DS      6, 000H
L00C0:      DS      7, 000H
PUSHR:      DS      18, 000H
L00D9:      DB      000H
L00DA:      DI      
            LD      SP,L0000
            IM      1
            OUT     (LSE1),A
            JP      L1800

BREAKZ:     RET     

BREAKX:     DI      
            OUT     (LSE3),A
L00E9:      LD      A,(HL)
            OUT     (LSE1),A
            EI      
ERRORJ:     RET     

POPRA:      DI      
            OUT     (LSE3),A
            LD      (HL),A
            OUT     (LSE1),A
            EI      
            RET     

            JP      L026A

L00F9:      NOP     
L00FA:      JP      (HL)

IOOUT:      EX      (SP),IX
            PUSH    HL
            PUSH    BC
            PUSH    DE
L0100:      PUSH    AF
            PUSH    HL
            LD      HL,L0114
            EX      (SP),HL
            JP      (IX)

SKPDE:      EX      (SP),IX
            PUSH    HL
            PUSH    BC
            PUSH    DE
DEVASC:     PUSH    HL
            LD      HL,L0115
            EX      (SP),HL
            JP      (IX)

L0114:      POP     AF
L0115:      POP     DE
            POP     BC
            POP     HL
            POP     IX
            RET     

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
            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
            JR      L0182               ; (+007H)

L017B:      XOR     A
            LD      HL,0803EH
            LD      HL,L80F6
L0182:      PUSH    AF
            CALL    L0D20
            POP     AF
            JP      L0000

L018A:      LD      A,H
            DEC     A
            CALL    PE,0E805H
            DEC     B
            RST     038H
            DEC     BC
            LD      B,E
            INC     C
            EX      AF,AF'
            ADD     HL,BC
            XOR     C
            RRCA    
            LD      A,00FH
            RET     Z
            DEC     BC
            JP      Z,0D80BH
            DEC     BC
            AND     00BH
L01A2:      ADC     A,H
            LD      (BC),A
            ADC     A,D
            INC     BC
            POP     BC
            DEC     B
            AND     B
            INC     D
            ADD     A,A
            LD      A,(BC)
            ADC     A,C
            LD      A,(BC)
            SCF     
            LD      A,(BC)
            LD      B,(HL)
            INC     D
            HALT    
            INC     D
            SUB     C
            INC     D
            LD      B,014H
            LD      E,H
            LD      (BC),A
            POP     HL
            INC     C
            RET     PE
            INC     C
            RST     028H
            INC     C
            PUSH    HL
            INC     D
            AND     H
            INC     DE
            LD      (HL),D
            INC     DE
            LD      C,E
            LD      B,LSE5
            NOP     
            LD      A,00DH
            JR      NC,L01CE            ; (+000H)
L01CE:      PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            ADC     A,A
            ADD     HL,BC
            LD      D,L
            ADD     HL,BC
            PUSH    HL
L01D9:      NOP     
            RET     PE
            DEC     DE
            IN      A,(01EH)
            DEC     E
            RRA     
L01E0:      POP     AF
            LD      E,03DH
            LD      A,(DE)
            CP      B
            LD      A,(DE)
            RET     PO
            ADD     HL,DE
            LD      (HL),C
            DEC     DE
            OR      H
            INC     E
            RET     C
            INC     E
            RET     

            INC     E
            POP     HL
            LD      A,(DE)
            RET     NC
            JR      L01D9               ; (-01cH)

            JR      00243H               ; (+04cH)

            ADD     HL,DE
            RRCA    
            JR      L01A2               ; (-059H)

            DEC     DE
            DEC     DE
            DEC     E
            DB      0DDH
            INC     D
L0200:      PUSH    HL
            NOP     
            LD      E,B
            LD      E,067H
            INC     L
            OR      (HL)
            INC     L
            LD      B,(HL)
            INC     L
            NOP     
            ADD     HL,HL
            SBC     A,L
            LD      HL,(02925H)
            XOR     E
            RRA     
            CALL    M,L742A
            RLCA    
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
SVC_DISP:   EX      (SP),HL
            PUSH    AF
            LD      A,(HL)
            INC     HL
            PUSH    HL
            LD      HL,L018A
            ADD     A,A
            ADD     A,L
            JR      NC,L0237            ; (+001H)
            INC     H
L0237:      LD      L,A
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            LD      (00243H),HL
            POP     HL
            POP     AF
            EX      (SP),HL
            JP      L0000

IOCALL:     PUSH    HL
            PUSH    DE
            LD      (00251H),IX
            LD      IX,00180H
            OR      A
            CALL    L0000
            POP     DE
            POP     HL
            RET     NC
            OR      A
            SCF     
L0258:      RET     Z
            JP      00180H

            PUSH    DE
            LD      B,000H
L025F:      LD      A,(DE)
            OR      A
            JR      Z,L0268             ; (+005H)
            INC     DE
            INC     B
            JR      NZ,L025F            ; (-008H)
            DEC     B
L0268:      POP     DE
            RET     

L026A:      PUSH    HL
            LD      HL,(L0054)
            PUSH    HL
            PUSH    DE
            CALL    PUSHW
            POP     DE
            LD      (HL),000H
            POP     HL
            CALL    L028C
            JR      C,L028A             ; (+00eH)
            LD      A,(L005B)
            SUB     L
            JR      NC,L028A            ; (+008H)
            NEG     
            LD      L,A
            LD      H,000H
            ADD     HL,DE
            EX      DE,HL
            OR      A
L028A:      POP     HL
            RET     

L028C:      PUSH    BC
            PUSH    HL
            PUSH    DE
L028F:      CALL    L0391
            CP      00DH
            JP      Z,L0311
            CP      01BH
            JR      Z,L02E8             ; (+04dH)
            PUSH    AF
            CP      020H
DEASC:      JR      C,L02CD             ; (+02dH)
            JR      L02C8               ; (+026H)

L02A2:      LD      A,(L004D)
            OR      A
            JR      NZ,L02C8            ; (+020H)
            LD      A,(00B18H)
            RRCA    
            JR      C,L02C8             ; (+01aH)
            LD      A,(L004E)
            OR      A
            JR      NZ,L02C8            ; (+014H)
            POP     AF
            LD      HL,L06C1
            CP      011H
            JR      Z,L02C3             ; (+007H)
            LD      HL,L06E7
            CP      012H
            JR      NZ,L02C9            ; (+006H)
L02C3:      CALL    L00FA
            JR      L028F               ; (-039H)

L02C8:      POP     AF
L02C9:      RST     018H
            DB      003H
            JR      L028F               ; (-03eH)

L02CD:      LD      A,(L0060)
            CP      0FFH
            JR      NZ,L02A2            ; (-032H)
            POP     AF
            CP      017H
            JR      NC,L02C9            ; (-010H)
            CP      011H
            JR      C,L02C9             ; (-014H)
            LD      HL,(00B18H)
            BIT     6,L
            JR      Z,L02C9             ; (-01bH)
            RST     018H
            DB      004H
            JR      L028F               ; (-059H)

L02E8:      SCF     
CKHEX:      PUSH    AF
            LD      A,00DH
            RST     018H
            DB      003H
            POP     AF
            POP     DE
            POP     HL
            POP     BC
            RET     

L02F3:      CALL    PUSHW
L02F6:      LD      A,(HL)
            OR      A
MHALT:      RET     Z
            DEC     HL
            DEC     E
            LD      A,(L0056)
            CP      E
            JR      C,L02F6             ; (-00bH)
            RET     

L0302:      CALL    PUSHW
L0305:      INC     E
            INC     HL
            LD      A,(HL)
            OR      A
            RET     Z
            LD      A,(L0057)
            CP      E
            JR      NC,L0305            ; (-00bH)
            RET     

L0311:      LD      HL,(L0054)
SETDFL:     CALL    L02F3
            LD      D,E
            CALL    L0305
            LD      A,(L005B)
            LD      L,A
            LD      A,E
            SUB     D
            LD      E,A
            LD      H,D
ADDP1:      LD      D,L
            RST     018H
            DB      01EH
            LD      A,(0005CH)
            SUB     D
ADDP2:      INC     A
            LD      D,A
            POP     BC
            PUSH    BC
            EXX     
            PUSH    HL
            LD      HL,(L004F)
            EXX     
L0334:      PUSH    DE
            PUSH    HL
L0336:      CALL    BREAKX
            RST     018H
            DB      01CH
            INC     HL
            LD      (BC),A
            INC     BC
L033E:      EXX     
            DEC     L
ERRX:       JR      Z,L0354             ; (+012H)
            EXX     
            DEC     D
            JR      NZ,L0336            ; (-010H)
            POP     HL
            PUSH    BC
            LD      BC,00028H
            ADD     HL,BC
            POP     BC
            POP     DE
            DEC     E
            JR      NZ,L0334            ; (-01dH)
            PUSH    DE
            PUSH    HL
            EXX     
L0354:      EXX     
            POP     HL
            POP     DE
            EXX     
            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,CKHEX
            DEC     HL
L036D:      LD      A,(HL)
            OR      A
            JR      Z,L0376             ; (+005H)
            CP      D
            JR      NZ,L037D            ; (+009H)
            LD      (HL),000H
L0376:      DEC     HL
            DJNZ    L036D               ; (-00cH)
            OR      A
            JP      CKHEX

L037D:      LD      A,(HL)
            OR      A
            JR      NZ,L0383            ; (+002H)
            LD      (HL),020H
L0383:      DEC     HL
            DJNZ    L037D               ; (-009H)
            OR      A
            JP      CKHEX

            INC     A
            JR      Z,L0406             ; (+079H)
            DEC     A
            JP      Z,L041C
L0391:      CALL    L0426
            CALL    SKPDE
SETDNM:     CALL    L0648
            CALL    BREAKX
            LD      D,A
            LD      A,(L0060)
            LD      E,A
            CALL    POPRA
            XOR     A
            DI      
            OUT     (LSE3),A
            LD      (0E000H),A
            CPL     
            LD      (0E000H),A
            OUT     (LSE1),A
            EI      
            LD      C,000H
            EX      AF,AF'
            PUSH    AF
            CALL    L0459
            LD      A,000H
L03BC:      EX      AF,AF'
L03BD:      LD      B,010H
L03BF:      CALL    L043C
            CALL    L0459
            BIT     1,A
            JR      NZ,L03BD            ; (-00cH)
            DJNZ    L03BF               ; (-00cH)
            BIT     0,A
            JR      Z,L03DB             ; (+00cH)
            BIT     2,A
            JR      NZ,L03EC            ; (+019H)
            EX      AF,AF'
            DEC     A
            JR      NZ,L03BC            ; (-01bH)
            LD      A,006H
            JR      L03EE               ; (+013H)

L03DB:      PUSH    HL
            PUSH    DE
            PUSH    BC
            LD      HL,INKEY1
            LD      DE,L0B17
            LD      BC,0000AH
L03E7:      LDIR    
            POP     BC
            POP     DE
            POP     HL
L03EC:      LD      A,040H
L03EE:      LD      (003BBH),A
L03F1:      CALL    L043C
            CALL    L0494
            OR      A
            JR      Z,L03F1             ; (-009H)
            LD      (L005F),A
            LD      C,A
            LD      A,D
            CALL    POPRA
            POP     AF
            EX      AF,AF'
            LD      A,C
            RET     

L0406:      CALL    L0426
            PUSH    HL
            CALL    L0494
            LD      HL,L005F
            OR      A
            JR      Z,L0419             ; (+006H)
            CP      (HL)
            JR      NZ,L0419            ; (+003H)
            POP     HL
            XOR     A
            RET     

L0419:      LD      (HL),A
            POP     HL
            RET     

L041C:      CALL    L0426
            CALL    L0494
            LD      (L005F),A
            RET     

L0426:      PUSH    HL
            LD      HL,(L1360)
            LD      A,L
            CP      H
            POP     HL
            RET     Z
            EX      (SP),HL
            INC     A
            LD      (L1360),A
            LD      HL,L1361
            CALL    ADDHLA
            LD      A,(HL)
            POP     HL
            RET     

L043C:      DI      
            OUT     (LSE3),A
            LD      A,(0E002H)
            OUT     (LSE1),A
            EI      
            RLCA    
            RLCA    
            LD      A,C
            JR      C,L0451             ; (+007H)
            OR      A
            RET     Z
            LD      C,000H
            LD      A,D
DPALBK:     JR      L0456               ; (+005H)

L0451:      DEC     A
            RET     Z
            LD      C,001H
            LD      A,E
L0456:      JP      POPRA

L0459:      CALL    SKPDE
            LD      DE,INKEY1
            LD      HL,L0B17
            LD      BC,L0A00
            DI      
            OUT     (LSE3),A
L0468:      LD      A,B
            ADD     A,0EFH
            LD      (0E000H),A
            CP      FDPA
            LD      A,(0E001H)
            JR      NZ,L0477            ; (+002H)
            OR      07FH
L0477:      CP      0FFH
            JR      Z,L047D             ; (+002H)
            SET     0,C
L047D:      EX      DE,HL
            CP      (HL)
            LD      (HL),A
            EX      DE,HL
            JR      Z,L0485             ; (+002H)
            SET     1,C
L0485:      CPL     
            AND     (HL)
            JR      Z,L048B             ; (+002H)
            SET     2,C
L048B:      INC     HL
            INC     DE
            DJNZ    L0468               ; (-027H)
            LD      A,C
L0490:      OUT     (LSE1),A
            EI      
DGCOL:      RET     

L0494:      CALL    SKPDE
            LD      HL,L0B17
            LD      DE,INKEY1
            PUSH    HL
            PUSH    DE
            LD      BC,0000AH
            LDIR    
            POP     HL
            POP     DE
            LD      BC,L0AF9
            DI      
            OUT     (LSE3),A
            LD      A,C
            LD      (0E000H),A
            NOP     
            LD      A,(0E001H)
            LD      (DE),A
L04B5:      LD      A,C
            LD      (0E000H),A
            CP      FDPA
            LD      A,(0E001H)
            LD      (DE),A
            JR      Z,L04E4             ; (+023H)
            CPL     
            AND     (HL)
L04C3:      LD      (HL),A
            INC     DE
            INC     HL
            DEC     C
            DJNZ    L04B5               ; (-014H)
            OUT     (LSE1),A
            EI      
            LD      BC,L0A00
L04CF:      DEC     HL
            LD      A,(HL)
            OR      A
            JR      NZ,L0507            ; (+033H)
            INC     C
            DJNZ    L04CF               ; (-008H)
            LD      B,00AH
L04D9:      DEC     DE
            LD      A,(DE)
            CP      0FFH
            JR      NZ,L04E7            ; (+008H)
L04DF:      DJNZ    L04D9               ; (-008H)
L04E1:      XOR     A
            JR      L0490               ; (-054H)

L04E4:      XOR     A
            JR      L04C3               ; (-024H)

L04E7:      LD      A,B
            CP      002H
            JR      NZ,L04F5            ; (+009H)
L04EC:      LD      A,(DE)
            AND     081H
DWIDTH:     JR      NZ,L04DF            ; (-012H)
            LD      A,01BH
            JR      L0490               ; (-065H)

L04F5:      CP      001H
            JR      Z,L04E1             ; (-018H)
            CP      000H
            JR      NZ,L04DF            ; (-01eH)
            LD      A,(DE)
            AND     001H
            JR      NZ,L04DF            ; (-023H)
            LD      A,(L005F)
            JR      L0490               ; (-077H)

L0507:      PUSH    AF
            LD      A,B
            LD      (004FAH),A
            LD      A,(HL)
            LD      (004FFH),A
            POP     AF
            DEC     B
            JR      NZ,L054A            ; (+036H)
            CALL    L05B7
            LD      A,(00B18H)
            BIT     6,A
            JR      Z,L04E1             ; (-03dH)
            BIT     0,A
            LD      A,B
            JR      NZ,L0525            ; (+002H)
            ADD     A,005H
L0525:      CP      00AH
            JR      NC,L04E1            ; (-048H)
            LD      L,A
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            LD      BC,L12C0
            ADD     HL,BC
            LD      A,(HL)
            OR      A
            JR      Z,L04E1             ; (-057H)
            LD      DE,L1360
            LD      A,001H
            LD      (DE),A
L053E:      INC     DE
            LD      BC,00010H
            LDIR    
            LD      A,(01362H)
            JP      L0490

L054A:      CALL    L05B7
            LD      A,C
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,B
            LD      L,A
            LD      H,000H
            LD      A,(00B18H)
            BIT     6,A
            LD      BC,L0B2B
            JR      Z,L058E             ; (+02fH)
            PUSH    AF
            LD      A,(L0060)
            CP      043H
            JR      NZ,L056B            ; (+004H)
            POP     AF
            XOR     001H
            PUSH    AF
L056B:      POP     AF
            BIT     0,A
            JR      NZ,L0573            ; (+003H)
            LD      BC,L0B3D
L0573:      LD      A,(L0060)
            CP      0FFH
            JR      NZ,L0587            ; (+00dH)
            LD      BC,L0B4F
            LD      A,(00B18H)
            BIT     0,A
            JR      Z,L0587             ; (+003H)
            LD      BC,L0B61
L0587:      CALL    L13E0
            LD      A,C
            JP      L0490

L058E:      CALL    L13E0
            LD      A,C
            CP      020H
            JP      C,L0490
            LD      HL,L0B73
            LD      B,005H
L059C:      CP      (HL)
            JR      Z,L05B1             ; (+012H)
            INC     HL
            DJNZ    L059C               ; (-006H)
            CP      040H
            JP      C,L04E1
            CP      05BH
            JP      NC,L04E1
            SUB     040H
            JP      L0490

L05B1:      LD      A,020H
            SUB     B
            JP      L0490

L05B7:      LD      B,008H
L05B9:      RRCA    
            JR      C,L05BF             ; (+003H)
            DJNZ    L05B9               ; (-005H)
            RET     

L05BF:      DEC     B
            RET     

L05C1:      LD      A,0E8H
            DI      
            OUT     (LSE3),A
            LD      (0E000H),A
            NOP     
            LD      A,(0E001H)
            OUT     (LSE1),A
            EI      
            AND     081H
            RET     Z
            RLCA    
            RET     C
            JR      L05C1               ; (-016H)

L05D7:      CALL    SKPDE
            LD      HL,(L0054)
            LD      A,(L005B)
            CP      L
            RET     C
            CALL    PUSHW
            LD      A,(HL)
            OR      A
            RET     

L05E8:      CALL    L05D7
            RET     Z
L05EC:      LD      A,00DH
            JP      L0BFF

L05F1:      CALL    L0BFD
            LD      A,(L0054)
L05F7:      SUB     00AH
LBOUND:     JR      NC,L05F7            ; (-004H)
            ADD     A,00AH
            RET     Z
            JR      L05F1               ; (-00fH)

L0600:      CALL    IOOUT
            LD      HL,(L0054)
            PUSH    HL
            PUSH    AF
            RST     018H
            DB      01EH
            POP     AF
            RST     018H
            DB      01DH
            CALL    POPRA
            SET     3,H
            LD      DE,(0005DH)
            LD      A,E
            OR      D
            CALL    POPRA
            POP     HL
            INC     L
HCLSW:      LD      A,(0005CH)
            CP      L
            JP      NC,L07EC
L0624:      LD      A,(L005B)
            LD      L,A
            INC     H
            PUSH    HL
            CALL    PUSHW
            LD      (HL),001H
            POP     HL
            LD      A,(L0057)
            CP      H
            JP      NC,L07EC
            LD      H,A
            PUSH    HL
            CALL    L0730
            POP     HL
            JP      L07EC

PUSHW:      LD      E,H
            LD      D,000H
            LD      HL,.HL
            ADD     HL,DE
            RET     

L0648:      LD      HL,(L0054)
            PUSH    DE
            PUSH    AF
            LD      D,LSD0
            LD      E,L
            LD      A,H
            ADD     A,A
HCLS:       ADD     A,A
            ADD     A,H
            LD      L,A
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,DE
L065B:      POP     AF
            POP     DE
            RET     

L065E:      ADD     A,A
            LD      HL,L0067
            CALL    ADDHLA
            CALL    INDRCT
            JP      (HL)

L0669:      LD      B,D
            LD      C,E
L066B:      LD      DE,00028H
            EX      DE,HL
            ADD     HL,DE
            DEC     B
            JR      Z,L067E             ; (+00bH)
            PUSH    HL
            PUSH    BC
            LD      B,000H
            CALL    L069E
            POP     BC
            POP     HL
            JR      L066B               ; (-013H)

L067E:      EX      DE,HL
            LD      E,C
L0680:      LD      A,(L005D)
            LD      D,A
            LD      A,(0005EH)
            OR      D
            LD      D,A
L0689:      DI      
            OUT     (LSE3),A
            LD      (HL),000H
            SET     3,H
            LD      (HL),D
            RES     3,H
            OUT     (LSE1),A
            EI      
            INC     HL
            DEC     E
            JR      NZ,L0689            ; (-011H)
            RET     

L069B:      LD      BC,00028H
L069E:      LD      A,0B0H
            JR      L06A4               ; (+002H)

L06A2:      LD      A,0B8H
L06A4:      LD      (006BCH),A
            PUSH    HL
            PUSH    DE
            PUSH    BC
            RES     3,H
            RES     3,D
            CALL    L06B8
            POP     BC
            POP     DE
            POP     HL
            SET     3,H
            SET     3,D
L06B8:      DI      
            OUT     (LSE3),A
            LDIR    
            OUT     (LSE1),A
            EI      
            RET     

L06C1:      LD      HL,0D000H
            LD      DE,0D7D0H
            CALL    L069B
            LD      HL,0D028H
            LD      DE,0D000H
            LD      B,032H
L06D2:      PUSH    BC
            CALL    L069B
            POP     BC
            DJNZ    L06D2               ; (-007H)
            LD      HL,.HL
            LD      D,H
            LD      E,L
            LD      A,(HL)
            INC     HL
            LD      BC,00031H
            LDIR    
            LD      (DE),A
            RET     

L06E7:      LD      HL,0D7CFH
            LD      DE,0D7F7H
            LD      B,032H
L06EF:      PUSH    BC
            LD      BC,00028H
            CALL    L06A2
            POP     BC
            DJNZ    L06EF               ; (-00aH)
            LD      HL,0D7D0H
            LD      DE,0D000H
            CALL    L069B
            LD      HL,L00D9
            LD      D,H
            LD      E,L
            DEC     HL
            LD      A,(DE)
            LD      BC,00031H
            LDDR    
            LD      (DE),A
            RET     

L0710:      LD      HL,0D3E8H
            XOR     A
            CALL    POPRA
            SET     3,H
            LD      A,(L005D)
            CALL    POPRA
            LD      DE,0D3E9H
            LD      BC,L0027
            CALL    L069E
            CALL    L06C1
            XOR     A
            LD      (L00C0),A
            RET     

L0730:      LD      A,(L004E)
            OR      A
            JR      Z,L0710             ; (-026H)
            CALL    L075F
            CALL    L0669
            LD      A,(L0056)
            LD      H,A
            CALL    PUSHW
            LD      A,(L0057)
            SUB     E
            LD      B,A
            LD      (HL),000H
            INC     HL
            LD      D,H
            LD      E,L
            INC     DE
            CALL    NZ,LDHLDE
            LD      (HL),000H
            RET     

L0754:      LD      A,(L005B)
            LD      L,A
            LD      A,(L0056)
            LD      H,A
            JP      L07EC

L075F:      LD      HL,(L005B)
            LD      DE,(00056H)
            LD      A,D
            SUB     E
            INC     A
            LD      D,A
            LD      A,H
            SUB     L
            INC     A
            LD      E,A
            CALL    L0754
            JP      L0648

            CALL    SKPDE
            LD      A,(L004E)
            OR      A
            JR      NZ,L078B            ; (+00eH)
            LD      A,031H
            LD      (L0057),A
            CALL    L078B
            LD      A,018H
            LD      (L0057),A
            RET     

L078B:      CALL    L075F
L078E:      PUSH    DE
            PUSH    HL
            CALL    L0680
            POP     HL
            LD      BC,00028H
            ADD     HL,BC
            POP     DE
            DEC     D
            JR      NZ,L078E            ; (-00eH)
            LD      A,(L0056)
            LD      H,A
            CALL    PUSHW
            LD      A,(L0057)
            SUB     E
            ADD     A,002H
            LD      B,A
            JP      ?CLRHL

            XOR     A
            LD      (0091FH),A
            LD      HL,(L0054)
            PUSH    HL
            INC     H
            CALL    PUSHW
            LD      A,(L0057)
            LD      D,A
L07BD:      LD      A,(HL)
            OR      A
            JR      Z,L07C7             ; (+006H)
            INC     HL
            INC     E
            LD      A,D
            CP      E
            JR      NC,L07BD            ; (-00aH)
L07C7:      DEC     E
            POP     HL
            LD      H,E
            JR      L07DB               ; (+00fH)

            LD      HL,(L0054)
            JR      L07DF               ; (+00eH)

            LD      HL,(L0054)
            INC     L
            LD      A,(0005CH)
            CP      L
            JR      NC,L07EC            ; (+011H)
L07DB:      LD      A,(L005B)
            LD      L,A
L07DF:      INC     H
            LD      A,(L0057)
            CP      H
            JR      NC,L07EC            ; (+006H)
            LD      H,A
            PUSH    HL
            CALL    L0730
            POP     HL
L07EC:      LD      (L0054),HL
            RET     

            LD      HL,(L0054)
            JR      L0802               ; (+00dH)

            LD      HL,(L0054)
            LD      A,(L005B)
            CP      L
            JR      C,0080DH             ; (+00fH)
            LD      A,(0005CH)
            LD      L,A
L0802:      LD      A,(L0056)
            CP      H
            JR      C,0080FH             ; (+007H)
            LD      A,(L0056)
            LD      H,A
            LD      A,02DH
            LD      A,025H
            JR      L07EC               ; (-026H)

            LD      A,0EFH
            LD      HL,0433EH
            LD      HL,0FF3EH
            LD      (L0060),A
            RET     

            LD      HL,(L0054)
            LD      BC,(0005BH)
            LD      A,L
            DEC     L
            INC     C
            CP      C
            JR      NC,L0837            ; (+00cH)
            PUSH    HL
            CALL    PUSHW
            LD      A,(HL)
            POP     HL
            INC     L
            OR      A
            JR      Z,L0874             ; (+03fH)
            LD      L,B
            DEC     H
L0837:      LD      DE,(00054H)
            LD      (L0054),HL
L083E:      EX      DE,HL
            LD      A,(L005B)
            CP      L
            JR      C,L086D             ; (+028H)
L0845:      PUSH    HL
            CALL    PUSHW
            LD      A,(HL)
            POP     HL
            OR      A
            JR      Z,L085D             ; (+00fH)
            CALL    L0882
            PUSH    HL
            LD      A,(0005CH)
            LD      L,A
            DEC     H
            CALL    L089A
            POP     HL
            JR      L0874               ; (+017H)

L085D:      LD      A,(0005CH)
            LD      L,A
            DEC     H
L0862:      LD      DE,(0005DH)
            LD      A,E
            OR      D
            LD      E,A
            LD      D,000H
            JR      L089A               ; (+02dH)

L086D:      CALL    L0882
            DEC     BC
            CALL    L0895
L0874:      INC     L
            LD      A,(0005CH)
            CP      L
            JR      NC,L086D            ; (-00eH)
            LD      A,(L005B)
            LD      L,A
            INC     H
            JR      L0845               ; (-03dH)

L0882:      PUSH    HL
            RST     018H
            DB      01EH
            SET     3,H
            CALL    BREAKX
            LD      E,A
            RES     3,H
            CALL    BREAKX
            LD      D,A
            LD      B,H
            LD      C,L
            POP     HL
            RET     

L0895:      PUSH    HL
            LD      H,B
            LD      L,C
            JR      L089D               ; (+003H)

L089A:      PUSH    HL
            RST     018H
            DB      01EH
L089D:      SET     3,H
            LD      A,E
            CALL    POPRA
            RES     3,H
            LD      A,D
            CALL    POPRA
            LD      B,H
            LD      C,L
            POP     HL
            RET     

L08AD:      LD      HL,(L0054)
            CALL    L0302
            DEC     E
            LD      H,E
            LD      A,(0005CH)
            LD      L,A
            RET     

            CALL    L08AD
            CALL    L0882
            LD      A,LSPAL
            CP      D
            JR      Z,L08C8             ; (+003H)
            XOR     A
            CP      D
            RET     NZ
L08C8:      LD      BC,(0005BH)
            EX      DE,HL
            LD      HL,(L0054)
            OR      A
            SBC     HL,DE
            EX      DE,HL
            JR      Z,L0862             ; (-074H)
            LD      A,C
            CP      L
            JR      NC,L08E4            ; (+00aH)
            DEC     L
            CALL    L0882
            INC     BC
            CALL    L0895
            JR      L08C8               ; (-01cH)

L08E4:      PUSH    HL
            LD      L,B
            DEC     H
            CALL    L0882
            EX      (SP),HL
            CALL    L089A
            POP     HL
            JR      L08C8               ; (-029H)

            LD      HL,L0071
            LD      (L005D),HL
L08F7:      LD      HL,L1800
            LD      (L0056),HL
            LD      HL,L2700
            LD      (L005B),HL
            XOR     A
            LD      (L004E),A
            RET     

            CALL    SKPDE
L090B:      LD      A,(DE)
            INC     DE
            OR      A
            RET     Z
            LD      C,A
            CP      005H
            JR      Z,L0933             ; (+01fH)
            CP      006H
            JR      Z,L0932             ; (+01aH)
            SUB     041H
            CP      01AH
            JR      NC,HCURON           ; (+00dH)
            LD      A,000H
            OR      A
            JR      Z,HCURON            ; (+008H)
            LD      A,C
            LD      HL,L08F7
            CALL    ADDHLA
            LD      C,(HL)
HCURON:     LD      A,C
            RST     018H
            DB      003H
            CP      00DH
            JR      NZ,L090B            ; (-027H)
L0932:      XOR     A
L0933:      LD      (0091FH),A
            JR      L090B               ; (-02dH)

            AND     C
            SBC     A,D
            SBC     A,A
HCUROF:     SBC     A,H
            SUB     D
            XOR     D
            SUB     A
            SBC     A,B
            AND     (HL)
            XOR     A
            XOR     C
            CP      B
            OR      E
FLASH:      OR      B
            OR      A
            SBC     A,(HL)
            AND     B
            SBC     A,L
            AND     H
            SUB     (HL)
            AND     L
CURMOV:     XOR     E
            AND     E
            SBC     A,E
            CP      L
            AND     D
            NOP     
            NOP     
L0954:      NOP     
L0955:      PUSH    DE
            PUSH    HL
            LD      (L0954),A
            LD      (00952H),DE
            LD      HL,0E007H
            DI      
            OUT     (LSE3),A
            LD      (HL),0B4H
            LD      (HL),074H
            DEC     HL
            LD      (HL),0C0H
            LD      (HL),0A8H
            DEC     HL
            LD      (HL),002H
            LD      (HL),000H
L0972:      LD      HL,0E007H
            LD      (HL),080H
PONTCB:     DEC     HL
            LD      E,(HL)
            LD      D,(HL)
PONTB:      LD      HL,0A8C0H
            OR      A
            SBC     HL,DE
            JR      NZ,L0972            ; (-010H)
            LD      HL,0E005H
            LD      (HL),0F6H
            LD      (HL),079H
            OUT     (LSE1),A
            EI      
            POP     HL
            POP     DE
            RET     

L098F:      PUSH    BC
            PUSH    HL
            DI      
            OUT     (LSE3),A
            LD      HL,0E007H
            LD      (HL),080H
            LD      (HL),040H
            DEC     HL
            LD      E,(HL)
            LD      D,(HL)
            DEC     HL
            LD      C,(HL)
            LD      B,(HL)
            OUT     (LSE1),A
            EI      
            PUSH    BC
            LD      A,D
L09A6:      OR      E
            JR      NZ,L09AC            ; (+003H)
            LD      DE,0A8C0H
L09AC:      LD      HL,0A8C0H
            LD      A,(L0954)
            OR      A
            SBC     HL,DE
            LD      DE,L5460
            CALL    L09EB
            OR      A
            LD      DE,(00952H)
            RR      D
            RR      E
            PUSH    AF
            ADD     HL,DE
            LD      DE,L5460
            CALL    L09EB
            LD      C,A
            ADD     HL,HL
            EX      DE,HL
            POP     AF
            LD      A,C
            POP     BC
            PUSH    AF
            OR      A
            LD      HL,03CFBH
            SBC     HL,BC
            JR      C,L09DC             ; (+001H)
            INC     DE
L09DC:      POP     AF
            JR      NC,L09E0            ; (+001H)
            INC     DE
L09E0:      EX      DE,HL
            LD      DE,0A8C0H
            CALL    L09EB
            EX      DE,HL
            POP     HL
            POP     BC
            RET     

L09EB:      OR      A
            SBC     HL,DE
            JR      NC,L09F2            ; (+002H)
            ADD     HL,DE
            RET     

L09F2:      XOR     001H
            RET     

L09F5:      LD      A,04EH
            DEC     L
            RET     Z
            LD      A,056H
            DEC     L
            RET     Z
            LD      A,05EH
            DEC     L
L0A00:      RET     Z
            LD      A,066H
            DEC     L
            RET     

L0A05:      PUSH    DE
            LD      (00A23H),A
            LD      DE,0FFFFH
            LD      HL,0E002H
            DI      
            OUT     (LSE3),A
L0A12:      BIT     7,(HL)
            JR      Z,L0A12             ; (-004H)
L0A16:      BIT     7,(HL)
            JR      NZ,L0A16            ; (-004H)
            LD      L,008H
            LD      A,011H
L0A1E:      DEC     A
            JR      NZ,L0A1E            ; (-003H)
L0A21:      INC     DE
            BIT     0,(HL)
            JR      Z,L0A21             ; (-005H)
            OUT     (LSE1),A
            EI      
            LD      A,D
            OR      A
            LD      A,E
            JR      Z,L0A30             ; (+002H)
            LD      A,0FFH
L0A30:      LD      (L0066),A
            POP     DE
            POP     HL
            SCF     
            RET     

            INC     A
            PUSH    HL
            LD      L,A
            CALL    L09F5
            JR      Z,L0A05             ; (-03aH)
            CALL    L09F5
            LD      (00A75H),A
            LD      (00A55H),A
            LD      HL,0E002H
            DI      
            OUT     (LSE3),A
L0A4E:      BIT     7,(HL)
            JR      Z,L0A4E             ; (-004H)
            LD      L,008H
            BIT     0,(HL)
            LD      A,L
            JR      Z,L0A5A             ; (+001H)
            XOR     A
L0A5A:      LD      (00A7CH),A
            OUT     (LSE1),A
            LD      A,009H
L0A61:      PUSH    AF
            XOR     A
L0A63:      DEC     A
            JR      NZ,L0A63            ; (-003H)
            POP     AF
BINPUT:     DEC     A
            JR      NZ,L0A61            ; (-009H)
            OUT     (LSE3),A
            LD      L,002H
L0A6E:      BIT     7,(HL)
            JR      Z,L0A6E             ; (-004H)
            LD      L,008H
            BIT     0,(HL)
            LD      A,L
            JR      Z,L0A7A             ; (+001H)
            XOR     A
L0A7A:      LD      L,A
            LD      A,000H
            AND     L
            LD      (L0065),A
            OUT     (LSE1),A
            EI      
GETL:       POP     HL
            OR      A
            RET     

            DI      
            RET     

            EI      
            RET     

            DS      110, 000H
L0AF9:      DS      7, 000H
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L0B17:      NOP     
            NOP     
            NOP     
INKEY$:     NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
INKEY1:     NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L0B2B:      JP      PE,0900BH
            RLA     
            CALL    M,00019H
            DEC     SP
            LD      A,(L180D)
            DJNZ    L0B4A               ; (+012H)
            LD      DE,01413H
            CCF     
            CPL     
L0B3D:      LD      HL,(0900CH)
            RLA     
            EI      
            DEC     B
            NOP     
            DEC     HL
            LD      HL,(0160DH)
            DEC     D
            LD      (DE),A
L0B4A:      LD      DE,01413H
            ADD     A,05FH
L0B4F:      JP      (HL)

            INC     C
            SUB     B
            RLA     
            LD      L,B
            DEC     B
            NOP     
            ADD     A,H
            JP      (HL)

            DEC     C
            LD      D,015H
            LD      (DE),A
            LD      DE,01413H
            ADC     A,A
            ADC     A,E
L0B61:      LD      L,D
            INC     C
            SUB     B
            RLA     
            LD      L,H
            ADD     HL,DE
            NOP     
            CP      089H
            DEC     C
            LD      D,015H
            LD      (DE),A
            LD      DE,01413H
            ADC     A,D
            LD      A,E
L0B73:      LD      E,E
            LD      E,H
            LD      E,L
            LD      E,(HL)
            CPL     
L0B78:      SUB     C
            DEC     BC
            LD      B,E
            LD      D,D
            LD      D,H
            NOP     
            ADC     A,D
            NOP     
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
INKEYF:     XOR     D
            DEC     BC
            OR      L
            DEC     BC
            CALL    NZ,0000BH
            RRCA    
            LD      C,E
            LD      B,D
            NOP     
            NOP     
            ADD     A,C
            NOP     
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
INKEY0:     NOP     
            PUSH    HL
            NOP     
            XOR     D
            DEC     BC
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            RST     018H
            DB      00CH
            LD      A,080H
            RET     C
            JP      C,0017DH
            RST     018H
            DB      017H
            RET     

            EX      AF,AF'
            LD      HL,L0BFF
L0BB9:      LD      A,(L1090)
            OR      A
            JR      Z,L0BC2             ; (+003H)
            LD      HL,L0C43
L0BC2:      EX      AF,AF'
            JP      (HL)

            LD      A,(L0054)
            RET     

            LD      A,00DH
L0BCA:      PUSH    AF
            LD      A,(L1091)
L0BCE:      OR      A
            JR      NZ,L0BD4            ; (+003H)
            POP     AF
            JR      L0BFF               ; (+02bH)

L0BD4:      POP     AF
            JP      L0F3E

            PUSH    AF
            LD      A,(L1091)
            OR      A
            JR      NZ,L0BE2            ; (+003H)
            POP     AF
            JR      L0C43               ; (+061H)

L0BE2:      POP     AF
            JP      L0F2E

            CALL    SKPDE
            LD      HL,L0BCA
            JR      L0BF4               ; (+006H)

L0BEE:      CALL    SKPDE
            LD      HL,L0BFF
L0BF4:      LD      A,(DE)
            OR      A
            RET     Z
            CALL    L00FA
            INC     DE
            JR      L0BF4               ; (-009H)

L0BFD:      LD      A,020H
L0BFF:      CALL    IOOUT
L0C02:      LD      C,A
            LD      A,(L004D)
            OR      A
            JR      Z,L0C3A             ; (+031H)
            LD      A,C
            CP      020H
            JR      NC,L0C37            ; (+029H)
            LD      DE,(00054H)
            LD      HL,(L005B)
            CP      014H
            JR      Z,L0C21             ; (+008H)
            CP      012H
            JR      NZ,L0C26            ; (+009H)
            LD      HL,(L0056)
            LD      E,D
L0C21:      LD      A,L
            CP      E
            JP      NC,L0D3F
L0C26:      LD      A,C
            LD      HL,L0C8F
            ADD     A,L
            LD      L,A
            JR      NC,L0C2F            ; (+001H)
            INC     H
L0C2F:      LD      A,(HL)
            INC     A
            JR      Z,L0C3A             ; (+007H)
            DEC     A
            JP      Z,L0D3F
L0C37:      CALL    L0C60
L0C3A:      LD      A,C
            CP      020H
            JP      C,L065E
            JP      L0600

L0C43:      CALL    IOOUT
            LD      C,A
            CP      00DH
            JR      Z,L0C02             ; (-049H)
            CALL    L0600
            LD      A,(L004D)
            OR      A
            RET     Z
            LD      A,C
            CP      011H
            JR      C,L0C8A             ; (+032H)
            CP      017H
            JR      C,L0C8C             ; (+030H)
            CP      020H
            JR      C,L0C8A             ; (+02aH)
L0C60:      CP      060H
            JR      C,L0C8C             ; (+028H)
            CALL    CHKACC
            ADD     HL,BC
            ADD     A,B
            LD      A,E
            ADD     A,08BH
            RST     010H
            RST     008H
            CALL    M,0FFFBH
            JR      Z,L0C8C             ; (+019H)
            CP      092H
            JR      C,L0C8A             ; (+013H)
            CALL    CHKACC
            ADD     HL,BC
            SBC     A,C
            SUB     L
            XOR     H
            AND     A
            OR      H
            OR      C
            OR      (HL)
            OR      L
            CP      H
            JR      Z,L0C8A             ; (+004H)
            CP      0BFH
            JR      C,L0C8C             ; (+002H)
L0C8A:      LD      A,02EH
L0C8C:      JP      L0FA9

L0C8F:      NOP     
            NOP     
            NOP     
            NOP     
            RST     038H
            RST     038H
            RST     038H
            DEC     E
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DEC     C
            NOP     
            NOP     
            NOP     
            LD      A,(BC)
            INC     BC
            JR      NZ,00CB2H            ; (+00eH)
            NOP     
            NOP     
            RST     038H
            NOP     
            RST     038H
            RST     038H
            DEC     C
            RST     038H
            NOP     
            NOP     
            NOP     
L0CAF:      DI      
            XOR     A
            LD      (L004D),A
            LD      (L1091),A
            LD      SP,L0000
            OUT     (LSE1),A
            LD      A,004H
            RST     018H
            DB      003H
L0CC0:      LD      HL,L1B18
            XOR     A
            LD      (L0CC0),A
            LD      D,A
            LD      E,A
            RST     018H
            DB      026H
            LD      DE,$CMT
            LD      A,B
            DEC     A
            JR      Z,L0CDB             ; (+009H)
            LD      DE,$FD
            DEC     A
            JR      Z,L0CDB             ; (+003H)
            LD      DE,$QD
L0CDB:      LD      A,C
            RST     018H
            DB      03AH
            JP      L00DA

            LD      HL,(L1072)
            ADD     HL,DE
            LD      (L1072),HL
            LD      HL,(L1074)
            ADD     HL,DE
            LD      (L1074),HL
            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     

L0D05:      LD      HL,(00B15H)
L0D08:      LD      A,H
            OR      L
            JR      Z,L0D20             ; (+014H)
            PUSH    DE
            EX      DE,HL
            LD      HL,0E004H
            DI      
            OUT     (LSE3),A
            LD      (HL),E
            LD      (HL),D
            LD      A,001H
            LD      (0E008H),A
            OUT     (LSE1),A
            EI      
            POP     DE
            RET     

L0D20:      LD      A,036H
BRKEY:      DI      
            OUT     (LSE3),A
            LD      (0E007H),A
            XOR     A
            LD      (0E008H),A
            OUT     (LSE1),A
            EI      
            RET     

L0D30:      PUSH    AF
            PUSH    BC
            AND     00FH
            LD      B,A
            LD      A,008H
            SUB     B
            LD      (L119E),A
            POP     BC
            POP     AF
            RET     

L0D3E:      XOR     A
L0D3F:      PUSH    HL
            LD      HL,L04EC
            JR      Z,L0D4E             ; (+009H)
            CP      001H
L0D47:      JR      Z,L0D59             ; (+010H)
            CALL    L0D08
            POP     HL
            RET     

L0D4E:      CALL    L0D08
            LD      HL,L2710
L0D54:      DEC     HL
            LD      A,H
            OR      L
            JR      NZ,L0D54            ; (-005H)
L0D59:      CALL    L0D20
            POP     HL
            RET     

$USR:       DS      2, 000H ; $USR device descriptor
L0D60:      DB      "USR",000H,09FH
            DS      2, 000H
            DB      LSE5
            DB      000H
            DB      077H
            DB      00DH
            DB      077H
            DB      00DH
            DB      LSE5
            DB      000H
            DB      LSE5
            DB      000H
            DB      086H
            DB      00DH
            DB      086H
            DB      00DH
            DB      LSE5
            DB      000H
            DB      021H
            DB      001H
            DB      010H
            DB      0DFH
            DB      013H
            LD      A,D
            OR      E
            JP      Z,01F9AH
            LD      (ZWRK1),DE
            RET     

            LD      HL,(ZWRK1)
            JP      (HL)

            DS      83, 000H
EQTBL:      DS      25, 000H
$KB:        DS      10, 000H
L0E00:      DS      16, 000H
L0E10:      DS      46, 000H
L0E3E:      DS      35, 000H
CRT1C:      DS      82, 000H
PLTOTX:     DS      77, 000H
            RST     030H
            CPL     
            LD      C,H
            LD      D,B
            LD      D,H
            NOP     
            ADC     A,D
            NOP     
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            PUSH    HL
            NOP     
            NOP     
            NOP     
            DAA     
            RRCA    
            ADD     HL,DE
            RRCA    
            LD      A,(L1095)
            RET     

L0F1D:      LD      A,00DH
            CALL    L0FA9
            XOR     A
            LD      (L1095),A
            RET     

            LD      HL,L1090
            BIT     0,(HL)
            JR      Z,L0F3E             ; (+010H)
L0F2E:      CALL    IOOUT
            LD      B,A
            LD      A,(L004D)
            OR      A
            LD      A,B
            LD      E,0FFH
            JR      Z,L0F4E             ; (+013H)
            RST     018H
            DB      004H
            RET     

L0F3E:      CALL    IOOUT
            LD      B,A
            LD      A,(L004D)
            OR      A
            LD      A,B
            LD      E,000H
            JR      Z,L0F4E             ; (+003H)
            RST     018H
            DB      003H
            RET     

L0F4E:      LD      A,(L1097)
            CP      001H
            LD      A,044H
            JP      NZ,00180H
            LD      A,B
            CP      00DH
            JR      Z,L0F1D             ; (-040H)
            LD      HL,L1095
            INC     (HL)
            SUB     005H
            CP      002H
            JR      C,L0F7C             ; (+015H)
            LD      A,B
            CP      020H
            JR      NC,L0FB0            ; (+044H)
            BIT     0,E
            JR      Z,L0F80             ; (+010H)
            SUB     011H
            CP      006H
            JR      C,L0FB1             ; (+03bH)
            SUB     QDPC
            CP      002H
            JR      NC,L0FAE            ; (+032H)
L0F7C:      LD      A,02EH
            JR      L0FB0               ; (+030H)

L0F80:      LD      HL,L1095
            DEC     (HL)
            LD      A,B
            CP      015H
            LD      B,00FH
            JR      Z,L0FB1             ; (+026H)
            CP      011H
            LD      B,009H
            JR      Z,L0FB1             ; (+020H)
            CP      012H
            LD      B,00BH
            JR      Z,L0FB1             ; (+01aH)
            CP      016H
            JR      NZ,L0FB0            ; (+015H)
            LD      A,00CH
            CALL    L0FB0
            LD      A,00AH
            CALL    L0FB0
            LD      A,003H
            JR      L0FB0               ; (+007H)

L0FA9:      CALL    IOOUT
            JR      L0FB0               ; (+002H)

L0FAE:      LD      A,020H
L0FB0:      LD      B,A
L0FB1:      CALL    L0FCA
            LD      A,B
            DI      
            CALL    L0FBB
            EI      
            RET     

L0FBB:      OUT     (0FFH),A
            LD      A,080H
            OUT     (0FEH),A
            LD      A,001H
            CALL    L0FCB
L0FC6:      XOR     A
            OUT     (0FEH),A
            RET     

L0FCA:      XOR     A
L0FCB:      CALL    SKPDE
            LD      C,A
            LD      B,00EH
L0FD1:      LD      HL,0E678H
L0FD4:      IN      A,(0FEH)
            AND     00DH
            CP      C
            RET     Z
            DEC     HL
            LD      A,H
            OR      L
            NOP     
            NOP     
            JR      NZ,L0FD4            ; (-00dH)
            DJNZ    L0FD1               ; (-012H)
            XOR     A
            LD      (L004D),A
            CALL    L0FC6
            LD      A,041H
            JP      L0182

            DS      17, 000H
L1000:      NOP     
L1001:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1012:      NOP     
            NOP     
L1014:      NOP     
            NOP     
            NOP     
            NOP     
L1018:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L103E:      NOP     
            NOP     
L1040:      LD      (BC),A
            NOP     
L1042:      NOP     
L1043:      NOP     
L1044:      NOP     
            NOP     
L1046:      NOP     
            NOP     
            NOP     
            NOP     
L104A:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1050:      LD      BC,L0000
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1069:      NOP     
            NOP     
            NOP     
            LD      A,B
            DEC     BC
            NOP     
            RRCA    
L1070:      NOP     
            NOP     
L1072:      NOP     
            NOP     
L1074:      NOP     
            NOP     
L1076:      NOP     
            NOP     
L1078:      NOP     
            NOP     
L107A:      NOP     
            NOP     
L107C:      NOP     
            NOP     
L107E:      NOP     
            NOP     
            NOP     
            RST     038H
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1090:      NOP     
L1091:      NOP     
            LD      BC,L0E00
L1095:      NOP     
            NOP     
L1097:      LD      BC,L0000
            DS      86, 000H
L10F0:      DS      78, 000H
L113E:      DS      84, 000H
            DB      0EFH
            DS      4, 000H
L1197:      DS      6, 000H
            DB      001H
L119E:      DB      004H
            DB      005H
            DS      3, 000H
L11A3:      DB      000H
L11A4:      DS      124, 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     
L123E:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1277:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L12C0:      RLCA    
            LD      D,D
            LD      D,L
            LD      C,(HL)
            JR      NZ,012E6H            ; (+020H)
            JR      NZ,L12D5            ; (+00dH)
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DEC     B
            LD      C,H
            LD      C,C
            LD      D,E
            LD      D,H
L12D5:      JR      NZ,L12D7            ; (+000H)
L12D7:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DEC     B
            LD      B,C
            LD      D,L
            LD      D,H
            LD      C,A
            JR      NZ,L12E7            ; (+000H)
L12E7:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            LD      B,052H
            LD      B,L
            LD      C,(HL)
            LD      D,L
            LD      C,L
            JR      NZ,L12F8            ; (+000H)
L12F8:      DS      8, 000H
            INC     B
            LD      B,H
            LD      C,C
            LD      D,D
            JR      NZ,L1306            ; (+000H)
L1306:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DEC     B
            LD      B,E
            LD      C,B
            LD      D,D
            INC     H
            JR      Z,L1317             ; (+000H)
L1317:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            EX      AF,AF'
            LD      B,H
            LD      B,L
            LD      B,(HL)
            JR      NZ,L1371            ; (+04bH)
            LD      B,L
            LD      E,C
            JR      Z,L132A             ; (+000H)
L132A:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            INC     B
            LD      B,E
            LD      C,A
            LD      C,(HL)
            LD      D,H
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L133E:      NOP     
            NOP     
            LD      B,053H
            LD      B,C
            LD      D,(HL)
            LD      B,L
            JR      NZ,L1367            ; (+020H)
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            LD      B,04CH
            LD      C,A
            LD      B,C
            LD      B,H
            JR      NZ,L1377            ; (+020H)
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1360:      NOP     
L1361:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1367:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L1371:      NOP     
            CALL    L13D8
            JR      Z,L1385             ; (+00eH)
L1377:      CP      010H
            JR      C,L139B             ; (+020H)
            CP      080H
            JR      Z,L13A1             ; (+022H)
            CP      0C0H
            JR      Z,L13A1             ; (+01eH)
            JR      L1391               ; (+00cH)

L1385:      CP      003H
            JR      Z,L139B             ; (+012H)
            CP      005H
            JR      Z,L139E             ; (+011H)
            CP      006H
            JR      Z,L139E             ; (+00dH)
L1391:      DI      
            OUT     (LSE2),A
            CALL    L0BB9
            OUT     (LSE0),A
            EI      
            RET     

L139B:      LD      A,LSPAL
            RET     

L139E:      ADD     A,0C9H
            RET     

L13A1:      SUB     040H
            RET     

L13A4:      CP      LSPAL
            JR      NC,L13CF            ; (+027H)
            CP      073H
            JR      Z,L139B             ; (-011H)
            CALL    L13D8
            JR      Z,L13BB             ; (+00aH)
            CP      040H
            JR      Z,L13D5             ; (+020H)
            CP      080H
            JR      Z,L13D5             ; (+01cH)
            JR      L13C3               ; (+008H)

L13BB:      CP      LSDMD
            JR      Z,L13D2             ; (+013H)
            CP      LSSCR
            JR      Z,L13D2             ; (+00fH)
L13C3:      DI      
            OUT     (LSE2),A
            CALL    L0BCE
            OUT     (LSE0),A
            EI      
            CP      LSPAL
            RET     NZ
L13CF:      LD      A,020H
            RET     

L13D2:      SUB     0C9H
            RET     

L13D5:      ADD     A,040H
            RET     

L13D8:      PUSH    HL
            LD      HL,L0036
            BIT     6,(HL)
            POP     HL
            RET     

L13E0:      PUSH    AF
            LD      A,L
            SUB     008H
            JR      C,L13EA             ; (+004H)
            SUB     030H
            JR      C,L13F1             ; (+007H)
L13EA:      ADD     A,00AH
            LD      L,A
            ADD     HL,BC
            LD      C,(HL)
            POP     AF
            RET     

L13F1:      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    L13A4
            LD      C,A
            POP     AF
            RET     

            PUSH    HL
            PUSH    BC
            PUSH    DE
            LD      DE,L2710
            CALL    L142C
            LD      DE,003E8H
            CALL    L142C
            LD      DE,L0064
            CALL    L142C
            LD      DE,0000AH
            CALL    L142C
            LD      A,L
            POP     DE
            OR      030H
            LD      (DE),A
            INC     DE
            XOR     A
            LD      (DE),A
            POP     BC
            POP     HL
            RET     

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

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

L1471:      LD      A,002H
            JP      L0182

L1476:      LD      DE,L0000
L1479:      LD      A,(HL)
            CALL    L1491
            RET     C
            INC     HL
            EX      DE,HL
            ADD     HL,HL
            JR      C,L1471             ; (-012H)
            ADD     HL,HL
            JR      C,L1471             ; (-015H)
            ADD     HL,HL
            JR      C,L1471             ; (-018H)
            ADD     HL,HL
            JR      C,L1471             ; (-01bH)
            ADD     A,L
            LD      L,A
            EX      DE,HL
            JR      L1479               ; (-018H)

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

            CALL    L14AD
            CP      020H
            RET     NZ
L14A6:      CALL    L14AD
            OR      A
            JR      Z,L14A6             ; (-006H)
            RET     

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

            RET     

L14BC:      CALL    SKPDE
            LD      HL,L11A4
            LD      B,000H
            PUSH    HL
            CALL    LDHLDE
            POP     DE
            LD      (014DAH),SP
            LD      SP,L10F0
            DI      
            OUT     (LSE4),A
            RST     030H
            OUT     (LSE0),A
            OUT     (LSE1),A
            EI      
            LD      SP,L0000
            RET     

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

            LD      C,A
            RST     018H
            DB      020H
            RST     018H
            DB      002H
            BIT     7,C
            JR      Z,L14F8             ; (+00aH)
            LD      HL,L11A4
            PUSH    HL
            CALL    L1535
            POP     DE
            RST     018H
            DB      005H
L14F8:      LD      A,C
            AND     07FH
            JR      L14FF               ; (+002H)

L14FD:      LD      A,045H
L14FF:      LD      DE,L1554
L1502:      DEC     A
            JR      Z,L150F             ; (+00aH)
            EX      AF,AF'
L1506:      LD      A,(DE)
            INC     DE
            OR      A
            JP      P,L1506
            EX      AF,AF'
            JR      L1502               ; (-00dH)

L150F:      LD      A,(DE)
            CP      080H
            JR      Z,L14FD             ; (-017H)
L1514:      LD      A,(DE)
            OR      A
            JP      M,L151F
            CALL    L152A
            INC     DE
            JR      L1514               ; (-00bH)

L151F:      AND     07FH
            CALL    L152A
            LD      DE,L179E
            RST     018H
            DB      005H
            RET     

L152A:      PUSH    DE
            LD      DE,L1533
            LD      (DE),A
            RST     018H
            DB      005H
            POP     DE
            RET     

L1533:      NOP     
            NOP     
L1535:      LD      DE,(ZEQT)
            INC     DE
            INC     DE
            RST     018H
            DB      017H
            CALL    LDHLDE
            LD      A,(L1046)
            ADD     A,031H
            LD      (HL),A
            LD      A,(01051H)
            AND     00FH
            JR      Z,L154E             ; (+001H)
            INC     HL
L154E:      LD      (HL),03AH
            DB      023H
            DB      036H
            DB      000H
            DB      0C9H
L1554:      DB      053H,005H,"YNTA",0D8H,04FH,005H,"VER FLO",0D7H,049H,005H
            DS      2, 04CH
            DB      "EGAL DAT",0C1H,054H,005H,"YPE MISMATC",0C8H,053H,005H,"TRING LENGT",0C8H,04DH,005H,"EMORY CAPACIT",0D9H,041H,005H
            DS      2, 052H
            DB      "AY DEF",0AEH,04CH,005H,"INELENGT",0C8H,080H,"GOSUB ",005H,"NESTIN",0C7H,"FOR-NEX",0D4H,"DEF FN ",005H,"NESTIN",0C7H,"NEX",0D4H,"RETUR"
            DB      LSDMD
            DB      055H,005H,"N DEF. FUNCTIO"
            DB      LSDMD
            DB      055H,005H,"N DEF. LIN",0C5H,043H,005H,"AN'T ",006H,"CON",0D4H,04DH,005H,"EMORY PROTECTIO"
            DB      LSDMD
            DB      049H,005H,"NSTRUCTIO"
            DB      LSDMD
            DB      043H,005H,"AN'T ",006H,"RESUM",0C5H,"RESUM",0C5H
            DS      2, 080H
            DB      "REA",0C4H,"SWAP ",005H,"LEVE"
            DB      LSWF
            DS      2, 080H
            DB      053H,005H,"YSTEM I",0C4H,046H,005H,"RAMIN",0C7H,04FH,005H,056H,045H
            DS      2, 052H
            DB      055H
            DB      LSDMD
            DB      050H,005H,"ARIT",0D9H
            DS      8, 080H
            DB      046H,005H,"ILE NOT FOUN",0C4H,048H,005H,"ARDWAR",0C5H,041H,005H,"LREADY EXIS",0D4H,041H,005H,"LREADY OPE"
            DB      LSDMD
            DB      04EH,005H,"OT OPE"
            DB      LSDMD
            DB      080H,057H,005H,"RITE PROTEC",0D4H
            DS      3, 080H
            DB      04EH,005H,"OT READ",0D9H,054H,005H
            DS      2, 04FH
            DB      " MANY FILE"
            DB      LSD3
            DB      044H,005H,"ISK MISMATC",0C8H,04EH,005H,"O FILE SPAC",0C5H,055H,005H,"NFORMA",0D4H,054H,005H
            DS      2, 04FH
            DB      " LONG FIL",0C5H
            DS      2, 080H
            DB      044H,005H,"EV. NAM",0C5H,043H,005H,"AN'T EXECUT",0C5H,049H,005H
            DS      2, 04CH
            DB      "EGAL FILENAM",0C5H,049H,005H
            DS      2, 04CH
            DB      "EGAL FILEMOD",0C5H,080H,04FH,005H,"UT OF FIL",0C5H,04CH,005H,"OGICAL NUMBE"
            DB      LSD2
            DB      "LPT:"
L1772:      DB      04EH,005H,"OT READ",0D9H
            DS      2, 080H
            DB      044H,005H,"EV. MOD",0C5H,055H,005H,"NPRINTABL",0C5H,043H,005H,"HECK SU"
            DB      LSRF
L179E:      DB      020H
            DB      005H
            DB      045H
            DS      2, 052H
            DB      04FH
            LD      D,D
            DS      91, 000H
L1800:      JP      L4000

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

L1809:      NOP     
            NOP     
L180B:      NOP     
            NOP     
L180D:      NOP     
            NOP     
            CALL    L181A
            CALL    L1821
L1815:      XOR     A
            LD      (L1FC0),A
            RET     

L181A:      LD      A,(L1042)
            LD      (L1FC0),A
            RET     

L1821:      CALL    SKPDE
            LD      A,(L1050)
            BIT     7,A
            LD      HL,L1848
L182C:      JR      Z,L183D             ; (+00fH)
            BIT     3,A
            LD      HL,L1835
            JR      NZ,L183D            ; (+008H)
L1835:      LD      IX,(ZOUT)
            CALL    IOCALL
            RET     

L183D:      LD      A,B
L183E:      OR      A
            RET     Z
            LD      A,(DE)
            CALL    L00FA
            INC     DE
            DEC     B
            JR      L183D               ; (-00bH)

L1848:      CALL    SKPDE
            LD      E,(IY+040H)
            LD      D,(IY+041H)
            LD      HL,(L180B)
            ADD     HL,DE
            LD      (HL),A
            INC     DE
            LD      HL,(ZKL)
            OR      A
            SBC     HL,DE
            CALL    Z,L1871
            LD      (IY+040H),E
            LD      (IY+041H),D
            INC     (IY+014H)
            RET     NZ
            INC     (IY+015H)
            RET     NZ
            JP      01F91H

L1871:      PUSH    BC
            LD      B,002H
L1874:      CALL    L1D15
            LD      IX,L1835
            JR      Z,L1881             ; (+004H)
            LD      IX,L2907
L1881:      LD      A,B
            CALL    L18B6
            CALL    L1890
            INC     (IY+04EH)
            LD      DE,L0000
            POP     BC
            RET     

L1890:      JP      (IX)

L1892:      LD      A,01AH
            LD      E,(IY+040H)
            LD      D,(IY+041H)
L189A:      LD      HL,(L180B)
            ADD     HL,DE
            LD      (HL),A
            INC     DE
            LD      HL,(ZKL)
            XOR     A
            SBC     HL,DE
            JR      NZ,L189A            ; (-00eH)
            PUSH    BC
            LD      HL,(L180B)
            DEC     HL
            LD      (HL),0FFH
            DEC     HL
            LD      (HL),0FFH
            LD      B,006H
            JR      L1874               ; (-042H)

L18B6:      LD      BC,(ZKL)
            INC     BC
            INC     BC
            LD      HL,(L180B)
            DEC     HL
            DEC     HL
            LD      DE,(01809H)
            RET     

L18C6:      OR      0AFH
            LD      IX,(ZCL)
            CALL    IOCALL
            RET     

            CALL    L1803
            RET     NZ
            PUSH    DE
            LD      DE,L11A4
            CALL    L026A
            LD      (0193CH),DE
            POP     DE
            RET     NC
            JP      0017DH

            PUSH    HL
            PUSH    DE
            CALL    L181A
            LD      HL,(L1040)
            INC     HL
            BIT     7,(HL)
            PUSH    HL
            LD      B,000H
            SCF     
            CALL    Z,L1913
            POP     HL
            CALL    C,L1908
            POP     DE
            PUSH    AF
            CALL    L1815
            LD      L,B
            LD      H,000H
            ADD     HL,DE
            LD      (HL),000H
            POP     AF
            POP     HL
            RET     

L1908:      SET     7,(HL)
            LD      HL,01051H
            BIT     4,(HL)
            RET     Z
            JP      01FA0H

L1913:      CALL    L1803
            JR      Z,L193B             ; (+023H)
            LD      A,(L1050)
            BIT     7,A
            LD      HL,L1989
            JR      Z,L1975             ; (+053H)
            BIT     2,A
            LD      HL,L1929
            JR      NZ,L1975            ; (+04cH)
L1929:      LD      IX,(ZINP)
            CALL    IOCALL
            RET     

L1931:      LD      A,03FH
            RST     018H
            DB      003H
            LD      A,020H
            RST     018H
            DB      003H
            RST     018H
            DB      034H
L193B:      LD      HL,L0000
L193E:      CALL    HLFTCH
            OR      A
            JR      Z,L1931             ; (-013H)
            LD      C,000H
            RST     018H
            DB      036H
            LD      (0193CH),HL
            RET     

            LD      B,000H
            CALL    TEST1
            DB      022H
            JR      NZ,L1967            ; (+013H)
L1954:      LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            CP      022H
            JR      Z,L1961             ; (+005H)
            LD      (DE),A
            INC     DE
            INC     B
            JR      L1954               ; (-00dH)

L1961:      CALL    TEST1
            DB      02CH
            OR      A
            RET     

L1967:      LD      A,(HL)
            OR      A
            RET     Z
            CP      C
            RET     Z
            INC     HL
            CP      02CH
            RET     Z
            LD      (DE),A
            INC     DE
            INC     B
            JR      L1967               ; (-00eH)

L1975:      LD      (0197BH),HL
            LD      B,000H
L197A:      CALL    L0000
            RET     C
            CP      00DH
            RET     Z
            LD      (DE),A
            INC     DE
            INC     B
            JR      NZ,L197A            ; (-00cH)
            JP      01F76H

L1989:      CALL    SKPDE
            LD      E,(IY+040H)
            LD      D,(IY+041H)
            LD      HL,(ZKL)
            OR      A
            SBC     HL,DE
            CALL    Z,L19B4
            RET     C
            LD      L,(IY+04EH)
            LD      H,(IY+04FH)
            XOR     A
            SBC     HL,DE
            SCF     
            RET     Z
            LD      HL,(L180B)
            ADD     HL,DE
            LD      A,(HL)
            INC     DE
            LD      (IY+040H),E
            LD      (IY+041H),D
            RET     

L19B4:      CALL    L1D15
            JP      NZ,L2A4C
            OR      0AFH
            CALL    L18B6
            CALL    L1929
            RET     C
            LD      A,(HL)
            INC     HL
            AND     (HL)
            LD      (HL),0FFH
            INC     A
            LD      DE,L0000
            RET     NZ
            PUSH    HL
            LD      HL,(L180D)
            LD      BC,(ZKL)
L19D5:      DEC     HL
            DEC     BC
            LD      A,(HL)
            OR      A
            JR      Z,L19D5             ; (-006H)
            POP     HL
            LD      (HL),B
            DEC     HL
            LD      (HL),C
            RET     

            CALL    SKPDE
            LD      HL,L1A2D
            CP      088H
            JR      Z,L19F4             ; (+00aH)
            LD      HL,L1A35
            CP      089H
            JR      Z,L19F4             ; (+003H)
            RST     018H
            DB      029H
            RET     C
L19F4:      LD      (L1040),HL
            LD      DE,L1042
            LD      BC,00008H
            LDIR    
            LD      (L1809),HL
            PUSH    HL
            POP     IY
            LD      DE,L1000
            CALL    L1C54
            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     

L1A2D:      ADC     A,B
            INC     BC
            LD      A,B
            DEC     BC
            NOP     
            NOP     
            NOP     
            NOP     
L1A35:      ADC     A,C
            LD      (BC),A
            NOP     
            RRCA    
            NOP     
            NOP     
            NOP     
            NOP     
            LD      HL,L11A4
            PUSH    HL
            LD      A,B
            OR      A
            CALL    NZ,LDHLDE
            LD      (HL),000H
            LD      HL,L0B78
            JR      L1A50               ; (+003H)

L1A4D:      LD      HL,L0000
L1A50:      LD      A,L
            OR      H
            JR      Z,L1A89             ; (+035H)
            LD      (01A84H),HL
            CALL    LDDEMI
            LD      (01A4EH),DE
            LD      DE,L11A4
            EX      DE,HL
L1A62:      LD      A,(DE)
            OR      A
            JR      Z,L1A6D             ; (+007H)
            CP      (HL)
            JR      NZ,L1A4D            ; (-01cH)
            INC     HL
            INC     DE
            JR      L1A62               ; (-00bH)

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

L1A89:      POP     HL
            PUSH    HL
L1A8B:      LD      A,(HL)
            INC     HL
            CP      03AH
            JP      Z,01F94H
            OR      A
            JR      NZ,L1A8B            ; (-00aH)
            LD      HL,(DDEV)
            LD      A,(L1069)
L1A9B:      LD      (L1044),HL
            PUSH    HL
            LD      (L1046),A
            LD      DE,L104A
            LD      BC,0001DH
            LDIR    
            LD      B,A
            LD      A,(01051H)
            AND     007H
            CP      B
            JP      C,01F94H
            LD      A,B
            POP     DE
            POP     HL
            RET     

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

            CALL    SKPDE
            CALL    L1AEF
            LD      B,000H
            CALL    L1B97
            JP      L2D08

L1AEF:      LD      A,(L1042)
            RST     018H
            DB      029H
            JP      NC,01F7CH
            CALL    L1C5B
            LD      HL,L005D
            LD      A,(L1050)
            LD      DE,(ZKL)
            INC     DE
            INC     DE
            BIT     7,A
            JR      NZ,L1B0B            ; (+001H)
            ADD     HL,DE
L1B0B:      LD      A,(L1043)
            BIT     2,A
            JR      Z,L1B13             ; (+001H)
            ADD     HL,DE
L1B13:      EX      DE,HL
            LD      A,(L1042)
            RST     018H
L1B18:      DB      02AH
            LD      (L1FC0),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    L1C54
            LD      HL,00010H
            ADD     HL,DE
            LD      (L180B),HL
            LD      DE,(ZKL)
            ADD     HL,DE
            LD      (L180D),HL
            CALL    L1D15
            JP      NZ,L2B7F
            LD      A,(L1043)
            BIT     2,A
            JP      NZ,01F97H
            BIT     1,A
            LD      IX,(ZWO)
            JR      NZ,L1B65            ; (+00bH)
            LD      A,(L1050)
            BIT     7,A
            JR      Z,L1B6B             ; (+00aH)
            LD      IX,(ZRO)
L1B65:      LD      HL,L1000
            JP      IOCALL

L1B6B:      CALL    L1C39
            JP      019BBH

            CALL    SKPDE
            LD      IY,L0100
            LD      (L1042),IY
            LD      IY,L1000
            CALL    L1D15
            LD      HL,L2B7A
            JR      NZ,L1B8B            ; (+003H)
            LD      HL,L1C39
L1B8B:      CALL    L00FA
            LD      B,080H
            CALL    L1B97
            LD      A,(L1000)
            RET     

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

L1BA7:      CALL    SKPDE
            OR      A
            JR      Z,L1BED             ; (+040H)
            CALL    L1BB3
            JP      L2D08

L1BB3:      RST     018H
            DB      02EH
            RET     C
            CALL    L181A
            PUSH    AF
            CALL    L1D15
            JR      NZ,L1BE1            ; (+022H)
            BIT     7,A
            LD      A,B
            JR      Z,L1BD4             ; (+010H)
            OR      A
            LD      IX,(ZKL)
            JR      Z,L1BCF             ; (+004H)
            LD      IX,(ZCL)
L1BCF:      CALL    IOCALL
            JR      L1BE4               ; (+010H)

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

L1BE1:      CALL    L2BEC
L1BE4:      POP     AF
            RST     018H
            DB      02BH
            RET     

            CALL    SKPDE
            LD      B,000H
L1BED:      LD      C,08EH
L1BEF:      LD      A,C
            PUSH    BC
            RST     018H
            DB      029H
            CALL    NC,L1BB3
            POP     BC
            DEC     C
            JR      NZ,L1BEF            ; (-00bH)
            JP      L1FAB

L1BFD:      CALL    SKPDE
            LD      A,(L1050)
            BIT     6,A
            JP      Z,01F97H
            CALL    018C7H
            LD      A,(ZDIRMX)
            LD      B,A
L1C0F:      LD      HL,L11A4
            PUSH    BC
            LD      IX,(ZRO)
            CALL    IOCALL
            POP     BC
            SET     0,A
            RET     C
            PUSH    IY
            POP     DE
            CALL    L1E9D
            LD      A,(HL)
            RET     Z
            DJNZ    L1C0F               ; (-019H)
            XOR     A
            SCF     
            RET     

L1C2B:      CALL    L1C5B
            CALL    L1BFD
            JP      NC,01F79H
            OR      A
            JP      Z,01F85H
            RET     

L1C39:      CALL    L1C5B
            CALL    L1BFD
            JP      C,01F73H
            CALL    SKPDE
            LD      HL,L11A4
            PUSH    IY
            POP     DE
            PUSH    HL
            CALL    L1C54
            POP     HL
            LD      DE,L1000
            LD      A,(HL)
L1C54:      LD      BC,00040H
            LDIR    
            OR      A
            RET     

L1C5B:      LD      IX,L1C9D
L1C5F:      LD      (01C99H),IX
            CALL    SKPDE
            LD      A,(L1042)
            LD      C,A
            LD      HL,(L1072)
            PUSH    HL
L1C6E:      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,L1C6E            ; (-010H)
            CP      C
            JR      Z,L1C6E             ; (-013H)
            INC     HL
            LD      A,(HL)
            EX      AF,AF'
            INC     HL
            LD      DE,L1044
            PUSH    BC
            LD      BC,00300H
L1C8C:      LD      A,(DE)
            SUB     (HL)
            OR      C
            LD      C,A
            INC     DE
            INC     HL
            DJNZ    L1C8C               ; (-008H)
            POP     BC
            JR      NZ,L1C6E            ; (-029H)
            LD      A,B
            CALL    L0000
            JR      L1C6E               ; (-02fH)

L1C9D:      LD      A,(01051H)
            BIT     6,A
            JP      NZ,01F7CH
            BIT     5,A
            RET     Z
            EX      AF,AF'
            LD      B,A
            LD      A,(L1043)
            AND     B
            BIT     1,A
            RET     Z
            JP      01F7CH

            CALL    L1D15
            JP      NZ,L2AD2
            LD      BC,(ELMD20)
            PUSH    BC
            XOR     A
            LD      IX,(ZINP)
            CALL    IOCALL
            POP     BC
            RET     

            LD      A,(01051H)
            BIT     7,A
            JP      Z,01F97H
            LD      BC,(ELMD20)
            JP      L313A

            LD      A,(L1000)
            CP      005H
            JR      C,L1CE4             ; (+005H)
            LD      A,080H
            LD      (L1012),A
L1CE4:      CALL    L1D15
            JP      NZ,L2AE0
            BIT     7,A
            JP      NZ,01F97H
            PUSH    DE
            LD      HL,L0200
            LD      (L1042),HL
            CALL    L1C5B
            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     

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

            CALL    SKPDE
            OR      A
            JR      NZ,L1D6B            ; (+04aH)
            LD      HL,L0100
            LD      (L1042),HL
            CALL    L1C5B
            LD      HL,L1050
            BIT     7,(HL)
            JP      NZ,01F97H
            BIT     5,(HL)
            JP      NZ,02F38H
            INC     HL
            BIT     7,(HL)
            JP      NZ,01F97H
            LD      HL,L2000
            LD      BC,00008H
L1D43:      CALL    ?CLRHL
            DEC     C
            JR      NZ,L1D43            ; (-006H)
            CALL    018C7H
            LD      A,(ZDIRMX)
            LD      B,A
            LD      HL,L2000
L1D53:      PUSH    BC
            LD      IX,(ZRO)
            CALL    IOCALL
            PUSH    AF
            LD      BC,00020H
            ADD     HL,BC
            LD      (HL),000H
            POP     AF
            POP     BC
            JR      C,L1D68             ; (+002H)
            DJNZ    L1D53               ; (-015H)
L1D68:      JP      L18C6

L1D6B:      LD      (01E13H),A
            XOR     A
            LD      (L1090),A
            LD      HL,L11A4
            PUSH    HL
            LD      DE,L1E1D
            LD      B,00EH
            CALL    LDHLDE
            CALL    L1535
            LD      (HL),020H
            INC     HL
            LD      (HL),020H
            INC     HL
            EX      DE,HL
            CALL    L1D15
            LD      IX,(ZFREE)
            JR      Z,L1D95             ; (+004H)
            LD      IX,L2F4B
L1D95:      CALL    IOCALL
            JR      C,L1DA8             ; (+00eH)
            LD      H,B
            LD      L,C
            LD      B,000H
            RST     018H
            DB      016H
            LD      HL,L1E2B
            LD      B,009H
            CALL    LDDEHL
L1DA8:      EX      DE,HL
            LD      (HL),00DH
            INC     HL
            LD      (HL),000H
            POP     DE
            CALL    L1E12
            LD      B,040H
            LD      HL,L2000
L1DB7:      CALL    L1DC3
            LD      DE,00020H
            ADD     HL,DE
            DJNZ    L1DB7               ; (-009H)
            JP      L2D08

L1DC3:      CALL    SKPDE
            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,L1DDC             ; (+002H)
            LD      A,00CH
L1DDC:      PUSH    HL
            POP     IY
            POP     DE
            PUSH    DE
            INC     DE
            LD      HL,L1E31
            LD      BC,L0003
L1DE8:      ADD     HL,BC
            DEC     A
            JR      NZ,L1DE8            ; (-004H)
            LDIR    
            EX      DE,HL
            BIT     0,(IY+012H)
            JR      Z,L1DF7             ; (+002H)
            LD      (HL),02AH
L1DF7:      INC     HL
            INC     HL
            LD      (HL),022H
            INC     HL
L1DFC:      LD      A,(IY+001H)
            CP      00DH
            JR      Z,L1E09             ; (+006H)
            LD      (HL),A
            INC     IY
            INC     HL
            JR      L1DFC               ; (-00dH)

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

L1E1D:      DEC     C
            DB      "DIRECTORY OF "
L1E2B:      DB      " KB FR"
L1E31:      DS      2, 045H
            DB      ".OBJBTXBSDBRDRB"
            DS      2, 020H
            DB      "? LIB ?"
            DS      2, 020H
            DB      "? SYSGR"
            DS      2, 020H
            DB      03FH
            DB      020H
            DB      LSE5
            DB      0AFH,032H,042H,010H,0DDH,021H,071H,01EH,0EDH,073H,072H,01EH
            DB      LSRF
            DB      05FH
            DB      01CH
            DB      LSE1
            DB      0DDH
            DB      02AH
            DB      053H
            DB      010H
            DB      LSRF
            DB      045H
            DB      002H
            DB      0C9H
            DB      031H
            DS      2, 000H
            DB      006H
            DB      000H
            DB      0DFH
            DB      038H
            DB      018H
            DB      0DFH
L1E7A:      DB      LSRF
            DB      064H,001H,059H,0C8H,011H,08EH,01EH,0DFH,005H,03EH,001H,0DFH,00DH,0FEH,059H,0C8H,0C3H,07DH,001H,"OK ? [Y/N]",019H,000H
L1E9A:      DB      011H
            DB      000H
            DB      010H
L1E9D:      DB      LSRF
            DB      008H
            DB      001H
            INC     HL
            INC     DE
            LD      A,(DE)
            CP      00DH
            RET     Z
            LD      B,011H
L1EA8:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            CP      00DH
            RET     Z
            INC     HL
            INC     DE
            DJNZ    L1EA8               ; (-00aH)
            OR      A
            RET     

L1EB4:      INC     HL
            LD      C,010H
L1EB7:      LD      A,B
            OR      A
            JR      Z,L1ECF             ; (+014H)
            LD      A,(DE)
            INC     DE
            DEC     B
            OR      A
            JR      Z,L1ECF             ; (+00eH)
            CP      022H
            JR      Z,L1EB7             ; (-00eH)
            CP      03AH
            JP      Z,01F9AH
            LD      (HL),A
            INC     HL
            DEC     C
            JR      NZ,L1EB7            ; (-018H)
L1ECF:      LD      (HL),00DH
            INC     HL
L1ED2:      LD      A,C
            OR      A
            RET     Z
            LD      (HL),020H
            INC     HL
            DEC     C
            JR      L1ED2               ; (-009H)

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

L1EEE:      INC     HL
            INC     HL
            RET     

L1EF1:      CALL    SKPDE
            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     

            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,01F6DH
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            SBC     HL,DE
            JR      C,01F6DH             ; (+037H)
            LD      HL,(L107E)
            DEC     H
            DEC     H
            SBC     HL,DE
            JR      C,01F6DH             ; (+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
L1F58:      LD      (HL),000H
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L1F58            ; (-008H)
            POP     DE
            INC     DE
            INC     DE
            RST     018H
            DB      019H
            POP     HL
            POP     DE
            POP     BC
            POP     AF
            RET     

L1F6A:      LD      A,003H
            LD      HL,0063EH
            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,0403EH
            LD      HL,0C43EH
            JP      L0182

L1FAB:      LD      A,(L1FC0)
            OR      A
            LD      B,000H
            CALL    NZ,L1BA7
            CALL    L368D
            CALL    L3C34
            CALL    L2D08
            JP      L0D20

L1FC0:      DS      64, 000H
L2000:      DS      38, 000H
L2026:      DS      263, 000H
L212D:      DS      211, 000H
L2200:      DS      294, 000H
L2326:      DS      986, 000H
L2700:      DS      16, 000H
L2710:      DS      240, 000H
L2800:      DS      256, 000H
            LD      (02905H),DE
            RET     

L2905:      NOP     
            NOP     
L2907:      LD      BC,L0000
            LD      DE,00001H
            BIT     2,A
            CALL    Z,L2ED0
            LD      HL,(L180D)
            LD      A,(HL)
            LD      (HL),C
            LD      C,A
            INC     HL
            LD      A,(HL)
            LD      (HL),B
            LD      B,A
            LD      HL,(L180B)
            LD      DE,L0100
            JP      L2FCF

            CALL    SKPDE
            CALL    L181A
            LD      HL,L11A4
            PUSH    HL
            LD      A,B
            OR      A
            CALL    NZ,LDHLDE
            LD      B,020H
            LD      A,020H
            CALL    ?SETHL
            LD      A,(IY+012H)
            OR      A
            JP      NZ,01F7FH
            CALL    L29DF
            JR      NC,L2964            ; (+01dH)
            LD      (IY+014H),E
            LD      (IY+015H),D
            LD      (IY+046H),001H
            JR      Z,L2964             ; (+011H)
            CALL    L29C2
            CALL    L2A08
            CALL    L297C
            LD      (IY+040H),L
            LD      (IY+041H),H
            JR      L296A               ; (+006H)

L2964:      CALL    L297C
            CALL    L29AB
L296A:      POP     HL
            CALL    L2E24
            LD      (IY+044H),001H
L2972:      LD      HL,(L2905)
            INC     HL
            LD      (L2905),HL
            JP      L1815

L297C:      LD      HL,(L2905)
            DEC     HL
            PUSH    HL
            ADD     HL,HL
            LD      E,H
            LD      D,000H
            LD      HL,(L180B)
            ADD     HL,DE
            ADD     HL,DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            POP     HL
            LD      A,L
            PUSH    AF
            RRA     
            RRA     
            RRA     
            AND     00FH
            LD      L,A
            LD      H,000H
            ADD     HL,DE
            POP     AF
            AND     007H
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            LD      DE,(0180BH)
            INC     D
            ADD     A,E
            LD      E,A
            RET     NC
            INC     D
            RET     

L29AB:      LD      A,(IY+040H)
            CP      L
            JR      NZ,L29B6            ; (+005H)
            LD      A,(IY+041H)
            CP      H
            RET     Z
L29B6:      CALL    L29C2
            LD      (IY+040H),L
            LD      (IY+041H),H
            XOR     A
            JR      L29CC               ; (+00aH)

L29C2:      XOR     A
            CP      (IY+044H)
            RET     Z
            LD      (IY+044H),A
            LD      A,003H
L29CC:      CALL    SKPDE
            LD      C,(IY+040H)
            LD      B,(IY+041H)
            LD      DE,L0100
            LD      HL,(L180B)
            INC     H
            JP      L2FD1

L29DF:      LD      L,(IY+014H)
            LD      H,(IY+015H)
            LD      DE,(02905H)
            LD      A,H
            OR      L
            JR      NZ,L29F1            ; (+004H)
            OR      0FFH
            SCF     
            RET     

L29F1:      CALL    L2FC9
            RET     NC
            CALL    SKPDE
            DEC     HL
            DEC     DE
            LD      A,L
            AND     080H
            LD      L,A
            LD      A,E
            AND     080H
            LD      E,A
            CALL    L2FC9
            RET     C
            SCF     
            RET     

L2A08:      CALL    SKPDE
            LD      HL,(L2905)
            DEC     HL
            ADD     HL,HL
            LD      B,H
            INC     B
            LD      HL,(L180B)
L2A15:      LD      A,(HL)
            INC     HL
            OR      (HL)
            CALL    Z,L2A23
            INC     HL
            DJNZ    L2A15               ; (-009H)
            LD      (IY+046H),001H
            RET     

L2A23:      CALL    SKPDE
            PUSH    HL
            LD      DE,00010H
            CALL    L2ED0
            POP     HL
            LD      (HL),B
            DEC     HL
            LD      (HL),C
            LD      HL,(L180B)
            INC     H
            XOR     A
L2A36:      LD      (HL),020H
            INC     HL
            DEC     A
            JR      NZ,L2A36            ; (-006H)
            DEC     H
            LD      DE,L0100
            LD      A,010H
L2A42:      PUSH    AF
            CALL    L2FCF
            POP     AF
            INC     BC
            DEC     A
            JR      NZ,L2A42            ; (-009H)
            RET     

L2A4C:      LD      L,(IY+014H)
            LD      H,(IY+015H)
            LD      A,H
            OR      L
            SCF     
            RET     Z
            LD      DE,0FF02H
            PUSH    HL
            ADD     HL,DE
            JR      C,L2A60             ; (+003H)
            LD      HL,L0000
L2A60:      LD      (IY+014H),L
            LD      (IY+015H),H
            POP     DE
            LD      HL,(L180B)
            DEC     HL
            LD      (HL),D
            DEC     HL
            LD      (HL),E
            CALL    L2A88
            OR      A
            LD      A,(L1043)
            BIT     2,A
            RET     NZ
            LD      HL,(L180D)
            LD      A,(HL)
            LD      (IY+01EH),A
            INC     HL
            LD      A,(HL)
            LD      (IY+01FH),A
            LD      DE,L0000
            RET     

L2A88:      LD      C,(IY+01EH)
            LD      B,(IY+01FH)
            LD      A,B
            OR      C
            JP      Z,01F76H
            LD      DE,L0100
            LD      HL,(L180B)
            JP      02FD0H

            RET     

            XOR     A
            LD      (DE),A
            PUSH    HL
            PUSH    DE
            PUSH    DE
            CALL    L29DF
            POP     DE
            JR      C,L2AC7             ; (+01fH)
            CALL    L181A
            PUSH    DE
            CALL    L297C
            CALL    L29AB
            EX      DE,HL
            POP     DE
            CALL    L2E24
            XOR     A
            LD      (DE),A
            CALL    L2972
            LD      B,020H
            XOR     A
            LD      HL,(L1040)
            INC     HL
            RES     7,(HL)
            JR      L2ACF               ; (+008H)

L2AC7:      XOR     A
            LD      B,A
            LD      HL,(L1040)
            INC     HL
            SET     7,(HL)
L2ACF:      POP     DE
            POP     HL
            RET     

L2AD2:      LD      DE,(ELMD20)
            LD      BC,(ELMD30)
            CALL    02FD0H
            JP      L2D08

L2AE0:      CALL    L2AEA
            LD      IY,L1000
            JP      L2C07

L2AEA:      PUSH    DE
            CALL    L2DD0
            CALL    L2ED0
            LD      (ELMD30),BC
            LD      D,E
            LD      E,000H
            POP     HL
            JP      L2FCF

            OR      A
            JR      NZ,L2B34            ; (+035H)
            PUSH    DE
            CALL    L2B6A
            LD      A,000H
            CALL    Z,L2B51
            POP     DE
            CALL    L2AEA
            LD      HL,L1000
            OR      0FFH
            CALL    L2B51
            CALL    L2E2A
            LD      HL,L2000
            LD      (HL),081H
            PUSH    HL
            POP     IY
            LD      HL,(L1014)
            LD      (IY+014H),L
            LD      (IY+015H),H
            LD      HL,(ELMD30)
            LD      (IY+01EH),L
            LD      (IY+01FH),H
            JP      L2F37

L2B34:      PUSH    HL
            CALL    L2B6A
            JP      NZ,01F88H
            DEC     (HL)
            LD      DE,L1000
            CALL    L2E24
            CALL    L2F37
L2B45:      XOR     A
            LD      HL,L2000
            CALL    L2B51
            CALL    L2E2A
            POP     HL
            RET     

L2B51:      CALL    SKPDE
            PUSH    AF
            LD      DE,00014H
            ADD     HL,DE
            CALL    LDDEMI
            LD      BC,00008H
            ADD     HL,BC
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            CALL    L2DD8
            POP     AF
            JP      L2E77

L2B6A:      CALL    L1D15
            JP      Z,01F97H
            CALL    L2E36
            CALL    02F38H
            LD      A,(HL)
            CP      081H
            RET     

L2B7A:      LD      A,009H
            LD      (L1043),A
L2B7F:      CALL    L2F6E
            XOR     B
            DEC     HL
            LD      A,(L1043)
            BIT     0,A
            JP      NZ,01F73H
            PUSH    AF
            LD      DE,00001H
            CALL    L2ED0
            LD      (IY+01EH),C
            LD      (IY+01FH),B
            LD      (IY+046H),001H
            POP     AF
            BIT     1,A
            RET     Z
            LD      HL,(L180D)
            LD      (HL),C
            INC     HL
            LD      (HL),B
            RET     

            RET     M
            RET     Z
            CALL    L1E9A
            RET     NZ
            POP     AF
            LD      A,(L1043)
            BIT     1,A
            JP      NZ,01F79H
            PUSH    HL
            CALL    L2E24
            LD      B,020H
            CALL    ?CLRDE
            POP     HL
            LD      A,(HL)
            PUSH    IY
            POP     DE
            CALL    L2E24
            LD      HL,L1043
            BIT     3,(HL)
            RET     NZ
            BIT     0,(HL)
            JP      NZ,L2A4C
            CALL    L2E5E
            CALL    L2A88
            LD      D,H
            LD      E,L
L2BDB:      LD      A,(HL)
            INC     HL
            OR      (HL)
            INC     HL
            JR      NZ,L2BDB            ; (-006H)
            DEC     HL
            DEC     HL
            SBC     HL,DE
            LD      (IY+042H),L
            LD      (IY+043H),H
            RET     

L2BEC:      LD      A,B
            OR      A
            RET     Z
            LD      A,(L1043)
            BIT     0,A
            RET     NZ
            BIT     2,A
            JR      NZ,L2C20            ; (+027H)
            LD      A,006H
            CALL    L2907
            PUSH    IY
            POP     HL
            LD      DE,L1000
            CALL    L2E24
L2C07:      CALL    L2F6E
            RLA     
            INC     L
            JP      Z,01F85H
L2C0F:      LD      A,001H
            LD      B,(IY+000H)
            JP      L2D6A

            RET     M
            RET     Z
            CALL    L1E9A
            RET     NZ
            JP      01F79H

L2C20:      CALL    L29C2
            LD      A,(IY+046H)
            OR      A
            RET     Z
            CALL    L2F6E
            LD      (0CA2CH),A
            ADD     A,L
            RRA     
            JR      L2C0F               ; (-023H)

            RET     M
            RET     Z
            CALL    L1E9A
            RET     NZ
            POP     AF
            LD      (IY+045H),001H
            LD      A,(HL)
            CP      (IY+000H)
            JP      NZ,01F9DH
            JR      L2C0F               ; (-037H)

            CALL    SKPDE
            LD      (02C60H),A
            CALL    L2F6E
            LD      D,H
            INC     L
            JP      01F73H

            RET     Z
            RET     M
            CALL    L1E9A
            RET     NZ
            POP     AF
            LD      BC,L0012
            ADD     HL,BC
            LD      (HL),0FFH
L2C61:      CALL    L2F37
            JP      L2D08

            CALL    SKPDE
            CALL    L2F6E
            LD      (HL),D
            INC     L
            JP      01F73H

            RET     Z
            RET     M
            CALL    L1E9A
            RET     NZ
            POP     AF
            CALL    L2CFB
            PUSH    HL
            LD      DE,L1000
            CALL    L2E24
            XOR     A
            LD      (L1042),A
            LD      IX,L2C9B
            CALL    L1C5F
            XOR     A
            LD      (L1000),A
            POP     HL
L2C93:      LD      B,(HL)
            LD      IY,L1000
            JP      L2D6A

L2C9B:      INC     HL
            INC     HL
            INC     HL
            CALL    L1E9A
            JP      Z,01F7CH
L2CA4:      RET     

L2CA5:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            DEC     C
            CALL    SKPDE
            LD      HL,L2CA4
            CALL    L1EB4
            XOR     A
L2CC0:      LD      (02CE3H),A
            CALL    L2F6E
            JP      Z,L182C
            JR      L2C93               ; (-038H)

            RET     M
            LD      DE,L2CA4
            CALL    L1E9D
            JP      Z,01F79H
            CALL    L1E9A
            RET     NZ
            LD      (02CE9H),HL
            LD      A,001H
            LD      (02CE3H),A
            RET     

            LD      A,0FFH
            OR      A
            JP      Z,01F73H
            LD      HL,0FFFFH
            CALL    L2CFB
            LD      DE,L2CA5
            INC     HL
            EX      DE,HL
            LD      BC,00011H
            LDIR    
            JP      L2C61

L2CFB:      CALL    SKPDE
            LD      DE,L0012
            ADD     HL,DE
            LD      A,(HL)
            OR      A
            RET     Z
            JP      01F7FH

L2D08:      CALL    IOOUT
            XOR     A
            LD      (L1FC0),A
            LD      A,LSE0
L2D11:      PUSH    AF
            RST     018H
            DB      02BH
            POP     AF
            INC     A
            JR      NZ,L2D11            ; (-007H)
            LD      HL,(L1044)
            LD      DE,$FD
            CALL    L2FC9
            RET     NZ
            LD      A,(L1046)
            EXX     
            LD      H,A
            LD      D,000H
            LD      B,003H
            EXX     
            XOR     A
            LD      (L1042),A
L2D30:      EXX     
            LD      A,B
            LD      (L1046),A
            ADD     A,090H
            LD      L,A
            LD      E,000H
            EXX     
            LD      IX,L2D5C
            CALL    L1C5F
            EXX     
            BIT     7,E
            LD      A,L
            EXX     
            CALL    Z,L1EF1
            EXX     
            DEC     B
            EXX     
            JP      P,L2D30
            EXX     
            LD      A,H
            LD      (L1046),A
            BIT     7,D
            EXX     
            CALL    Z,L368D
            RET     

L2D5C:      EXX     
            LD      DE,0FFFFH
            EXX     
            RET     

L2D62:      LD      A,(L1046)
            ADD     A,090H
            RST     018H
            DB      029H
            RET     

L2D6A:      LD      (L2DCF),A
            LD      A,B
            PUSH    AF
            EX      DE,HL
            LD      HL,L1000
            CALL    L2E24
            CALL    L2E36
            POP     AF
            CP      005H
            JR      C,L2D88             ; (+00aH)
            LD      A,(L1012)
            RLA     
            LD      A,003H
            JR      NC,L2D88            ; (+002H)
            LD      A,001H
L2D88:      LD      HL,02D9CH
            ADD     A,A
            CALL    ADDHLA
            CALL    INDRCT
            CALL    L00FA
            CALL    L2F37
            CALL    L2E2A
            JP      L2D08

            ADD     A,02DH
            ADD     A,02DH
            AND     (HL)
            DEC     L
            JP      PO,L212D
            JR      NZ,02DB9H            ; (+010H)
L2DA9:      DEC     HL
            LD      B,(HL)
            DEC     HL
            LD      C,(HL)
            LD      A,B
            OR      C
            RET     Z
            LD      DE,L0100
            LD      HL,L11A4
            PUSH    HL
            PUSH    DE
            CALL    02FD0H
            LD      DE,00001H
            CALL    L2DC9
            POP     DE
            POP     HL
            ADD     HL,DE
            JR      L2DA9               ; (-01dH)

            CALL    L2DD0
L2DC9:      LD      A,(L2DCF)
            JP      L2E77

L2DCF:      NOP     
L2DD0:      LD      DE,(ELMD20)
            LD      BC,(ELMD30)
L2DD8:      LD      A,E
            OR      D
            JR      Z,L2DDD             ; (+001H)
            DEC     DE
L2DDD:      INC     D
            LD      E,D
            LD      D,000H
            RET     

            LD      DE,L0100
            LD      BC,(ELMD30)
            LD      A,(L2DCF)
            OR      A
            LD      HL,L11A4
            JR      Z,L2DF5             ; (+003H)
            LD      HL,(L180B)
L2DF5:      PUSH    HL
            PUSH    AF
            CALL    L2FD1
            POP     AF
            PUSH    AF
            JR      Z,L2E02             ; (+004H)
            LD      A,(IY+045H)
            OR      A
L2E02:      LD      DE,00001H
            CALL    Z,L2DC9
            POP     AF
            POP     HL
            JR      Z,L2E13             ; (+007H)
            LD      E,(IY+042H)
            LD      D,(IY+043H)
            ADD     HL,DE
L2E13:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            INC     HL
            LD      A,B
            OR      C
            RET     Z
            PUSH    HL
            LD      DE,00010H
            CALL    L2DC9
            POP     HL
            JR      L2E13               ; (-011H)

L2E24:      LD      BC,00020H
            LDIR    
            RET     

L2E2A:      LD      HL,L2800
            LD      DE,L0100
            LD      BC,L000F
            JP      L2FCF

L2E36:      LD      HL,L2800
            CALL    L2E67
            PUSH    HL
            CALL    L2D62
            EX      DE,HL
            POP     HL
            RET     C
            PUSH    HL
            LD      A,(DE)
            CP      (HL)
            JP      NZ,01F88H
            LD      BC,L0006
            ADD     HL,BC
            EX      DE,HL
            ADD     HL,BC
            EX      DE,HL
            LD      B,FDPC
L2E52:      LD      A,(DE)
            CPL     
            AND     (HL)
            JP      NZ,01F88H
            INC     HL
            INC     DE
            DJNZ    L2E52               ; (-00aH)
            POP     HL
            RET     

L2E5E:      CALL    L2D62
            RET     NC
            LD      DE,L0100
            RST     018H
            DB      02AH
L2E67:      LD      BC,L000F
            LD      DE,L0100
            XOR     A
            CALL    L2FD4
            LD      A,(HL)
            OR      A
            JP      M,01F70H
            RET     

L2E77:      LD      HL,L2800
            CALL    L2E84
            OR      A
            RET     NZ
            CALL    L2D62
            RET     C
            XOR     A
L2E84:      CALL    IOOUT
            OR      A
            PUSH    HL
            LD      HL,0B600H
            LD      A,013H
            JR      NZ,L2E95            ; (+005H)
            LD      HL,0A62FH
            LD      A,01BH
L2E95:      LD      (L2EB2),A
            LD      (L2EC8),HL
            POP     HL
L2E9C:      CALL    L2EA4
            INC     BC
            DEC     E
            JR      NZ,L2E9C            ; (-007H)
            RET     

L2EA4:      CALL    SKPDE
            INC     HL
            LD      A,C
            SUB     (HL)
            LD      C,A
            JR      NC,L2EAE            ; (+001H)
            DEC     B
L2EAE:      INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L2EB2:      NOP     
            DEC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            INC     HL
            INC     HL
            LD      A,C
            LD      E,003H
L2EBD:      SRL     B
            RR      C
            DEC     E
            JR      NZ,L2EBD            ; (-007H)
            ADD     HL,BC
            CALL    L2F2B
L2EC8:      NOP     
            NOP     
            CP      (HL)
            LD      (HL),A
            RET     NZ
            JP      01F88H

L2ED0:      PUSH    DE
            CALL    L2E5E
            POP     DE
            PUSH    HL
            CALL    L2EDE
            POP     HL
            LD      A,001H
            JR      L2E84               ; (-05aH)

L2EDE:      LD      A,E
            EXX     
            LD      E,A
            LD      D,A
            LD      B,001H
            EXX     
            INC     HL
            LD      E,(HL)
            LD      D,000H
            INC     HL
            INC     HL
            INC     HL
            LD      C,(HL)
            INC     HL
            LD      B,(HL)
            DEC     BC
            LD      (02EFCH),BC
            INC     HL
            PUSH    HL
            EXX     
            POP     HL
            EXX     
            LD      B,D
            LD      C,E
L2EFB:      LD      HL,L0000
            OR      A
            SBC     HL,DE
            JP      C,01F8BH
            EXX     
            LD      A,B
            AND     (HL)
            EXX     
            CALL    L2F15
            INC     DE
            EXX     
            RLC     B
            JR      NC,L2F12            ; (+001H)
            INC     HL
L2F12:      EXX     
            JR      L2EFB               ; (-01aH)

L2F15:      JR      NZ,L2F24            ; (+00dH)
            EXX     
            DEC     E
            EXX     
            RET     NZ
            POP     AF
            EXX     
            LD      A,D
            EXX     
            LD      E,A
            LD      D,000H
            OR      A
            RET     

L2F24:      EXX     
            LD      E,D
            EXX     
            LD      B,D
            LD      C,E
            INC     BC
            RET     

L2F2B:      PUSH    BC
            AND     007H
            INC     A
            LD      B,A
            XOR     A
            SCF     
L2F32:      ADC     A,A
            DJNZ    L2F32               ; (-003H)
            POP     BC
            RET     

L2F37:      OR      0AFH
            LD      HL,L2000
            LD      DE,00800H
            LD      BC,00010H
            CALL    L2FD1
            LD      A,(HL)
            OR      A
            JP      P,01F70H
            RET     

L2F4B:      PUSH    HL
            PUSH    DE
            CALL    L2E36
            INC     HL
            INC     HL
            CALL    LDDEMI
            CALL    INDRCT
            XOR     A
            SBC     HL,DE
            JP      C,01F70H
            SRL     H
            RR      L
            SRL     H
            RR      L
            LD      B,H
            LD      C,L
            POP     DE
            POP     HL
            OR      A
            JP      L368D

L2F6E:      CALL    L1D15
            JP      Z,01F97H
            POP     HL
            CALL    LDDEMI
            LD      (02FB1H),HL
            LD      (02F97H),DE
            XOR     A
            LD      (L2FC3),A
            CALL    02F38H
            LD      (L2FC7),HL
            LD      A,040H
            LD      (L2FC6),A
L2F8E:      LD      HL,(L2FC7)
            LD      A,(HL)
            OR      A
            CALL    Z,L2FB3
            CALL    0FFFFH
            LD      HL,(L2FC7)
            LD      BC,00020H
            ADD     HL,BC
            LD      (L2FC7),HL
            LD      HL,L2FC6
            DEC     (HL)
            JR      NZ,L2F8E            ; (-01bH)
            LD      A,(L2FC3)
            LD      HL,(L2FC4)
            OR      A
            JP      0FFFFH

L2FB3:      PUSH    AF
            LD      A,(L2FC3)
            OR      A
            JR      NZ,L2FC1            ; (+007H)
            INC     A
            LD      (L2FC3),A
            LD      (L2FC4),HL
L2FC1:      POP     AF
            RET     

L2FC3:      NOP     
L2FC4:      NOP     
            NOP     
L2FC6:      NOP     
L2FC7:      NOP     
            NOP     
L2FC9:      PUSH    HL
            OR      A
            SBC     HL,DE
            POP     HL
            RET     

L2FCF:      OR      0AFH
L2FD1:      CALL    L2FE8
L2FD4:      CALL    SKPDE
            OR      A
            LD      IX,(ZINP)
            JR      Z,L2FE2             ; (+004H)
            LD      IX,(ZOUT)
L2FE2:      LD      A,(L1046)
            JP      IOCALL

L2FE8:      CALL    IOOUT
            LD      A,(L35B5)
            OR      A
            RET     M
            CALL    L2D62
            RET     C
            JP      L2E36

$CMT:       DB      "Y3CMT",000H,05FH ; $CMT - Cassette device descriptor
L2FFE:      DB      0C0H,000H,014H,"0d0",022H,030H
            DB      LSE5
            DS      2, 000H
            DB      001H,0AAH,"0]0",097H,01FH,097H,01FH,097H,01FH
            CALL    TEST1
            DB      054H
            LD      HL,L2FFE
            SET     4,(HL)
            RET     Z
            RES     4,(HL)
            OR      A
            RET     

            CALL    SKPDE
            LD      DE,L10F0
            LD      A,(HL)
            LD      C,005H
            CP      002H
            JR      Z,L303D             ; (+00eH)
            LD      C,004H
L3031:      CP      003H
            JR      Z,L303D             ; (+008H)
            LD      C,A
L3036:      SUB     004H
            CP      002H
            JP      C,01F9DH
L303D:      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,L0080
            CALL    L30CB
            JR      L3060               ; (+003H)

            CALL    L30D2
L3060:      JP      C,L017B
            RET     

            LD      A,037H
            LD      (L30AA),A
            PUSH    HL
            LD      HL,L10F0
            LD      BC,L0080
            CALL    L3114
            JR      C,L30C1             ; (+04cH)
            LD      DE,L3332
            CALL    L3301
            POP     DE
            LD      A,(HL)
            LD      C,002H
            CP      005H
            JR      Z,L3091             ; (+00eH)
            LD      C,003H
            CP      004H
            JR      Z,L3091             ; (+008H)
            LD      C,A
            SUB     002H
            CP      002H
            JP      C,01F9DH
L3091:      LD      A,C
            LD      (DE),A
            INC     HL
            INC     DE
            LD      BC,00011H
            LDIR    
            XOR     A
            LD      B,002H
            CALL    ?CLRDE
            LD      BC,L0006
            LDIR    
            LD      B,006H
            JP      ?CLRDE

L30AA:      XOR     A
            JR      NC,L30BD            ; (+010H)
            LD      A,0AFH
            LD      (L30AA),A
            PUSH    HL
            LD      HL,L1000
            LD      DE,L333F
            CALL    L3301
            POP     HL
L30BD:      CALL    L311B
            RET     NC
L30C1:      CP      002H
            JP      NZ,L017B
            LD      A,0C6H
            JP      L0182

L30CB:      CALL    L32D4
            LD      A,LSWF
            JR      L30D4               ; (+002H)

L30D2:      LD      A,053H
L30D4:      LD      (03109H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      E,A
            LD      D,0D7H
            LD      A,B
            OR      C
            JR      Z,L3107             ; (+024H)
            CALL    L32CB
            CALL    L3174
            JR      C,L3101             ; (+016H)
            LD      A,E
            CP      LSWF
            JR      NZ,L30F8            ; (+008H)
            PUSH    DE
            LD      DE,L3325
            CALL    L3301
            POP     DE
L30F8:      DI      
            OUT     (LSE4),A
            CALL    00780H
            CALL    NC,L31DD
L3101:      DI      
            OUT     (LSE4),A
            CALL    00700H
L3107:      POP     DE
            LD      SP,L0000
            OUT     (LSE0),A
            OUT     (LSE1),A
            PUSH    AF
            RST     018H
            DB      011H
            POP     AF
            RET     

L3114:      CALL    L32D4
            LD      A,LSWF
            JR      L311D               ; (+002H)

L311B:      LD      A,053H
L311D:      LD      (03109H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      D,LSD2
            LD      E,A
            LD      A,B
            OR      C
            JR      Z,L3107             ; (-025H)
            CALL    L3174
            DI      
            OUT     (LSE4),A
            CALL    NC,L065B
            CALL    NC,L3220
            JR      L3101               ; (-039H)

L313A:      PUSH    HL
            LD      DE,L334C
            LD      HL,L1000
            CALL    L3301
            POP     HL
            CALL    L3153
            RET     NC
            CP      002H
            JP      NZ,L017B
            LD      A,083H
            JP      L0182

L3153:      LD      (03109H),SP
            LD      SP,L10F0
            PUSH    DE
            LD      D,LSD2
            LD      E,053H
            LD      A,B
            OR      C
            JR      Z,L3107             ; (-05cH)
            CALL    L32CB
            CALL    L3174
            DI      
            OUT     (LSE4),A
            CALL    NC,L065B
            CALL    NC,L3274
            JR      L3101               ; (-073H)

L3174:      CALL    SKPDE
            RST     018H
            DB      010H
            LD      HL,0E000H
            LD      A,FDPA
            CALL    POPRA
            LD      B,00AH
L3183:      LD      HL,0E002H
            CALL    BREAKX
            AND     010H
            JR      Z,L319A             ; (+00dH)
L318D:      LD      B,0FFH
            OUT     (LSE2),A
L3191:      CALL    L09A6
            DJNZ    L3191               ; (-005H)
            OUT     (LSE0),A
            XOR     A
            RET     

L319A:      LD      HL,0E003H
            LD      A,006H
            CALL    POPRA
            INC     A
            CALL    POPRA
            DJNZ    L3183               ; (-025H)
            LD      A,(L0050)
            OR      A
            JR      NZ,L31C7            ; (+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,L32BC
            JR      Z,L31C3             ; (+003H)
            LD      DE,L32C3
L31C3:      RST     018H
            DB      005H
            RST     018H
            DB      002H
L31C7:      LD      HL,0E002H
            CALL    BREAKX
            AND     010H
            JR      NZ,L318D            ; (-044H)
            LD      HL,0E001H
            CALL    BREAKX
            AND     080H
            JR      NZ,L31C7            ; (-014H)
            SCF     
            RET     

L31DD:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      D,002H
            LD      A,FDPA
            LD      (0E000H),A
L31E7:      OUT     (LSE1),A
            LD      A,(HL)
            OUT     (LSE3),A
            CALL    L32C8
            LD      A,(0E001H)
            AND     080H
            SCF     
            JR      Z,L321C             ; (+025H)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L31E7            ; (-016H)
            LD      HL,(L1197)
            LD      A,H
            CALL    L32C8
            LD      A,L
            CALL    L32C8
            CALL    L0D60
            XOR     A
            DEC     D
            JR      Z,L321C             ; (+00dH)
            LD      B,000H
L3211:      CALL    L0D47
            DJNZ    L3211               ; (-005H)
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
            JR      L31E7               ; (-035H)

L321C:      POP     HL
            POP     BC
            POP     DE
            RET     

L3220:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      H,002H
L3225:      LD      BC,0E001H
            LD      DE,0E002H
L322B:      CALL    00601H
            JR      C,L3267             ; (+037H)
            CALL    00A4AH
            LD      A,(DE)
            AND     020H
            JR      Z,L322B             ; (-00dH)
            LD      D,H
            LD      HL,L0000
            LD      (L1197),HL
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
L3243:      CALL    L0624
            JR      C,L3267             ; (+01fH)
            OUT     (LSE1),A
            LD      (HL),A
            OUT     (LSE3),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3243            ; (-010H)
            LD      HL,(L1197)
            CALL    L0624
            JR      C,L3267             ; (+00cH)
            CP      H
            JR      NZ,L326B            ; (+00dH)
            CALL    L0624
            JR      C,L3267             ; (+004H)
            CP      L
            JR      NZ,L326B            ; (+005H)
L3266:      XOR     A
L3267:      POP     HL
            POP     BC
            POP     DE
            RET     

L326B:      DEC     D
            LD      H,D
            JR      NZ,L3225            ; (-04aH)
L326F:      LD      A,002H
            SCF     
            JR      L3267               ; (-00dH)

L3274:      PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      H,002H
L3279:      LD      BC,0E001H
            LD      DE,0E002H
L327F:      CALL    00601H
            JR      C,L3267             ; (-01dH)
            CALL    00A4AH
            LD      A,(DE)
            AND     020H
            JR      Z,L327F             ; (-00dH)
            LD      D,H
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
L3291:      CALL    L0624
            JR      C,L3267             ; (-02fH)
            OUT     (LSE1),A
            CP      (HL)
            OUT     (LSE3),A
            JR      NZ,L326F            ; (-02eH)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3291            ; (-012H)
            LD      HL,(CSMDT)
            CALL    L0624
            JR      C,L3267             ; (-044H)
            CP      H
            JR      NZ,L326F            ; (-03fH)
            CALL    L0624
            JR      C,L3267             ; (-04cH)
            CP      L
            JR      NZ,L326F            ; (-047H)
            DEC     D
            LD      H,D
            JR      NZ,L3279            ; (-041H)
            JR      L3266               ; (-056H)

L32BC:      DB      "RECORD."
L32C3:      DB      "PLAY",000H
L32C8:      DB      0C3H
            DB      06DH
            DB      007H
L32CB:      DB      QDPB
            DB      LSD3
            DB      LSE2
            DB      LSRF
            DB      01AH
            DB      007H
            DB      LSD3
            DB      LSE0
            DB      0C9H
L32D4:      DB      LSRF
            DB      008H,001H,03EH,0C9H,032H,0D4H,"2!6",000H,0CBH,076H,0C8H,021H,067H,007H,022H,0C9H,"2!z",007H,022H
            DB      LSFC
            DB      030H,021H,096H,009H,022H,092H,031H,021H,001H,00AH,022H,012H,032H,021H,01AH,00AH,022H,009H,032H,0C9H
L3301:      DB      03AH
            DB      050H
            DB      000H
            DB      0B7H
            DB      0C0H
            DB      0DFH
            DB      002H
            DB      0DFH
            DB      005H
            DB      LSE5
            DB      023H,03EH,022H,0DFH,003H,016H,010H,07EH,0FEH,00DH,028H,006H,0DFH,003H,023H,015H,020H
            DB      QDPD
            DB      03EH
            DB      022H
            DB      0DFH
            DB      003H
            DB      0DFH
            DB      002H
            DB      LSE1
            DB      0C9H
L3325:      DB      057H,005H,"RITING"
            DS      3, 020H
            DB      006H
            DB      000H
L3332:      DB      046H,005H,"OUND"
            DS      5, 020H
            DB      006H
            DB      000H
L333F:      DB      04CH,005H,"OADING"
            DS      3, 020H
            DB      006H
            DB      000H
L334C:      DB      056H,005H,"ERIFYING "
            LD      B,000H
$RS:        DB      08DH,"5RS" ; $RS - RS-232C device descriptor
            DS      2, 000H
            DB      08FH,001H,000H,072H,033H,0A4H,033H,0A4H,033H,0B5H,033H,0B5H,033H,0C6H,033H,0DBH,033H
            DB      LSE5
            DB      000H
            DB      0D8H
            DB      0FDH
            DB      LSE5
            DB      LSRF
            CALL    PE,0CD33H
            ADD     A,B
            INC     SP
            CALL    L3435
            JR      L33D8               ; (+058H)

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

            PUSH    IY
            CALL    L33EC
            LD      A,(IY-001H)
            INC     (IY-001H)
            OR      A
            CALL    Z,L3497
            JR      L33D8               ; (+023H)

            PUSH    IY
            CALL    L33EC
            DEC     (IY-001H)
            LD      A,(IY-001H)
            OR      A
            CALL    Z,L347F
            JR      L33D7               ; (+011H)

            PUSH    IY
            CALL    L33EC
            CALL    L34E6
            JR      C,L33D8             ; (+008H)
            CP      (IY-008H)
            JR      NZ,L33D7            ; (+002H)
            LD      A,00DH
L33D7:      OR      A
L33D8:      POP     IY
            RET     

            PUSH    IY
            CALL    L33EC
            CP      00DH
            JR      NZ,L33E7            ; (+003H)
            LD      A,(IY-008H)
L33E7:      CALL    L352B
            JR      L33D8               ; (-014H)

L33EC:      PUSH    AF
            PUSH    DE
            LD      A,(L1046)
            INC     A
            LD      IY,033F7H
            LD      DE,L0015
L33F9:      ADD     IY,DE
            DEC     A
            JR      NZ,L33F9            ; (-005H)
            LD      C,(IY+000H)
            POP     DE
            POP     AF
            RET     

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            OR      C
            OR      B
            NOP     
            DJNZ    L3421               ; (+010H)
            INC     B
            LD      B,B
            INC     BC
            RET     NZ
            DEC     B
            LD      H,B
            JR      NC,L341C            ; (+003H)
            NOP     
            NOP     
            NOP     
L341C:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L3421:      OR      E
            OR      D
            NOP     
            DJNZ    03436H               ; (+010H)
            INC     B
            LD      B,B
            INC     BC
            RET     NZ
            DEC     B
            LD      H,B
            JR      NC,L3431            ; (+003H)
L342E:      CALL    BRKCHK
L3431:      RET     NZ
            JP      0017DH

L3435:      LD      A,018H
            OUT     (C),A
            LD      A,030H
            OUT     (C),A
            LD      A,(IY-002H)
            AND     00CH
            JR      NZ,L3448            ; (+004H)
            SET     2,(IY-002H)
L3448:      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    L348B
L346C:      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,L346C             ; (-012H)
            RET     

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

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

L349C:      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
L34C5:      RES     7,(IY+00AH)
            JR      L34DB               ; (+010H)

L34CB:      SET     1,(IY+00AH)
            JR      L34DB               ; (+00aH)

L34D1:      RES     1,(IY+00AH)
            JR      L34DB               ; (+004H)

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

L34E6:      CALL    SKPDE
            LD      C,(IY+000H)
L34EC:      CALL    L342E
            CALL    L3564
            JR      C,L34EC             ; (-008H)
            CALL    L349C
L34F7:      CALL    L342E
            IN      A,(C)
            RRCA    
            JR      NC,L34F7            ; (-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,L3516            ; (+005H)
            CALL    L34C5
            POP     AF
            RET     

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

L352B:      CALL    SKPDE
            LD      C,(IY+000H)
            LD      D,A
            CALL    L34CB
L3535:      CALL    L342E
            CALL    L356B
            CALL    NC,L357C
L353E:      JR      C,L3535             ; (-00bH)
            IN      A,(C)
            BIT     2,A
            JR      Z,L3535             ; (-011H)
            BIT     7,(IY-003H)
            JR      Z,L3555             ; (+009H)
            LD      A,001H
            OUT     (C),A
            IN      A,(C)
            RRCA    
            JR      NC,L3535            ; (-020H)
L3555:      DEC     C
            OUT     (C),D
            INC     C
            BIT     6,(IY-003H)
            JR      Z,L3562             ; (+003H)
            CALL    L34D1
L3562:      OR      A
            RET     

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

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

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

$FD:        DB      0A2H,"8FD" ; $FD - Floppy Disk device descriptor
            DS      2, 000H
            DB      03FH,003H,03FH,08DH,036H,00FH
            DS      2, 000H
            DB      001H,030H,000H,0FEH,000H,005H,037H,008H,037H,097H,01FH,097H,01FH,097H,01FH
            NOP     
L35AB:      NOP     
L35AC:      NOP     
L35AD:      NOP     
            NOP     
            NOP     
L35B0:      NOP     
L35B1:      NOP     
            NOP     
L35B3:      NOP     
L35B4:      NOP     
L35B5:      NOP     
L35B6:      NOP     
L35B7:      NOP     
            NOP     
            NOP     
            NOP     
L35BB:      NOP     
            NOP     
            NOP     
            NOP     
L35BF:      NOP     
L35C0:      PUSH    BC
            LD      A,L
            LD      B,004H
L35C4:      SRL     H
            RR      L
            DJNZ    L35C4               ; (-006H)
            AND     00FH
            INC     A
            LD      H,A
            POP     BC
            RET     

L35D0:      LD      A,H
            LD      H,000H
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            ADD     HL,HL
            DEC     A
            ADD     A,L
            LD      L,A
            RET     

L35DB:      CALL    SKPDE
            LD      HL,L35B5
            BIT     7,(HL)
            JR      NZ,L35EB            ; (+006H)
            CALL    L367C
            CALL    L3898
L35EB:      LD      A,(L35AC)
            BIT     2,A
            SET     2,A
            JR      Z,L35F6             ; (+002H)
            SET     5,A
L35F6:      SET     7,A
            LD      HL,L35B5
            BIT     6,(HL)
            JR      Z,L3601             ; (+002H)
            SET     6,A
L3601:      CALL    L361C
            LD      (HL),A
            LD      HL,L35B7
            CALL    L3614
            BIT     0,(HL)
            CALL    Z,L3695
            RET     C
            SET     0,(HL)
            RET     

L3614:      LD      A,(L35AC)
            AND     003H
            JP      ADDHLA

L361C:      OUT     (0DCH),A
            PUSH    AF
            RLCA    
            RLCA    
            OUT     (0DDH),A
            RLCA    
            OUT     (0DEH),A
            POP     AF
            RET     

L3628:      CALL    SKPDE
            LD      D,000H
            LD      A,(L35B3)
            SRL     A
            CPL     
            OUT     (0DBH),A
            LD      B,A
            LD      A,(L35B5)
            RES     6,A
            BIT     5,A
            JR      Z,L3640             ; (+001H)
            CCF     
L3640:      JR      C,L3644             ; (+002H)
            SET     6,A
L3644:      CALL    L361C
            LD      HL,L35B5
            CP      (HL)
            LD      (HL),A
            JR      Z,L364F             ; (+001H)
            INC     D
L364F:      LD      HL,L35BB
            CALL    L3614
            LD      A,(HL)
            OUT     (0D9H),A
            CP      B
            JR      Z,L3666             ; (+00bH)
            INC     D
            CALL    L3673
            PUSH    AF
            IN      A,(0D9H)
            LD      (HL),A
            POP     AF
            RET     C
            RET     NZ
L3666:      LD      A,(L35B4)
            CPL     
            OUT     (0DAH),A
            LD      A,D
            OR      A
            CALL    NZ,L388D
            XOR     A
            RET     

L3673:      LD      A,018H
            CALL    L36C2
            RET     C
            AND     099H
            RET     

L367C:      LD      HL,L35B5
            SET     7,(HL)
            LD      A,(HL)
            CALL    L361C
            LD      HL,L35B7
            LD      B,004H
            JP      ?CLRHL

L368D:      XOR     A
            CALL    L361C
            LD      (L35B5),A
            RET     

L3695:      CALL    SKPDE
            LD      HL,L35BB
            CALL    L3614
            LD      (HL),0FFH
            LD      A,008H
            CALL    L36C2
            RET     C
            AND     085H
            XOR     004H
            RET     Z
            JP      L385A

L36AE:      PUSH    AF
            LD      A,LSD0
            CALL    L36BB
            JR      C,L36B8             ; (+002H)
            POP     AF
            RET     

L36B8:      POP     HL
            POP     HL
            RET     

L36BB:      CALL    SKPDE
            LD      D,000H
            JR      L36DC               ; (+01aH)

L36C2:      CALL    SKPDE
            LD      B,A
            LD      A,(035AAH)
            CPL     
            AND     003H
            OR      B
            LD      D,000H
            JR      L36D6               ; (+005H)

L36D1:      CALL    SKPDE
            LD      D,001H
L36D6:      CALL    L36AE
            LD      (L35B6),A
L36DC:      CPL     
            OUT     (0D8H),A
            CALL    L3887
            LD      E,007H
L36E4:      LD      HL,L2710
L36E7:      DEC     HL
            LD      A,H
            OR      L
            JP      Z,L36F9
            IN      A,(0D8H)
            CPL     
            LD      B,A
            AND     081H
            CP      D
            JR      NZ,L36E7            ; (-00fH)
            LD      A,B
            OR      A
            RET     

L36F9:      DEC     E
            JP      Z,L385A
            LD      A,(L35B6)
            CPL     
            OUT     (0D8H),A
            JR      L36E4               ; (-021H)

            DB      037H
            JR      L3709               ; (+001H)

            OR      A
L3709:      EX      AF,AF'
            PUSH    AF
            EX      AF,AF'
            LD      (L35B1),HL
            PUSH    HL
            LD      HL,L35AB
            RL      (HL)
            RRC     (HL)
            LD      H,(HL)
            LD      L,A
            AND     007H
            LD      (L35AC),A
            CALL    L35DB
            JR      NC,L3728            ; (+005H)
            POP     HL
            EX      AF,AF'
            POP     AF
            EX      AF,AF'
            RET     

L3728:      BIT     7,H
            LD      A,L
            POP     HL
            PUSH    HL
            CALL    Z,L37E7
            LD      (035AFH),DE
            PUSH    DE
            OR      A
            PUSH    AF
            LD      H,B
            LD      L,C
            CALL    P,L35C0
            LD      (L35AD),HL
            LD      A,009H
            LD      (L35BF),A
            PUSH    IY
            CALL    L375C
            EX      AF,AF'
            POP     IY
            LD      HL,(L35B3)
            POP     AF
            CALL    P,L35D0
            LD      B,H
            LD      C,L
            POP     DE
            POP     HL
            POP     AF
            EX      AF,AF'
            JP      L37E7

L375C:      LD      E,000H
            LD      HL,(035AFH)
            LD      A,(L35B5)
            BIT     5,A
            JR      Z,L376B             ; (+003H)
            ADD     HL,HL
            LD      E,080H
L376B:      LD      A,L
            OR      A
            JR      Z,L3770             ; (+001H)
            INC     H
L3770:      LD      A,H
            LD      (L35B0),A
L3774:      CALL    L37FA
            CALL    NC,L3628
            RET     C
            JR      NZ,L37E1            ; (+064H)
            DI      
            LD      A,(L35AB)
            BIT     7,A
            LD      A,090H
            LD      IY,0A2EDH
            JR      NZ,L3791            ; (+006H)
            LD      A,0B4H
            LD      IY,0A3EDH
L3791:      LD      (L37A8),IY
            CALL    L36D1
            RET     C
L3799:      LD      B,E
            PUSH    DE
            LD      DE,0FE7CH
L379E:      IN      A,(0D8H)
            OR      E
            CP      D
            JR      Z,L379E             ; (-006H)
            CP      LSFC
            JR      NZ,L37AD            ; (+005H)
L37A8:      NOP     
            NOP     
            JP      NZ,L379E
L37AD:      POP     DE
            IN      A,(0D8H)
            RRA     
            JP      C,L385A
            LD      A,(L35B4)
            INC     A
            LD      (L35B4),A
            CP      011H
            JR      Z,L37C4             ; (+005H)
            DEC     D
            JR      NZ,L3799            ; (-029H)
            JR      L37C5               ; (+001H)

L37C4:      DEC     D
L37C5:      CALL    L36AE
            EI      
            IN      A,(0D8H)
            CPL     
            OR      A
            JR      NZ,L37E1            ; (+012H)
            LD      A,(L35AB)
            OR      A
            CALL    Z,L3830
            JR      C,L37E1             ; (+009H)
            CALL    L3818
            LD      A,D
            OR      A
            JR      NZ,L3774            ; (-06bH)
            XOR     A
            RET     

L37E1:      CALL    L380B
            RET     C
            JR      L3774               ; (-073H)

L37E7:      CALL    IOOUT
            LD      A,(L35B5)
            BIT     5,A
            RET     Z
L37F0:      LD      A,(HL)
            CPL     
            LD      (HL),A
            INC     HL
            DEC     DE
            LD      A,D
            OR      E
            JR      NZ,L37F0            ; (-009H)
            RET     

L37FA:      LD      HL,(L35AD)
            LD      (L35B3),HL
            LD      HL,(L35B1)
            LD      A,(L35B0)
            LD      D,A
            LD      C,0DBH
            OR      A
            RET     

L380B:      CALL    SKPDE
            LD      HL,L35BF
            DEC     (HL)
            JP      Z,L385A
            JP      L3695

L3818:      LD      (L35B1),HL
            LD      A,D
            LD      (L35B0),A
            LD      HL,(L35B3)
            LD      A,H
            CP      011H
            RET     NZ
            LD      H,001H
            INC     L
            LD      (L35AD),HL
            LD      (L35B3),HL
            RET     

L3830:      LD      A,(035AEH)
            CPL     
            OUT     (0DAH),A
            LD      A,090H
            CALL    L36D1
            RET     C
            LD      A,(L35B4)
            LD      B,A
L3840:      IN      A,(0D8H)
            CPL     
            AND     081H
            CP      001H
            JR      NZ,L3852            ; (+009H)
            IN      A,(0DAH)
            CPL     
            CP      B
            JR      NZ,L3840            ; (-00fH)
            CALL    L36AE
L3852:      IN      A,(0D8H)
            CPL     
            AND     099H
            RET     Z
            SCF     
            RET     

L385A:      LD      A,(L35B6)
            RLA     
            IN      A,(0D8H)
            CPL     
            JR      NC,L3878            ; (+015H)
            RLA     
            JR      C,L387B             ; (+015H)
            RLA     
            JR      NC,L3870            ; (+007H)
            LD      HL,L35AB
            BIT     7,(HL)
            JR      Z,L387F             ; (+00fH)
L3870:      AND     0C0H
            JR      NZ,L3883            ; (+00fH)
L3874:      LD      A,029H
            SCF     
            RET     

L3878:      RLA     
            JR      NC,L3874            ; (-007H)
L387B:      LD      A,032H
            SCF     
            RET     

L387F:      LD      A,02EH
            SCF     
            RET     

L3883:      LD      A,036H
            SCF     
            RET     

L3887:      PUSH    DE
            LD      DE,L000F
            JR      L3891               ; (+004H)

L388D:      PUSH    DE
            LD      DE,L2026
L3891:      DEC     DE
            LD      A,E
            OR      D
            JR      NZ,L3891            ; (-005H)
            POP     DE
            RET     

L3898:      PUSH    BC
            LD      B,011H
L389B:      CALL    L388D
            DJNZ    L389B               ; (-005H)
            POP     BC
            RET     

$QD:        DB      05EH,00DH,051H,044H ; $QD - Quick Disk device descriptor
            DS      2, 000H
            DB      "_@ ",0C4H,038H
            DB      FDPD
            DB      "8*9",0DAH,038H,000H,004H,018H
            DS      3, 039H
            DB      097H
            DB      01FH
            DB      097H
            DB      01FH
            DB      0C1H
            DB      038H
            NOP     
            NOP     
            XOR     A
            SCF     
            RET     

            RET     C
            CALL    L1E7A
            CALL    TEST1
            DB      000H
            JP      NZ,L1F6A
            CALL    L392F
            RET     C
            LD      HL,L3972
            LD      (HL),002H
            JR      L3928               ; (+04eH)

            OR      A
            JR      NZ,L38F4            ; (+017H)
            XOR     A
            LD      (L397E),A
            LD      HL,L3972
            LD      (HL),005H
            CALL    L3988
            LD      HL,00001H
            LD      (L3972),HL
            LD      HL,L3972
            JR      L3928               ; (+034H)

L38F4:      LD      HL,L3972
            LD      (HL),006H
            JR      L3928               ; (+02dH)

            LD      (L3974),HL
            LD      HL,L0003
            LD      (L3972),HL
            LD      HL,00040H
            LD      (L3976),HL
            LD      HL,L3972
            CALL    L3988
            RET     NC
            CP      028H
            SCF     
            RET     NZ
            LD      A,000H
            RET     

            LD      (L3974),HL
            LD      HL,00103H
            LD      (L3972),HL
            LD      (03976H),BC
            LD      HL,L3972
L3928:      JR      L3988               ; (+05eH)

            LD      A,037H
            LD      (L393C),A
L392F:      LD      A,001H
            LD      HL,L3973
            LD      (HL),A
            DEC     HL
            LD      (HL),A
            JR      L3988               ; (+04fH)

            LD      (L3971),A
L393C:      XOR     A
            JR      NC,L395B            ; (+01cH)
            LD      A,0AFH
            LD      (L393C),A
            CALL    L1C2B
            LD      (L3978),HL
            LD      HL,L1000
            LD      (L3974),HL
            LD      HL,00040H
            LD      (L3976),HL
            LD      A,(L3971)
            JR      L3963               ; (+008H)

L395B:      LD      (L3978),HL
            LD      A,(L3971)
            SET     0,A
L3963:      LD      (L3973),A
            LD      (0397AH),BC
            LD      HL,L3972
            LD      (HL),004H
            JR      L3988               ; (+017H)

L3971:      NOP     
L3972:      NOP     
L3973:      NOP     
L3974:      NOP     
            NOP     
L3976:      NOP     
            NOP     
L3978:      NOP     
            NOP     
            NOP     
            NOP     
L397C:      NOP     
L397D:      NOP     
L397E:      NOP     
L397F:      NOP     
L3980:      NOP     
L3981:      NOP     
L3982:      NOP     
L3983:      NOP     
L3984:      NOP     
L3985:      NOP     
            NOP     
            NOP     
L3988:      LD      A,002H
            LD      (L3984),A
L398D:      DI      
            CALL    L39D5
            EI      
            RET     NC
            PUSH    AF
            CP      028H
            JR      Z,L39D3             ; (+03bH)
            CALL    L3C34
            LD      A,(L3980)
            OR      A
            JR      Z,L39B8             ; (+017H)
            XOR     A
            LD      (L3980),A
            LD      A,(L3981)
            PUSH    HL
            LD      (03986H),SP
            POP     HL
            DI      
            CALL    L3BD3
            EI      
            JR      C,L39CD             ; (+018H)
            CALL    L3C34
L39B8:      POP     AF
            PUSH    AF
            CP      029H
            JR      NZ,L39D3            ; (+015H)
            LD      HL,L3984
            DEC     (HL)
            JR      Z,L39CD             ; (+009H)
            POP     AF
            LD      A,(L397F)
            LD      (L397E),A
            JR      L398D               ; (-040H)

L39CD:      CALL    L3B47
            CALL    L39EE
L39D3:      POP     AF
            RET     

L39D5:      LD      (03986H),SP
            LD      A,(L3972)
            DEC     A
            JR      Z,L39F5             ; (+016H)
            DEC     A
            JR      Z,L39FB             ; (+019H)
            DEC     A
            JR      Z,L3A49             ; (+064H)
            DEC     A
            JP      Z,L3AB4
            DEC     A
            JR      Z,L39EE             ; (+002H)
            JR      L3A3E               ; (+050H)

L39EE:      PUSH    AF
            XOR     A
            LD      (L397C),A
            POP     AF
            RET     

L39F5:      LD      A,(L3973)
            JP      L3BA9

L39FB:      XOR     A
            CALL    L3BD3
            CALL    L3CAA
            LD      BC,0FFFFH
            LD      A,0AAH
L3A07:      CPL     
            LD      D,A
            CALL    L3D21
            DEC     BC
            LD      A,B
            OR      C
            JR      Z,L3A14             ; (+003H)
            LD      A,D
            JR      L3A07               ; (-00dH)

L3A14:      CALL    L3CF7
            CALL    L3C34
            CALL    L3BEB
            LD      A,(L3982)
            DEC     A
            JR      NZ,L3A41            ; (+01eH)
            CALL    L3C49
            LD      BC,0FFFFH
            LD      E,055H
L3A2B:      CP      E
            JR      NZ,L3A41            ; (+013H)
            DEC     BC
            LD      A,B
            OR      C
            JR      Z,L3A3B             ; (+008H)
            LD      A,E
            CPL     
            LD      E,A
            CALL    L3D37
            JR      L3A2B               ; (-010H)

L3A3B:      CALL    L3D09
L3A3E:      JP      L3C34

L3A41:      LD      A,029H
            SCF     
            RET     

L3A45:      EI      
            JP      0017DH

L3A49:      LD      A,(L3983)
            OR      A
            CALL    Z,L3BEB
            CALL    L3A7A
            RET     C
            CALL    BRKCHK
            JP      Z,L3A45
            CALL    L3D37
            LD      C,A
            CALL    L3D37
            LD      B,A
            LD      HL,(L3974)
L3A65:      CALL    L3D37
            LD      (HL),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3A65            ; (-00aH)
            CALL    L3D09
            LD      A,(L3973)
            BIT     0,A
            JR      NZ,L3A3E            ; (-03bH)
            RET     

L3A7A:      LD      HL,L3982
            DEC     (HL)
            JR      Z,L3AB0             ; (+030H)
            CALL    L3C49
            LD      C,A
            LD      A,(L397C)
            LD      HL,L397D
            CP      (HL)
            JR      NZ,L3AAD            ; (+020H)
            INC     A
            LD      (L397C),A
            LD      (HL),A
            LD      A,(L3973)
            XOR     C
            RRA     
            RET     NC
L3A98:      CALL    L3D37
            LD      C,A
            CALL    L3D37
            LD      B,A
L3AA0:      CALL    L3D37
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3AA0            ; (-008H)
            CALL    L3D09
            JR      L3A7A               ; (-033H)

L3AAD:      INC     (HL)
            JR      L3A98               ; (-018H)

L3AB0:      LD      A,028H
            SCF     
            RET     

L3AB4:      LD      A,(L397E)
            LD      (L397F),A
            LD      A,(L3983)
            OR      A
            JR      NZ,L3AD7            ; (+017H)
            CALL    L3BEB
            LD      A,(L397E)
            LD      HL,L3982
            ADD     A,(HL)
            LD      (L3982),A
            INC     A
            LD      (L397C),A
            CALL    L3A7A
            JP      NC,L3B51
L3AD7:      LD      A,(L3973)
            LD      B,A
            AND     001H
            JR      NZ,L3AEE            ; (+00fH)
            LD      DE,L3974
            LD      A,B
            RES     2,A
            CALL    L3B5A
            CALL    BRKCHK
            JP      Z,L3A45
L3AEE:      LD      DE,L3978
            LD      A,(L3973)
            SET     0,A
            CALL    L3B5A
            CALL    L3C34
            CALL    BRKCHK
            JP      Z,L3A45
            LD      A,(L3973)
            AND     004H
            JR      Z,L3B55             ; (+04cH)
            LD      A,(L3981)
            LD      HL,L397E
            ADD     A,(HL)
            CALL    L3BD3
            LD      A,001H
            LD      (L3980),A
L3B18:      LD      A,(L3981)
            LD      HL,L397F
            ADD     A,(HL)
            INC     A
            LD      (L3982),A
            INC     A
            LD      (L397C),A
            CALL    L3A7A
            JR      NC,L3B51            ; (+025H)
            LD      A,(L3973)
            AND     001H
            JR      NZ,L3B3A            ; (+007H)
            LD      DE,L3974
            CALL    L3B88
            RET     C
L3B3A:      LD      DE,L3978
            CALL    L3B88
            RET     C
            LD      A,(L3980)
            OR      A
            JR      Z,L3B4E             ; (+007H)
L3B47:      XOR     A
            LD      (L397E),A
            LD      (L3980),A
L3B4E:      JP      L3C34

L3B51:      LD      A,029H
            SCF     
            RET     

L3B55:      CALL    L3BEB
            JR      L3B18               ; (-042H)

L3B5A:      PUSH    AF
            LD      HL,L397E
            INC     (HL)
            CALL    L3CAA
            POP     AF
            CALL    L3D21
            CALL    L3B7E
            LD      A,C
            CALL    L3D21
            LD      A,B
            CALL    L3D21
L3B71:      LD      A,(HL)
            CALL    L3D21
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3B71            ; (-00aH)
            JP      L3CF7

L3B7E:      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     

L3B88:      CALL    L3C49
            CALL    L3B7E
            CALL    L3D37
            CP      C
            JR      NZ,L3B51            ; (-043H)
            CALL    L3D37
            CP      B
            JR      NZ,L3B51            ; (-049H)
L3B9A:      CALL    L3D37
            CP      (HL)
            JR      NZ,L3B51            ; (-04fH)
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3B9A            ; (-00cH)
            JP      L3D09

L3BA9:      LD      B,A
            LD      A,002H
            OUT     (0F7H),A
            LD      A,055H
            OUT     (0F7H),A
            LD      A,002H
            OUT     (0F7H),A
            IN      A,(0F7H)
            CP      055H
            JP      NZ,03D4DH
            LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            LD      C,A
            AND     008H
            JP      Z,03D4DH
            LD      A,B
            OR      A
            RET     Z
            LD      A,C
            AND     020H
            RET     NZ
            JP      03D4AH

L3BD3:      PUSH    AF
            LD      HL,03D73H
            LD      B,009H
            CALL    L3C0A
            CALL    L3CDF
            CALL    L3CC3
            POP     AF
            CALL    L3D21
            CALL    L3CF7
            JR      L3C00               ; (+015H)

L3BEB:      LD      HL,L3D68
            LD      B,00BH
            CALL    L3C0A
            CALL    L3C5F
            LD      (L3981),A
            INC     A
            LD      (L3982),A
            CALL    L3D09
L3C00:      LD      HL,L3985
            SET     3,(HL)
            XOR     A
            LD      (L397D),A
            RET     

L3C0A:      LD      C,0F6H
            OTIR    
            LD      A,005H
            LD      (L3983),A
            OUT     (0F7H),A
            LD      A,080H
            OUT     (0F7H),A
L3C19:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     008H
            JP      Z,03D4DH
            LD      A,010H
            OUT     (0F7H),A
            IN      A,(0F7H)
            AND     008H
            JR      Z,L3C19             ; (-015H)
            LD      BC,L00E9
            JP      L3D5B

L3C34:      PUSH    AF
            LD      A,005H
            OUT     (0F6H),A
            LD      A,060H
            OUT     (0F6H),A
            LD      A,005H
            OUT     (0F7H),A
            XOR     A
            LD      (L3983),A
            OUT     (0F7H),A
            POP     AF
            RET     

L3C49:      LD      A,058H
            LD      B,00BH
            LD      HL,L3D68
            CALL    L3CE8
            LD      HL,L3985
            BIT     3,(HL)
            LD      BC,L0003
            JR      Z,L3C62             ; (+005H)
            RES     3,(HL)
L3C5F:      LD      BC,L00A0
L3C62:      CALL    L3D5B
            LD      A,005H
            OUT     (0F7H),A
            LD      A,082H
            OUT     (0F7H),A
            LD      A,003H
            OUT     (0F6H),A
            LD      A,LSD3
            OUT     (0F6H),A
            LD      BC,L2CC0
L3C78:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     010H
            JR      Z,L3C8A             ; (+008H)
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3C78            ; (-00fH)
            JP      03D53H

L3C8A:      LD      A,003H
            OUT     (0F6H),A
            LD      A,0C3H
            OUT     (0F6H),A
L3C92:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     001H
            JR      Z,L3C92             ; (-00aH)
            LD      A,003H
            OUT     (0F6H),A
            LD      A,0C9H
            OUT     (0F6H),A
            CALL    L3D37
            JP      L3D37

L3CAA:      LD      A,098H
            LD      B,009H
            LD      HL,03D73H
            CALL    L3CE8
            CALL    L3CDF
            LD      HL,L3985
            BIT     3,(HL)
            LD      BC,0001DH
            JR      Z,L3CC6             ; (+005H)
            RES     3,(HL)
L3CC3:      LD      BC,L0140
L3CC6:      CALL    L3D5B
            LD      A,005H
            OUT     (0F6H),A
            LD      A,0EFH
            OUT     (0F6H),A
            LD      BC,00001H
            CALL    L3D5B
            LD      A,0C0H
            OUT     (0F6H),A
            LD      A,0A5H
            JR      L3D21               ; (+042H)

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

L3CE8:      LD      C,0F6H
            OUT     (C),A
            LD      A,005H
            OUT     (0F7H),A
            LD      A,080H
            OUT     (0F7H),A
            OTIR    
            RET     

L3CF7:      LD      BC,00001H
            CALL    L3D5B
            LD      A,010H
            OUT     (0F7H),A
            IN      A,(0F7H)
            AND     008H
            RET     NZ
            JP      03D50H

L3D09:      LD      B,003H
L3D0B:      CALL    L3D37
            DJNZ    L3D0B               ; (-005H)
L3D10:      IN      A,(0F6H)
            RRCA    
            JR      NC,L3D10            ; (-005H)
            LD      A,001H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     040H
            JR      NZ,L3D47            ; (+028H)
            OR      A
            RET     

L3D21:      PUSH    AF
L3D22:      IN      A,(0F6H)
            AND     004H
            JR      Z,L3D22             ; (-006H)
            POP     AF
            OUT     (QDPC),A
L3D2B:      LD      A,010H
            OUT     (0F6H),A
            IN      A,(0F6H)
            AND     008H
            JP      Z,03D4DH
            RET     

L3D37:      CALL    L3D2B
            IN      A,(0F6H)
            RLCA    
            JR      C,L3D47             ; (+008H)
            RRCA    
            RRCA    
            JR      NC,L3D37            ; (-00cH)
            IN      A,(QDPC)
            OR      A
            RET     

L3D47:      LD      A,029H
            LD      HL,02E3EH
            LD      HL,0323EH
            LD      HL,L353E
            LD      HL,0363EH
            LD      SP,(03986H)
            SCF     
            RET     

L3D5B:      PUSH    AF
L3D5C:      LD      A,098H
L3D5E:      DEC     A
            JR      NZ,L3D5E            ; (-003H)
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L3D5C            ; (-00aH)
            POP     AF
            RET     

L3D68:      LD      E,B
            INC     B
            DJNZ    L3D71               ; (+005H)
            INC     B
            INC     BC
            RET     NC
            LD      B,016H
L3D71:      RLCA    
            LD      D,098H
            INC     B
            DJNZ    L3D7D               ; (+006H)
            LD      D,007H
            LD      D,005H
            LD      L,L
            PUSH    HL
L3D7D:      LD      DE,(00188H)
            PUSH    DE
            LD      DE,L3DC3
            LD      (00188H),DE
            LD      A,(L004F)
            PUSH    AF
            LD      A,064H
            LD      (L004F),A
            LD      (03E3AH),SP
            XOR     A
            LD      (L1091),A
L3D9A:      LD      SP,L0000
L3D9D:      LD      BC,L3D9D
            PUSH    BC
            RST     018H
            DB      002H
            LD      A,02AH
            RST     018H
            DB      003H
L3DA7:      CALL    L3E46
            JR      NC,L3DA7            ; (-005H)
            LD      A,(DE)
            CP      02AH
            RET     NZ
            INC     DE
            LD      A,(DE)
            INC     DE
            EXX     
            LD      HL,L3DD5
            LD      B,00AH
L3DB9:      CP      (HL)
            INC     HL
            JR      Z,L3DCF             ; (+012H)
            INC     HL
            INC     HL
            DJNZ    L3DB9               ; (-008H)
            EXX     
            RET     

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

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

L3DD5:      LD      B,H
            CP      E
            LD      A,04DH
            DEC     L
            CCF     
            LD      D,B
            DI      
            DEC     A
            LD      B,A
            OR      (HL)
            LD      A,046H
            LD      D,C
            CCF     
            LD      D,D
            ADD     HL,SP
            LD      A,053H
            CALL    M,L4C3D
            INC     DE
            LD      A,056H
            JR      NC,03E2EH            ; (+03eH)
            LD      D,H
            AND     C
            CCF     
            LD      A,(L1091)
            XOR     001H
            LD      (L1091),A
            RET     

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

            CALL    L3E67
            PUSH    HL
            PUSH    AF
            CALL    L3E25
            POP     AF
            POP     HL
            JR      NC,L3E22            ; (+003H)
            LD      HL,(ELMD22)
L3E22:      RST     018H
            DB      030H
            RET     

L3E25:      CALL    L3FB8
            RST     018H
            DB      02FH
            CP      001H
            RET     Z
            JP      01F9DH

            CALL    L3E25
            LD      HL,(ELMD22)
            RST     018H
            DB      032H
            RET     

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

L3E46:      LD      DE,0FF00H
            RST     018H
            DB      00CH
            JR      C,L3E65             ; (+018H)
            LD      A,(DE)
            CP      03AH
            SCF     
            RET     NZ
            INC     DE
            CALL    L3E67
            RET     C
            LD      A,(DE)
            INC     DE
            XOR     03DH
            RET     NZ
L3E5C:      CALL    L3E8C
            CCF     
            RET     NC
            LD      (HL),A
            INC     HL
            JR      L3E5C               ; (-009H)

L3E65:      LD      (DE),A
            RET     

L3E67:      PUSH    HL
            CALL    L3E81
            PUSH    DE
            CALL    L3E93
            JR      C,L3E7C             ; (+00bH)
            LD      H,A
            CALL    L3E93
            JR      C,L3E7C             ; (+005H)
            LD      L,A
            POP     AF
            POP     AF
            XOR     A
            RET     

L3E7C:      POP     DE
            POP     HL
            SCF     
            RET     

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

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

L3E8C:      CALL    L3E81
            CP      03BH
            JR      Z,L3EB1             ; (+01eH)
L3E93:      PUSH    BC
            PUSH    DE
            CALL    L3E87
            JR      C,L3EAD             ; (+013H)
            LD      C,A
            CALL    L3E87
            JR      C,L3EAD             ; (+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     

L3EAD:      POP     DE
            POP     BC
            SCF     
            RET     

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

            CALL    L3E67
            RET     C
            JP      (HL)

            CALL    L3E67
            JR      C,L3ECB             ; (+00bH)
            PUSH    HL
            CALL    L3E67
            JR      C,L3ECA             ; (+004H)
            POP     DE
            EX      DE,HL
            JR      L3ED1               ; (+007H)

L3ECA:      POP     HL
L3ECB:      EX      DE,HL
            LD      HL,L0080
            ADD     HL,DE
            EX      DE,HL
L3ED1:      LD      C,008H
            CALL    L3EDE
            RET     C
            PUSH    HL
            SBC     HL,DE
            POP     HL
            RET     NC
            JR      L3ED1               ; (-00dH)

L3EDE:      CALL    L3F06
            LD      B,C
            PUSH    HL
L3EE3:      LD      A,(HL)
            CALL    L3F17
            INC     HL
            LD      A,020H
            RST     018H
            DB      009H
            DJNZ    L3EE3               ; (-00bH)
            POP     HL
            LD      A,02FH
            RST     018H
            DB      009H
            LD      B,C
L3EF4:      LD      A,(HL)
            CP      020H
            JR      NC,L3EFB            ; (+002H)
            LD      A,02EH
L3EFB:      RST     018H
            DB      009H
            INC     HL
            DJNZ    L3EF4               ; (-00cH)
            RST     018H
            DB      008H
            RST     018H
            DB      00FH
            OR      A
            RET     

L3F06:      LD      A,03AH
            RST     018H
            DB      009H
            LD      A,H
            CALL    L3F17
            LD      A,L
            CALL    L3F17
            LD      A,03DH
            RST     018H
            DB      009H
            RET     

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

            CALL    L3E67
            LD      A,(L1091)
            PUSH    AF
            XOR     A
            LD      (L1091),A
L3F38:      RST     018H
            DB      002H
            CALL    L3F06
            LD      A,(HL)
            CALL    L3F17
            LD      A,014H
            RST     018H
            DB      003H
            RST     018H
            DB      003H
            CALL    L3E46
            JR      NC,L3F38            ; (-014H)
            POP     AF
            LD      (L1091),A
            RET     

            CALL    L3E67
            RET     C
            PUSH    HL
            CALL    L3E67
            POP     BC
            RET     C
            PUSH    HL
            PUSH    BC
            LD      HL,0FF00H
            CALL    L3E5C
            LD      DE,0FF00H
            OR      A
            SBC     HL,DE
            LD      C,L
            POP     HL
            PUSH    HL
            EXX     
            POP     HL
            POP     DE
            EXX     
            RET     Z
L3F71:      CALL    L3FCB
            JR      NZ,L3F7A            ; (+004H)
            CALL    L3EDE
            RET     C
L3F7A:      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      L3F71               ; (-019H)

L3F8A:      CALL    L3E67
            PUSH    HL
            CALL    NC,L3E67
            POP     BC
            RET     C
            SBC     HL,BC
            INC     HL
            PUSH    HL
            PUSH    BC
            CALL    L3E67
            PUSH    HL
            EXX     
            POP     HL
            POP     DE
            POP     BC
            RET     

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

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

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

L3FCB:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      B,C
L3FD2:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L3FDB            ; (+005H)
            INC     DE
            INC     HL
            DJNZ    L3FD2               ; (-008H)
            XOR     A
L3FDB:      POP     HL
            POP     DE
            POP     BC
            RET     

            DS      33, 000H
L4000:      LD      HL,L85FE
            LD      (L1070),HL
            LD      HL,L4052
            LD      (000E3H),HL
            LD      A,B
            OR      A
            JR      Z,L401B             ; (+00bH)
            LD      HL,L4042
            LD      DE,L1361
            LD      BC,00010H
            LDIR    
L401B:      LD      A,(L0036)
            BIT     6,A
            LD      A,045H
            JR      Z,L4027             ; (+003H)
            LD      (L852E),A
L4027:      LD      DE,L84E0
            RST     018H
L402B:      DB      005H
            RST     018H
            DB      020H
            EX      DE,HL
L402F:      LD      (HL),000H
            INC     HL
            LD      A,H
            CP      0FFH
            JR      C,L402F             ; (-008H)
            CALL    L4902
            CALL    L4914
            CALL    L5E1B
            JR      L4056               ; (+014H)

L4042:      RRCA    
            DB      "RUN ",022H,"AUTO RUN",022H,00DH
L4052:      DB      03EH
            DB      016H
            DB      0DFH
            DB      003H
L4056:      LD      HL,L4B7B
            LD      (00188H),HL
L405C:      RST     018H
            DB      002H
            LD      DE,L4B68
            RST     018H
            DB      005H
            RST     018H
            DB      001H
L4065:      LD      A,(L4B6E)
            OR      A
            JR      NZ,L4077            ; (+00cH)
            LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            LD      (0848FH),SP
L4077:      LD      HL,L0000
            LD      (L847C),HL
            XOR     A
            LD      (L0050),A
            CALL    L48B1
            RST     018H
            DB      043H
            LD      DE,L11A4
            RST     018H
            DB      00CH
            JR      NC,L4099            ; (+00cH)
L408D:      LD      HL,L48B0
            LD      A,(HL)
            OR      A
            LD      (HL),000H
            JR      NZ,L405C            ; (-03aH)
            JR      L4065               ; (-033H)

L4098:      INC     DE
L4099:      LD      A,(DE)
            CP      020H
            JR      Z,L4098             ; (-006H)
            OR      A
            JR      Z,L4065             ; (-03cH)
            CALL    L5EC2
            JP      NC,L4746
            LD      HL,L84E0
            PUSH    HL
            CALL    L66ED
            INC     HL
            LD      (L8476),HL
            CALL    L4952
            POP     HL
            JR      L40BB               ; (+003H)

L40B8:      CALL    L5E46
L40BB:      LD      (0848FH),SP
L40BF:      LD      DE,L40B8
            PUSH    DE
L40C3:      LD      (L8491),HL
            CALL    BRKCHK
            JP      Z,0017DH
L40CC:      LD      A,(HL)
            INC     HL
            CP      080H
            JR      NC,L4126            ; (+054H)
            CP      027H
            JP      Z,L4F80
            CP      020H
            JR      Z,L40CC             ; (-00fH)
            CP      03AH
            JR      Z,L40C3             ; (-01cH)
            OR      A
            JR      Z,L40ED             ; (+00bH)
            DEC     HL
            SUB     041H
            CP      01AH
            JP      C,L4C8F
            JP      L4AE6

L40ED:      LD      HL,(L8476)
L40F0:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L410F             ; (+018H)
            LD      (L0050),A
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            LD      (L8476),HL
            EX      DE,HL
            INC     HL
            CALL    LDDEMI
            LD      (0847CH),DE
            CALL    L4971
            POP     DE
            JR      L40BB               ; (-054H)

L410F:      POP     HL
            CALL    L4152
            JP      Z,L405C
            XOR     A
            LD      (L4B6E),A
            LD      A,(L847F)
            CP      002H
            JP      Z,04B13H
            PUSH    HL
            JP      L4850

L4126:      CP      0FFH
            JP      Z,L4CC1
            LD      DE,L44B4
            CP      0FEH
            JR      NZ,L4136            ; (+004H)
            LD      A,(HL)
            INC     HL
            JR      L413E               ; (+008H)

L4136:      CP      LSE0
            JP      NC,L4AE6
            LD      DE,L43F4
L413E:      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
L414A:      CALL    HLFTCH
L414D:      OR      A
            RET     Z
            CP      03AH
            RET     

L4152:      PUSH    HL
            LD      HL,(L847C)
            LD      A,L
            OR      H
            POP     HL
            RET     

            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L4167:      DB      "GOT", "O" | 080H ; 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      052H
L4193:      DB      "ENU", "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      "MOD", "E" | 080H
            DB      "SKI", "P" | 080H
            DB      "PLO", "T" | 080H
            DB      "LIN", "E" | 080H
            DB      "RLIN", "E" | 080H
            DB      "MOV", "E" | 080H
            DB      "RMO", "V" | 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      "CIRCL", "E" | 080H
            DB      "TES", "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      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      080H
            DB      "/" | 080H
            DB      "*" | 080H
            DB      "^" | 080H
            DB      0FFH
L42FE:      DB      080H
            DB      "SE", "T" | 080H
            DB      "RESE", "T" | 080H
            DB      "COLO", "R" | 080H
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            LD      B,D
            LD      B,L
            LD      B,L
            RET     NC
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
            LD      C,L
            LD      D,L
            LD      D,E
            LD      C,C
            JP      L4554

            LD      C,L
            LD      D,B
            RST     008H
            LD      B,E
            LD      D,L
            LD      D,D
            LD      D,E
            LD      C,A
            JP      NC,L4556
            LD      D,D
            LD      C,C
            LD      B,(HL)
            EXX     
            LD      B,E
            LD      C,H
            JP      NC,0494CH
            LD      C,L
            LD      C,C
            CALL    NC,08080H
            ADD     A,B
            ADD     A,B
            ADD     A,B
            ADD     A,B
FUNCWORDTBL:DB      "BOO", "T" | 080H ; BASIC function keyword text table
            DB      0FFH
L4356:      DB      "IN", "T" | 080H
            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      080H
            DB      080H
            DB      "JO", "Y" | 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      080H
            DB      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      080H
            LD      B,L
            LD      C,A
            DW      046C6H               ; Keyword dispatch address table
            DW      0FFCEH
L43F4:      DW      L513D
            DW      L50B8
            DW      L4AE6
            DW      L4802
            DW      L5087
            DW      L5828
            DW      L4C2E
            DW      052B8H
            DW      L4AE6
            DW      L4999
            DW      L4A38
            DW      L4861
            DW      L48B9
            DW      L4D84
            DW      L4E1B
            DW      L561E
            DW      L4AE6
            DW      L575B
            DW      L4AE6
            DW      L5150
            DW      L4F80
            DW      L5754
            DW      L76A5
            DW      L4F80
            DW      L4850
            DW      L4BE0
            DW      L4C11
            DW      L552D
            DW      L4AE6
            DW      L50E0
            DW      L4C8F
            DW      L4922
            DW      L501A
            DW      L4AE6
            DW      L6A1C
            DW      L6A7F
            DW      L6E1A
            DW      L6ACC
            DW      06ACFH
            DW      06AD2H
            DW      06AD5H
            DW      L4959
            DW      L496C
            DW      L4FA1
            DW      L58CA
            DW      L4FE5
            DW      L6B37
            DW      L6B69
            DW      L6B73
            DW      L6B7D
            DW      L539F
            DW      L6BE2
            DW      L5986
            DW      L5C86
            DW      L59EA
            DW      L59D5
            DW      L5256
            DW      L52B6
            DW      L4F8C
            DW      L6C22
            DW      L6DF0
            DW      L6DFB
            DW      L4F70
            DW      L5D63
            DW      L4AE6
            DW      L4B70
            DW      L5172
            DW      L4F26
            DW      L524E
            DW      L4AE6
            DW      L4AE6
            DW      L544C
            DW      L4AE6
            DW      L4AE6
            DW      L4F80
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      058E2H
            DW      L5913
            DW      L58DF
            DW      058E5H
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L5CE1
            DW      L4AE6
            DW      L4AE6
            DW      L5D08
            DW      05914H
            DW      05CD5H
            DW      L5CD3
            DW      L58D0
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
L44B4:      DW      L4AE6
            DW      L51E4
            DW      051E5H
            DW      L549C
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L524B
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L4AE6
            DW      L54F3
            DW      L5515
            DW      L4FBD
            DW      L5C6F
            DW      L4928
            LD      B,E
            LD      D,B
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            OR      B
            LD      D,D
L4512:      ADD     A,H
            LD      A,(HL)
            LD      A,A
            LD      A,(HL)
            BIT     7,A
            CP      E
            LD      A,A
            XOR     D
            ADD     A,B
            ADD     HL,DE
            ADD     A,E
            PUSH    AF
            ADD     A,C
            POP     HL
            LD      A,(HL)
            OR      B
            ADD     A,C
            SBC     A,H
            ADD     A,C
            RST     038H
            LD      A,(HL)
            LD      H,D
            ADD     A,C
            DEC     C
            ADD     A,E
            ADC     A,E
            LD      H,B
            LD      A,D
            ADD     A,C
            LD      (HL),L
            ADD     A,C
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            DEC     H
            LD      A,C
            AND     04AH
            AND     04AH
L4554:      JR      NC,L45C8            ; (+072H)
L4556:      RST     028H
            LD      (HL),C
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            LD      (DE),A
            LD      (HL),D
            AND     04AH
            AND     04AH
            LD      L,E
            LD      (HL),D
            LD      (HL),L
            LD      (HL),D
            LD      A,L
            LD      (HL),D
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            LD      A,E
            LD      (HL),C
            ADC     A,C
            LD      (HL),C
            LD      E,H
            LD      (HL),C
            LD      (HL),C
            LD      (HL),C
            HALT    
            LD      (HL),C
            AND     04AH
            AND     04AH
            ADC     A,A
            LD      (HL),D
            XOR     H
            LD      (HL),D
            RET     

            LD      (HL),D
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            RRA     
            LD      (HL),E
            AND     04AH
            LD      A,072H
            SBC     A,B
            LD      A,B
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
            AND     04AH
L45B2:      CALL    TEST1
            DB      00CH
            JR      NZ,L45BE            ; (+006H)
            CALL    LDDEMI
            OR      0FFH
            RET     

L45BE:      INC     HL
            CP      00BH
            JR      NZ,L45E2            ; (+01fH)
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            LD      A,E
L45C8:      OR      D
            RET     Z
            EX      DE,HL
            CALL    L4611
            JP      C,04B07H
            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      (L4745),A
            RET     

L45E2:      CP      022H
            JP      NZ,L4AE6
            LD      (04658H),HL
            LD      B,000H
L45EC:      LD      A,(HL)
            OR      A
            JR      Z,L45F8             ; (+008H)
            INC     HL
            CP      022H
            JR      Z,L45F8             ; (+003H)
            INC     B
            JR      L45EC               ; (-00cH)

L45F8:      LD      A,B
            OR      A
            JP      Z,L4AE6
            LD      (04656H),A
            EX      DE,HL
            CALL    L460B
            JP      C,04B07H
            EX      DE,HL
            OR      0FFH
            RET     

L460B:      PUSH    BC
            LD      BC,L4644
            JR      L4615               ; (+004H)

L4611:      PUSH    BC
            LD      BC,L4638
L4615:      LD      (0462BH),BC
            PUSH    DE
            EX      DE,HL
            LD      HL,(L1070)
L461E:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            LD      A,B
            OR      C
            SCF     
            JR      Z,L4635             ; (+00fH)
            DEC     HL
            PUSH    HL
            ADD     HL,BC
            EX      (SP),HL
            CALL    L0000
            JR      C,L4634             ; (+005H)
            JR      Z,L4634             ; (+003H)
            POP     HL
            JR      L461E               ; (-016H)

L4634:      POP     DE
L4635:      POP     DE
            POP     BC
            RET     

L4638:      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     

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

L466C:      LD      DE,L0000
            LD      BC,0FFFFH
            CALL    L46AE
            RET     Z
            CP      02DH
            JR      Z,L4696             ; (+01cH)
            CP      02EH
            LD      DE,(08478H)
            JR      Z,L4689             ; (+007H)
            CALL    TESTX
            DB      00BH
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L4689:      INC     HL
            CALL    L46AE
            JR      Z,L4693             ; (+004H)
            CP      02DH
            JR      Z,L4696             ; (+003H)
L4693:      LD      C,E
            LD      B,D
            RET     

L4696:      INC     HL
            CALL    L46AE
            RET     Z
            CP      02EH
            JR      NZ,L46A5            ; (+006H)
            LD      BC,(08478H)
            INC     HL
            RET     

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

L46AE:      CALL    L414A
            RET     Z
            CP      02CH
            RET     

L46B5:      CALL    SKPDE
            LD      A,0FFH
            LD      (L4745),A
            LD      HL,L470B
            JR      L46D4               ; (+012H)

L46C2:      CALL    SKPDE
            CALL    L4839
L46C8:      LD      A,(L4745)
            OR      A
            RET     Z
            XOR     A
            LD      (L4745),A
            LD      HL,L46F1
L46D4:      LD      (046EFH),HL
            LD      HL,(L1070)
            DEC     HL
L46DB:      INC     HL
            LD      A,(HL)
            INC     HL
            OR      (HL)
            RET     Z
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      (0473AH),DE
L46E8:      CALL    L5198
            OR      A
            JR      Z,L46DB             ; (-013H)
            JP      L0000

L46F1:      CP      00CH
            JR      NZ,L46E8            ; (-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      L46E8               ; (-023H)

L470B:      CP      00BH
            JR      NZ,L46E8            ; (-027H)
            DEC     HL
            PUSH    HL
            CALL    INDRCT
            LD      E,L
            LD      D,H
            LD      A,L
            OR      H
            JR      Z,L4741             ; (+027H)
            CALL    L4611
            JR      C,L472A             ; (+00bH)
            EX      DE,HL
            POP     HL
            DEC     HL
            LD      (HL),00CH
            INC     HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            JR      L46E8               ; (-042H)

L472A:      PUSH    DE
            LD      A,010H
            RST     018H
            DB      01BH
            LD      A,020H
            RST     018H
            DB      003H
            POP     HL
            CALL    L5E64
            RST     018H
            DB      005H
            LD      HL,L0000
            CALL    L4B4E
            RST     018H
            DB      002H
L4741:      POP     HL
            INC     HL
            JR      L46E8               ; (-05dH)

L4745:      NOP     
L4746:      RST     018H
            DB      028H
            CALL    L46C2
            CALL    L6A09
            LD      A,B
            OR      C
            JP      Z,L4065
            LD      (08478H),BC
            LD      A,(DE)
            CP      020H
            JR      NZ,L475D            ; (+001H)
            INC     DE
L475D:      PUSH    AF
            LD      HL,L84E0
            CALL    L66ED
            PUSH    HL
            LD      HL,(L8478)
            LD      E,L
            LD      D,H
            CALL    L49B9
            POP     HL
            POP     AF
            OR      A
            JR      Z,L4784             ; (+012H)
            LD      DE,L84E0
            OR      A
            SBC     HL,DE
            LD      DE,00005H
            ADD     HL,DE
            LD      B,H
            LD      C,L
            LD      HL,L84E0
            CALL    L479C
L4784:      LD      A,(L48B0)
            OR      A
            JP      Z,L4065
            LD      DE,(0847AH)
            LD      HL,(L8478)
            ADD     HL,DE
            LD      (L8478),HL
            JP      NC,L4065
            JP      L408D

L479C:      LD      (047F9H),HL
            PUSH    BC
            LD      BC,(08478H)
            LD      HL,(L1070)
            JR      L47AD               ; (+004H)

L47A9:      CALL    LDDEMD
            ADD     HL,DE
L47AD:      CALL    LDDEMD
            LD      A,D
            OR      E
            JR      Z,L47C1             ; (+00dH)
            INC     HL
            INC     HL
            CALL    LDDEMD
            EX      DE,HL
            SBC     HL,BC
            DEC     DE
            DEC     DE
            EX      DE,HL
            JR      C,L47A9             ; (-018H)
L47C1:      POP     DE
            PUSH    HL
            LD      HL,(L1078)
            LD      (L107A),HL
            LD      B,H
            LD      C,L
            ADD     HL,DE
            JP      C,L4B26
            EX      DE,HL
            CALL    L74E1
            EX      DE,HL
            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,(08478H)
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            EX      DE,HL
            LD      HL,L84E0
            DEC     BC
            DEC     BC
            DEC     BC
            DEC     BC
            LDIR    
            RET     

L4802:      JR      Z,L480D             ; (+009H)
            CALL    L516C
            JP      Z,L513D
            JP      L5AED

L480D:      CALL    L4928
L4810:      CALL    L4824
            LD      DE,(TEXTST)
            LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            PUSH    HL
            EX      DE,HL
            JP      L40F0

L4824:      PUSH    HL
            PUSH    DE
            CALL    L4839
            XOR     A
            LD      (L48B0),A
            LD      HL,0000AH
            LD      (L8478),HL
            LD      (L847A),HL
            POP     DE
            POP     HL
            RET     

L4839:      CALL    L5825
            LD      HL,L0000
            LD      (L8480),HL
            XOR     A
            LD      (L4B6E),A
            LD      (L847F),A
            LD      (L847E),A
            LD      (L8493),A
            RET     

L4850:      LD      A,(L8493)
            OR      A
            JP      NZ,L5DC9
            RST     018H
            DB      028H
            XOR     A
            LD      (L4B6E),A
            POP     BC
            JP      L405C

L4861:      LD      DE,0000AH
            LD      BC,0000AH
            JR      Z,L4897             ; (+02eH)
            CP      02CH
            JR      NZ,L4878            ; (+00bH)
            INC     HL
            CALL    L6E57
            LD      B,D
            LD      C,E
            LD      DE,0000AH
            JR      L4897               ; (+01fH)

L4878:      CP      02EH
            LD      DE,(08478H)
            JR      Z,L4889             ; (+009H)
            CP      00BH
            JP      NZ,L4AE6
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L4889:      INC     HL
            CALL    TEST1
            DB      02CH
            JR      NZ,L4897            ; (+007H)
            PUSH    DE
            CALL    L6E57
            LD      C,E
            LD      B,D
            POP     DE
L4897:      CALL    L5E46
            LD      A,C
            OR      B
            JP      Z,04AECH
            LD      (08478H),DE
            LD      (0847AH),BC
            LD      A,001H
            LD      (L48B0),A
            POP     AF
            JP      L4065

L48B0:      NOP     
L48B1:      LD      A,(L48B0)
            OR      A
            RET     Z
            XOR     A
            JR      L48BF               ; (+006H)

L48B9:      CALL    L48BF
            JP      L4065

L48BF:      LD      DE,(08478H)
            CALL    NZ,L466C
            PUSH    DE
            EX      DE,HL
            CALL    L4611
            POP     DE
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            JR      NC,L48D5            ; (+003H)
            LD      HL,L00F9
L48D5:      EX      DE,HL
            PUSH    DE
            LD      (L8478),HL
            CALL    L5E64
            RST     018H
            DB      005H
            LD      A,020H
            RST     018H
            DB      003H
            POP     HL
            LD      DE,L11A4
            PUSH    DE
            CALL    L68D8
            POP     DE
            LD      B,000H
L48EE:      LD      A,(DE)
            OR      A
            JR      Z,L48F8             ; (+006H)
            INC     B
            RST     018H
            DB      004H
            INC     DE
            JR      L48EE               ; (-00aH)

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

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

L4914:      LD      HL,(L1070)
            CALL    L4952
            LD      (L1072),HL
            CALL    L4824
            JR      L4928               ; (+006H)

L4922:      CALL    L4914
            JP      L4056

L4928:      PUSH    HL
            CALL    L4939
            POP     HL
            RST     018H
            DB      028H
            RET     

L4930:      LD      HL,(L1070)
            CALL    L4952
            LD      (L1072),HL
L4939:      LD      HL,(L1072)
            LD      (HL),000H
            INC     HL
            LD      (L1074),HL
            LD      (HL),000H
            INC     HL
            LD      (L1076),HL
            CALL    L4952
            LD      (L1078),HL
            LD      (L107A),HL
            RET     

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

L4959:      CALL    L414A
            LD      A,001H
            JR      Z,L496D             ; (+00dH)
            CALL    TESTX
            DB      FDPD
            CALL    TESTX
            DB      050H
            LD      A,002H
            JR      L496D               ; (+001H)

L496C:      XOR     A
L496D:      LD      (04972H),A
            RET     

L4971:      LD      A,000H
            OR      A
            RET     Z
            DEC     A
            LD      (L1091),A
            JR      Z,L4982             ; (+007H)
            LD      A,(L1097)
            CP      002H
            JR      Z,L4994             ; (+012H)
L4982:      PUSH    HL
            LD      A,05BH
            RST     018H
            DB      009H
            LD      HL,(L847C)
            CALL    L5E64
            RST     018H
            DB      00BH
            LD      A,05DH
            RST     018H
            DB      009H
            POP     HL
L4994:      XOR     A
            LD      (L1091),A
            RET     

L4999:      CALL    L46AE
            JP      Z,L4AE6
            CALL    L516C
            JR      Z,L49AD             ; (+009H)
            CP      02DH
            JR      Z,L49AD             ; (+005H)
            CP      02EH
            JP      NZ,L5D00
L49AD:      CALL    L466C
            EX      DE,HL
            LD      E,C
            LD      D,B
            CALL    L49B9
            JP      L405C

L49B9:      PUSH    AF
            PUSH    BC
            PUSH    HL
            PUSH    DE
            CALL    L46C2
            LD      C,L
            LD      B,H
            LD      HL,(L1070)
L49C5:      CALL    LDDEMI
            LD      A,E
            OR      D
            JR      NZ,L49D4            ; (+008H)
L49CC:      POP     DE
            POP     HL
            POP     BC
            POP     AF
            RET     

L49D1:      POP     DE
            JR      L49CC               ; (-008H)

L49D4:      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      (049EEH),HL
            SBC     HL,BC
            POP     HL
            JR      C,L49C5             ; (-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,L4A13             ; (+01eH)
            JR      NC,L49D1            ; (-026H)
L49F7:      CALL    LDDEMI
            LD      A,D
            OR      E
            JR      Z,L4A11             ; (+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,L49F7             ; (-016H)
            JR      Z,L4A13             ; (+004H)
            EX      DE,HL
            DEC     HL
L4A11:      DEC     HL
            DEC     HL
L4A13:      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      L49CC               ; (-063H)

L4A2F:      CALL    L6E57
            LD      A,D
            OR      E
            RET     NZ
            JP      04AECH

L4A38:      LD      DE,0000AH
            LD      (04AB4H),DE
            LD      (04AC6H),DE
            LD      E,000H
            LD      (04AA3H),DE
            JR      Z,L4A7E             ; (+033H)
            CP      02CH
            JR      Z,L4A5F             ; (+010H)
            CALL    L4A2F
            LD      (04AB4H),DE
            CALL    L414A
            JR      Z,L4A7E             ; (+023H)
            CALL    L5E6E
            DEC     HL
L4A5F:      CALL    INCHLF
            CP      02CH
            JR      Z,L4A76             ; (+010H)
            CALL    L4A2F
            LD      (04AA3H),DE
            CALL    L414A
            JR      Z,L4A7E             ; (+00cH)
            CALL    L5E6E
            DEC     HL
L4A76:      INC     HL
            CALL    L4A2F
            LD      (04AC6H),DE
L4A7E:      PUSH    HL
            LD      HL,(04AA3H)
            EX      DE,HL
            LD      HL,(04AB4H)
            OR      A
            SBC     HL,DE
            JP      C,04AECH
            CALL    L46B5
            LD      HL,(L1070)
L4A92:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L4AD0             ; (+037H)
            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,L4AB0             ; (+005H)
            JR      C,L4AB0             ; (+003H)
            EX      DE,HL
            JR      L4A92               ; (-01eH)

L4AB0:      DEC     HL
            DEC     HL
            DEC     HL
            LD      BC,L0000
L4AB6:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            JR      Z,L4AD0             ; (+013H)
            EX      DE,HL
            ADD     HL,DE
            DEC     HL
            EX      DE,HL
            INC     HL
            LD      (HL),C
            INC     HL
            LD      (HL),B
            LD      HL,L0000
            ADD     HL,BC
            JR      C,L4AD2             ; (+007H)
            LD      C,L
            LD      B,H
            EX      DE,HL
            JR      L4AB6               ; (-01aH)

L4AD0:      POP     HL
            RET     

L4AD2:      LD      HL,0000AH
            LD      (04AC6H),HL
            LD      (04AB4H),HL
            LD      L,000H
            LD      (04AA3H),HL
            CALL    L4A7E
            JP      04AECH

L4AE6:      LD      A,001H
            LD      HL,0023EH
            LD      HL,L033E
            LD      HL,0043EH
            LD      HL,L053E
            LD      HL,0063EH
            LD      HL,0073EH
            LD      HL,L083E
            LD      HL,L0D3E
            LD      HL,L0E3E
            LD      HL,L0F3E
            LD      HL,L103E
            LD      HL,L113E
            LD      HL,L123E
            LD      HL,L133E
            LD      HL,0143EH
            LD      HL,0153EH
            LD      HL,L183E
            LD      HL,L193E
            LD      HL,L3A3E
            LD      HL,0403EH
            JR      L4B34               ; (+00eH)

L4B26:      LD      A,006H
L4B28:      LD      SP,(INTFAC)
            LD      HL,0FFFFH
            PUSH    HL
            LD      (0848FH),SP
L4B34:      JR      L4B4B               ; (+015H)

L4B36:      LD      HL,(.$LPT)
            LD      IX,(.$CRT)
            LD      (L1044),HL
            LD      A,0C4H
            LD      HL,0BB3EH
            LD      HL,0BC3EH
            LD      HL,0BD3EH
L4B4B:      JP      L0182

L4B4E:      LD      A,L
            OR      H
            RET     Z
            LD      DE,L4B5C
            RST     018H
            DB      005H
            CALL    L5E64
            RST     018H
            DB      005H
            RET     

L4B5C:      JR      NZ,04BA7H            ; (+049H)
            LD      C,(HL)
            JR      NZ,L4B61            ; (+000H)
L4B61:      LD      B,D
            DEC     B
            LD      D,D
            LD      B,L
            LD      B,C
            LD      C,E
            NOP     
L4B68:      LD      D,D
            DEC     B
            LD      B,L
            LD      B,C
            LD      B,H
            LD      E,C
L4B6E:      NOP     
            NOP     
L4B70:      CALL    L6E43
            DEC     A
            CP      046H
            JR      C,L4B7A             ; (+002H)
            LD      A,044H
L4B7A:      INC     A
L4B7B:      LD      SP,(0848FH)
            PUSH    AF
            RST     018H
            DB      043H
            CALL    L5C42
            POP     AF
            OR      A
            JR      Z,L4BDB             ; (+052H)
            CP      080H
            JR      Z,L4BD9             ; (+04cH)
            LD      C,A
            LD      HL,L0000
            LD      (L7921),HL
            CALL    L4152
            LD      A,C
            JR      Z,L4BC4             ; (+02aH)
            LD      HL,(L847C)
            LD      (L8480),HL
            LD      (L8478),HL
            LD      HL,(L8476)
            LD      (L8482),HL
            LD      HL,(L8491)
            LD      (L8484),HL
            AND     07FH
            LD      (L847E),A
            LD      A,(L847F)
            INC     A
            CP      002H
            JR      Z,L4BCF             ; (+013H)
            XOR     A
            LD      (L4B6E),A
            LD      (L8493),A
            LD      A,C
L4BC4:      RST     018H
            DB      01BH
L4BC6:      LD      HL,(L847C)
            CALL    L4B4E
            JP      L405C

L4BCF:      LD      (L847F),A
            LD      HL,(08486H)
            PUSH    HL
            JP      L40F0

L4BD9:      LD      A,02EH
L4BDB:      LD      HL,(L8491)
            JR      L4BE3               ; (+003H)

L4BE0:      LD      A,02EH
            POP     DE
L4BE3:      PUSH    AF
            PUSH    HL
            RST     018H
            DB      002H
            RST     018H
            DB      020H
            LD      DE,L4B61
            RST     018H
            DB      005H
            POP     HL
            CALL    L4152
            JR      Z,L4C0D             ; (+019H)
            LD      (04C29H),HL
            LD      HL,(L8476)
            LD      (04C23H),HL
            LD      HL,(L847C)
            LD      (04C1DH),HL
            LD      (L8478),HL
            POP     AF
            LD      (L4B6E),A
            JP      L4BC6

L4C0D:      POP     AF
            JP      L405C

L4C11:      POP     DE
            LD      HL,L4B6E
            LD      A,(HL)
            OR      A
            JP      Z,04B0AH
            LD      (HL),000H
            LD      HL,L0000
            LD      (L847C),HL
            LD      HL,L0000
            LD      (L8476),HL
            LD      HL,L0000
            JP      L40BB

L4C2E:      LD      A,(L847F)
            CP      002H
            JP      C,04B16H
            DEC     A
            LD      (L847F),A
            CALL    L414A
L4C3D:      EX      DE,HL
            LD      HL,(L8480)
            LD      (L847C),HL
            LD      HL,(L8482)
            LD      (L8476),HL
            LD      HL,(L8484)
            JR      NZ,L4C53            ; (+004H)
            POP     BC
            JP      L40BF

L4C53:      CP      08EH
            JP      Z,L4F80
            EX      DE,HL
            JP      L513D

L4C5C:      CALL    TEST1
            DB      080H
            JR      Z,L4C6A             ; (+008H)
            CALL    TESTX
            DB      082H
            CALL    TESTX
            DB      LSE0
L4C6A:      CALL    L45B2
            JR      Z,L4C79             ; (+00aH)
            LD      (08486H),DE
            LD      A,001H
L4C75:      LD      (L847F),A
            RET     

L4C79:      LD      A,(L847F)
            DEC     A
            JR      Z,L4C75             ; (-00aH)
            XOR     A
            LD      (L847F),A
            LD      HL,(L8480)
            LD      (L847C),HL
            LD      A,(L847E)
            JP      L4B7B

L4C8F:      CALL    TEST1
            DB      0FFH
            JP      Z,L4CC1
            CALL    L742F
            PUSH    BC
            PUSH    BC
            PUSH    AF
            CALL    TESTX
            DB      QDPC
            CALL    L6E82
            POP     BC
            LD      A,(L84C7)
            CP      B
            JP      NZ,04AEFH
            EX      (SP),HL
            EX      DE,HL
            CP      005H
            JR      Z,L4CB9             ; (+008H)
            PUSH    BC
            CALL    L4CCC
            POP     AF
            POP     HL
            POP     BC
            RET     

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

L4CC1:      CALL    TESTX
            DB      0C4H
            JP      L73BB

L4CC8:      PUSH    DE
            EX      DE,HL
            JR      L4CD0               ; (+004H)

L4CCC:      PUSH    DE
            CALL    L6E76
L4CD0:      LD      HL,L11A4
            LD      (HL),A
            LD      B,A
            LD      C,A
            INC     HL
            CALL    LDHLDE
            POP     HL
            LD      A,(HL)
            CP      C
            JR      Z,L4D21             ; (+042H)
            PUSH    HL
            OR      A
            CALL    NZ,L4D31
            POP     HL
            LD      A,(L11A4)
            OR      A
            JR      Z,L4D1E             ; (+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,L11A4
            INC     DE
            CALL    L74D5
            CALL    L4952
            LD      (L107A),HL
            LD      (L1078),HL
            RET     

L4D1E:      LD      (HL),000H
            RET     

L4D21:      INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      HL,(L1076)
            ADD     HL,DE
            LD      DE,L11A4
            LD      B,C
            INC     DE
            JP      L74D5

L4D31:      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
L4D3E:      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,L4D55             ; (+002H)
            LDIR    
L4D55:      POP     DE
            POP     BC
            LD      HL,(L1078)
            OR      A
            SBC     HL,BC
            LD      (L1078),HL
            EX      DE,HL
L4D61:      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      L4D61               ; (-023H)

L4D84:      POP     BC
            LD      (04E19H),BC
            CALL    L4C8F
            LD      IX,L0000
            ADD     IX,SP
            LD      (04DFBH),HL
            CALL    L4EF4
            LD      (04DF7H),BC
L4D9C:      LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JR      NZ,L4DC4            ; (+01aH)
            LD      E,(IX+006H)
            LD      D,(IX+007H)
            EX      DE,HL
            OR      A
            SBC     HL,BC
            JR      Z,L4DBD             ; (+007H)
            LD      DE,L0012
            ADD     IX,DE
            JR      L4D9C               ; (-021H)

L4DBD:      DB      011H
            LD      (DE),A
            NOP     
            ADD     IX,DE
            LD      SP,IX
L4DC4:      LD      HL,(04DFBH)
            CALL    TESTX
            DB      LSE0
            CALL    L6E82
            PUSH    AF
            PUSH    HL
            EX      DE,HL
            LD      DE,L4F00
            CALL    L5E91
            POP     HL
            POP     AF
            CP      LSE1
            LD      DE,L6110
            JR      NZ,L4DE4            ; (+004H)
            INC     HL
            CALL    L6E82
L4DE4:      LD      (04DFBH),HL
            LD      HL,0FFF6H
            ADD     HL,SP
            LD      SP,HL
            EX      DE,HL
            CALL    L5E91
            LD      HL,L4F00
            CALL    L5E91
            LD      HL,L0000
            PUSH    HL
            LD      HL,L0000
            PUSH    HL
            LD      HL,(L8476)
            PUSH    HL
            LD      HL,0FF12H
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(TMPEND)
            SBC     HL,DE
            LD      A,00BH
            JP      C,L4B28
            LD      HL,(04DFBH)
            JP      L0000

L4E1B:      LD      A,005H
            LD      (L84C7),A
            POP     BC
            LD      (04E90H),BC
L4E25:      PUSH    AF
            POP     BC
            LD      (04DFBH),HL
            LD      IX,L0000
            ADD     IX,SP
            LD      (04E7FH),IX
            LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JP      NZ,04AFEH
            PUSH    BC
            POP     AF
            JR      NZ,L4EA6            ; (+05fH)
            LD      E,(IX+004H)
            LD      D,(IX+005H)
            EX      DE,HL
            LD      (04E8DH),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    L797E
            INC     DE
            LD      A,(DE)
            LD      IX,(04E7FH)
            LD      DE,0000DH
            ADD     IX,DE
            PUSH    IX
            POP     DE
            BIT     7,A
            JR      NZ,L4E79            ; (+001H)
            EX      DE,HL
L4E79:      CALL    L7A15
            JR      C,L4E92             ; (+014H)
            LD      SP,L0000
            LD      HL,00002H
            ADD     HL,SP
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            LD      (L8476),HL
            LD      HL,L0000
L4E8F:      JP      L0000

L4E92:      LD      DE,L0012
            LD      HL,(04E7FH)
            ADD     HL,DE
            LD      SP,HL
            LD      HL,(04DFBH)
            CALL    TEST1
            DB      02CH
            JR      NZ,L4E8F            ; (-014H)
            LD      (04DFBH),HL
L4EA6:      LD      IX,L0000
            ADD     IX,SP
            LD      (04E7FH),IX
            LD      HL,(04DFBH)
            CALL    TEST1
            DB      02CH
            JP      Z,L4E25
            CALL    L742F
            LD      (04DFBH),HL
            CALL    L4EF4
            LD      IX,(04E7FH)
L4EC7:      LD      E,(IX+000H)
            LD      D,(IX+001H)
            LD      HL,0FF12H
            OR      A
            SBC     HL,DE
            JP      NZ,04AFEH
            LD      L,(IX+006H)
            LD      H,(IX+007H)
            OR      A
            SBC     HL,BC
            LD      HL,(04DFBH)
            JP      Z,L4E25
            LD      DE,L0012
            ADD     IX,DE
            LD      (04E7FH),IX
            LD      SP,(04E7FH)
            JR      L4EC7               ; (-02dH)

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

L4F00:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L4F09:      CALL    L5198
            OR      A
            RET     NZ
            INC     HL
            PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      A,D
            OR      E
            INC     HL
            LD      (04F08H),DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            LD      (04F06H),DE
            POP     DE
            SCF     
            RET     Z
            JR      L4F09               ; (-01dH)

L4F26:      CALL    L5E79
            CALL    L6E57
            LD      (04F5FH),DE
            CALL    TEST1
            DB      02CH
            JR      NZ,L4F51            ; (+01bH)
            CALL    L6E82
            CALL    L790F
            LD      (04F54H),DE
            CALL    TEST1
            DB      02CH
            JR      NZ,L4F51            ; (+00bH)
            CALL    L742F
            CALL    L790F
            LD      (04F67H),BC
            XOR     A
L4F51:      PUSH    HL
            PUSH    AF
            LD      HL,L0000
            CALL    L6E76
            LD      IX,L0182
            XOR     A
            CALL    L0000
            POP     AF
            JR      NZ,L4F6C            ; (+008H)
            LD      A,B
            EX      DE,HL
            LD      DE,L0000
            CALL    L4CC8
L4F6C:      POP     HL
            JP      L5E7D

L4F70:      CALL    L6E57
L4F73:      LD      A,D
            OR      E
            RET     Z
            LD      B,000H
L4F78:      DJNZ    L4F78               ; (-002H)
            RST     018H
            DB      00EH
            RET     Z
            DEC     DE
            JR      L4F73               ; (-00dH)

L4F80:      DEC     HL
L4F81:      CALL    L5198
            OR      A
            SCF     
            RET     Z
            CP      03AH
            RET     Z
            JR      L4F81               ; (-00bH)

L4F8C:      CALL    L6E43
            SUB     LSE0
            CP      007H
            JP      C,04AECH
            CALL    L5E6E
            PUSH    DE
            CALL    L6E43
            POP     BC
            OUT     (C),A
            RET     

L4FA1:      CALL    L6E43
            CALL    L5E6E
            PUSH    DE
            CALL    L742F
            CP      005H
            JP      NZ,04AEFH
            EX      (SP),HL
            PUSH    BC
            EX      (SP),HL
            POP     BC
            IN      E,(C)
            LD      D,000H
            CALL    L5E97
            POP     HL
            RET     

L4FBD:      CALL    L4FC5
            LD      (00054H),DE
            RET     

L4FC5:      LD      B,018H
            LD      C,027H
            CALL    L4FD0
            JP      C,04AECH
            RET     

L4FD0:      PUSH    BC
            CALL    L6E43
            PUSH    AF
            CALL    L5E6E
            CALL    L6E43
            LD      D,E
            POP     AF
            LD      E,A
            POP     BC
            LD      A,C
            CP      E
            RET     C
            LD      A,B
            CP      D
            RET     

L4FE5:      CALL    L742F
            LD      (L84C7),A
            CP      005H
            JR      Z,L5004             ; (+015H)
            PUSH    HL
            PUSH    BC
            LD      A,0FFH
            RST     018H
            DB      00DH
            OR      A
            JR      Z,L4FFE             ; (+006H)
            LD      HL,(L107A)
            LD      (HL),A
            LD      A,001H
L4FFE:      POP     DE
            CALL    L4CC8
            POP     HL
            RET     

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

L501A:      CP      040H
            LD      BC,POPRA
            JR      NZ,L5025            ; (+004H)
            INC     HL
            LD      BC,L5041
L5025:      LD      (05036H),BC
            CALL    L6E57
            CALL    L5E71
L502F:      PUSH    DE
            CALL    L6E43
            POP     DE
            EX      DE,HL
            CALL    POPRA
            EX      DE,HL
            INC     DE
            CALL    TEST1
            DB      02CH
            RET     NZ
            JR      L502F               ; (-012H)

L5041:      LD      (HL),A
            RET     

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

L505C:      POP     HL
            CALL    L6E57
            PUSH    HL
            LD      HL,(MEMMAX)
            OR      A
            SBC     HL,DE
            JP      C,L4B26
            LD      HL,(L107A)
            INC     H
            INC     H
            INC     H
            INC     H
            OR      A
            SBC     HL,DE
            JP      NC,04AECH
            EX      DE,HL
L5078:      CALL    L4902
            POP     HL
            POP     DE
            LD      SP,(INTFAC)
            LD      BC,0FFFFH
            PUSH    BC
            PUSH    DE
            RET     

L5087:      POP     IX
L5089:      POP     BC
            PUSH    BC
            LD      A,B
            INC     A
            JP      NZ,04B01H
            LD      A,C
            CP      012H
            JR      Z,L50AF             ; (+01aH)
            CP      0FEH
            JP      NZ,04B01H
            POP     BC
            CALL    L414A
            EX      DE,HL
            POP     HL
            LD      (L847C),HL
            POP     HL
            LD      (L8476),HL
            POP     HL
            PUSH    IX
            RET     Z
            EX      DE,HL
            JP      L513D

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

L50B8:      PUSH    HL
            CALL    L4F80
            EX      DE,HL
            POP     HL
            POP     BC
            PUSH    DE
            EXX     
            LD      HL,(L8476)
            PUSH    HL
            LD      HL,(L847C)
            PUSH    HL
            LD      HL,0FFFEH
            PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(TMPEND)
            SBC     HL,DE
            LD      A,00AH
            JP      C,L4B28
            EXX     
            PUSH    BC
            JR      L513D               ; (+05dH)

L50E0:      CALL    TEST1
            DB      0C1H
            JP      Z,L4C5C
            CALL    L6E57
            LD      C,E
            LD      B,D
            CP      087H
            JP      NC,L4AE6
            CP      082H
            JR      NZ,L5105            ; (+010H)
            CALL    INCHLF
            LD      E,081H
            CP      LSE4
            JR      Z,L5104             ; (+006H)
            CP      LSE0
            JP      NZ,L4AE6
            DEC     E
L5104:      LD      A,E
L5105:      PUSH    HL
            LD      HL,L43F4
            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,L5139            ; (+020H)
            LD      A,C
            OR      A
            JR      Z,L5139             ; (+01cH)
            LD      B,A
L511E:      DEC     B
            RET     Z
            CALL    HLFTCH
            CALL    L5169
            JP      NZ,L4AE6
            CALL    L519E
            OR      A
            RET     Z
            INC     HL
            CALL    TEST1
            DB      02CH
            JR      Z,L511E             ; (-017H)
            POP     DE
            JP      L5E46

L5139:      POP     DE
            JP      L4F80

L513D:      CALL    L45B2
            EX      DE,HL
            JR      NZ,L5146            ; (+003H)
            LD      HL,(L1070)
L5146:      LD      (L8476),HL
            XOR     A
            LD      (L4B6E),A
            JP      L40F0

L5150:      CALL    L6E82
            EX      AF,AF'
            LD      A,(DE)
            OR      A
            JR      Z,L5178             ; (+020H)
            EX      AF,AF'
            CP      LSE2
            JR      NZ,L5165            ; (+008H)
L515D:      CALL    INCHLF
            CALL    L5169
            JR      Z,L513D             ; (-028H)
L5165:      POP     AF
            JP      L40BB

L5169:      CP      022H
            RET     Z
L516C:      CP      00BH
            RET     Z
            CP      00CH
            RET     

L5172:      CALL    L5181
            JR      NC,L5172            ; (-005H)
            RET     

L5178:      DEC     HL
            CALL    L5181
            JR      NC,L515D            ; (-021H)
            DB      0C3H
            IN      B,(C)
L5181:      CALL    L5198
            OR      A
            SCF     
            RET     Z
            CP      0C2H
            RET     Z
            CP      093H
            JR      NZ,L5181            ; (-00dH)
            CALL    L5181
            RET     C
            JR      L5181               ; (-013H)

L5194:      INC     HL
            LD      A,(HL)
            JR      L519E               ; (+006H)

L5198:      INC     HL
            LD      A,(HL)
            CP      094H
            JR      Z,L51BD             ; (+01fH)
L519E:      OR      A
            RET     Z
            CP      022H
            JR      Z,L51DB             ; (+037H)
            CP      0FEH
            JR      NC,L51BB            ; (+013H)
            CP      097H
            JR      Z,L51BD             ; (+011H)
            CP      027H
            JR      Z,L51BD             ; (+00dH)
            CP      020H
            RET     NC
            CP      00BH
            RET     C
            CP      015H
            JR      NC,L51D2            ; (+018H)
            INC     HL
L51BB:      INC     HL
            RET     

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

L51CA:      CALL    L51DB
            OR      A
            RET     Z
            INC     HL
            JR      L51BD               ; (-015H)

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

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

L51E4:      OR      0AFH
            PUSH    AF
            LD      B,031H
            LD      C,04FH
            CALL    L4FD0
            PUSH    AF
            CALL    L5235
            POP     AF
            JR      C,L5233             ; (+03eH)
            LD      A,C
            LD      (05221H),A
            LD      B,001H
            SRL     E
            JR      NC,L5201            ; (+002H)
            SLA     B
L5201:      SRL     D
            JR      NC,L5209            ; (+004H)
            SLA     B
            SLA     B
L5209:      EX      DE,HL
            RST     018H
            DB      01EH
            CALL    BREAKX
            CP      LSPAL
            JR      NC,L5215            ; (+002H)
            LD      A,LSPAL
L5215:      LD      C,A
            POP     AF
            JR      Z,L522B             ; (+012H)
            SET     3,H
            CALL    BREAKX
            AND     08FH
            OR      000H
            CALL    POPRA
            RES     3,H
            LD      A,C
            OR      B
            JR      L522E               ; (+003H)

L522B:      LD      A,B
            CPL     
            AND     C
L522E:      CALL    POPRA
            EX      DE,HL
            RET     

L5233:      POP     AF
            RET     

L5235:      LD      A,(L005D)
            AND     070H
            LD      C,A
            CALL    TEST1
            DB      02CH
            RET     NZ
            PUSH    DE
            CALL    L5522
            POP     DE
            RLCA    
            RLCA    
            RLCA    
            RLCA    
            LD      C,A
            RET     

L524B:      RST     018H
            DB      020H
            RET     

L524E:      CALL    L5E46
            RST     018H
            DB      028H
            RST     018H
            DB      000H
            RET     

L5256:      JR      Z,L527B             ; (+023H)
            LD      A,001H
            LD      (L004E),A
            LD      A,(L0056)
            LD      B,019H
            CALL    L528E
            LD      (00056H),BC
            CALL    TEST1
            DB      02CH
            RET     NZ
            LD      B,028H
            LD      A,(L005B)
            CALL    L528E
            LD      (0005BH),BC
            RET     

L527B:      XOR     A
            LD      (L004E),A
            LD      BC,L1800
            LD      (00056H),BC
            LD      BC,L2700
            LD      (0005BH),BC
            RET     

L528E:      LD      D,000H
            LD      E,A
            CALL    TEST1
            DB      02CH
            JR      Z,L529F             ; (+008H)
            PUSH    BC
            CALL    L6E43
            POP     BC
            CALL    L5E6E
L529F:      LD      C,E
            PUSH    BC
            CALL    L6E43
            POP     BC
            DEC     A
            JP      M,04AECH
            ADD     A,C
            CP      B
            JP      NC,04AECH
            LD      B,A
            RET     

            DI      
            OUT     (LSE4),A
            JP      L0000

L52B6:      XOR     A
            LD      BC,?SETDE
            LD      (L539E),A
            PUSH    AF
            CALL    L5882
            RST     018H
            DB      02EH
            JP      C,04B22H
            BIT     1,A
            JP      Z,04B22H
            CALL    TEST1
            DB      02CH
            POP     AF
            OR      A
            JR      NZ,L52E8            ; (+015H)
            CALL    L6E67
            LD      A,B
            LD      (L5399),A
            LD      (0539AH),DE
            CALL    L5E46
            JR      L52E8               ; (+005H)

L52E3:      LD      A,002H
            LD      (L539E),A
L52E8:      CALL    L466C
            LD      (0530FH),DE
            LD      (0531DH),BC
            LD      A,0FFH
            LD      (L1090),A
            CALL    SKPDE
            LD      HL,(L1070)
L52FE:      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,L531C             ; (+006H)
            JR      Z,L531C             ; (+004H)
            POP     HL
            POP     HL
            JR      L52FE               ; (-01eH)

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

L5327:      EX      DE,HL
            CALL    L5E64
            RST     018H
            DB      017H
            LD      HL,L11A4
            CALL    LDHLDE
            LD      (HL),020H
            INC     HL
            EX      DE,HL
            POP     HL
            CALL    L68D8
            LD      A,(L539E)
            OR      A
            JR      NZ,L5346            ; (+005H)
            CALL    L535C
            JR      NC,L5350            ; (+00aH)
L5346:      LD      DE,L11A4
            RST     018H
            DB      017H
            RST     018H
            DB      037H
            CALL    L5733
L5350:      POP     HL
            LD      A,(L539E)
            CP      002H
            JR      Z,L52FE             ; (-05aH)
            RST     018H
            DB      00FH
            JR      L52FE               ; (-05eH)

L535C:      EX      DE,HL
L535D:      PUSH    HL
            CALL    L5367
            POP     HL
            RET     C
            RET     Z
            INC     HL
            JR      L535D               ; (-00aH)

L5367:      LD      A,(L5399)
            LD      B,A
            LD      DE,(0539AH)
L536F:      LD      A,(HL)
            INC     HL
            OR      A
            RET     Z
            CP      005H
            JR      Z,L537B             ; (+004H)
            CP      006H
            JR      NZ,L537D            ; (+002H)
L537B:      JR      L536F               ; (-00eH)

L537D:      PUSH    HL
            LD      C,A
L537F:      LD      A,(DE)
            INC     DE
            CP      005H
            JR      Z,L5389             ; (+004H)
            CP      006H
            JR      NZ,L5390            ; (+007H)
L5389:      DEC     B
            SCF     
            POP     HL
            RET     Z
            PUSH    HL
            JR      L537F               ; (-011H)

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

L5399:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L539E:      NOP     
L539F:      CALL    TESTX
            DB      087H
            CALL    L5E4D
            PUSH    HL
            LD      C,000H
L53A9:      RST     018H
            DB      008H
            LD      A,C
            ADD     A,031H
            LD      D,A
            LD      E,020H
            CP      03AH
            JR      NZ,L53B8            ; (+003H)
            LD      DE,L3031
L53B8:      LD      (0543BH),DE
            LD      DE,L5433
            RST     018H
            DB      00BH
            LD      A,C
            CALL    L5492
            LD      B,(HL)
            INC     HL
            PUSH    BC
            CALL    L53D6
            POP     BC
            INC     C
            LD      A,C
            CP      00AH
            JR      NZ,L53A9            ; (-029H)
            RST     018H
            DB      008H
            POP     HL
            RET     

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

L53E3:      LD      A,(HL)
            CP      020H
            JR      C,L5408             ; (+020H)
            CP      022H
            JR      Z,L5408             ; (+01cH)
            LD      A,C
            CP      001H
            JR      Z,L53FB             ; (+00aH)
            OR      A
            LD      DE,L5440
            JR      NZ,L53F9            ; (+002H)
            INC     DE
            INC     DE
L53F9:      RST     018H
            DB      00BH
L53FB:      LD      A,(HL)
            RST     018H
            DB      00AH
            INC     HL
            LD      C,001H
            DJNZ    L53E3               ; (-020H)
            LD      A,022H
L5405:      RST     018H
            DB      00AH
            RET     

L5408:      LD      A,C
            CP      0FFH
            JR      Z,L542D             ; (+020H)
            OR      A
            LD      DE,05444H
            JR      NZ,L5415            ; (+002H)
            INC     DE
            INC     DE
L5415:      RST     018H
            DB      00BH
L5417:      PUSH    BC
            PUSH    HL
            LD      L,(HL)
            LD      H,000H
            CALL    L5E64
            RST     018H
            DB      00BH
            POP     HL
            POP     BC
            INC     HL
            LD      C,0FFH
            DJNZ    L53E3               ; (-045H)
            LD      A,029H
            JP      L5405

L542D:      LD      A,02CH
            RST     018H
            DB      00AH
            JR      L5417               ; (-01cH)

L5433:      LD      B,H
            LD      B,L
            LD      B,(HL)
            JR      NZ,L5483            ; (+04bH)
            LD      B,L
            LD      E,C
            JR      Z,L543C             ; (+000H)
L543C:      NOP     
            ADD     HL,HL
            DEC     A
            NOP     
L5440:      ADD     HL,HL
            DEC     HL
            LD      (L2200),HL
            DEC     HL
            LD      B,E
            LD      C,B
            LD      D,D
            INC     H
            JR      Z,L544C             ; (+000H)
L544C:      CALL    TEST1
            DB      0B2H
            JR      Z,L545D             ; (+00bH)
            CALL    TESTX
            DB      0FFH
            CALL    TESTX
            DB      0C7H
            JP      L781D

L545D:      CALL    TESTX
L5460:      DB      028H
            CALL    L6E43
            CALL    TESTX
            DB      029H
            CALL    TESTX
            DB      QDPC
            LD      A,E
            DEC     A
            CP      00AH
            JP      NC,04AECH
            PUSH    HL
            CALL    L5492
            EX      (SP),HL
            CALL    L6E67
            EX      (SP),HL
            LD      A,B
            CP      010H
            JR      C,L5483             ; (+002H)
            LD      A,00FH
L5483:      LD      (HL),A
            OR      A
            JR      Z,L548F             ; (+008H)
            LD      B,A
            INC     HL
L5489:      LD      A,(DE)
            LD      (HL),A
            INC     DE
            INC     HL
            DJNZ    L5489               ; (-006H)
L548F:      POP     HL
            EI      
            RET     

L5492:      ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            LD      HL,L12C0
            JP      ADDHLA

L549C:      CALL    TEST1
            DB      02CH
            JR      NZ,L54AA            ; (+008H)
            CALL    L5E6E
            LD      DE,L005D
            JR      L54B6               ; (+00cH)

L54AA:      CALL    L4FC5
            CALL    L5E6E
            EX      DE,HL
            RST     018H
            DB      01EH
            SET     3,H
            EX      DE,HL
L54B6:      EX      DE,HL
            CALL    BREAKX
            EX      DE,HL
            PUSH    DE
            CALL    L54C6
            POP     DE
            EX      DE,HL
            CALL    POPRA
            EX      DE,HL
            RET     

L54C6:      LD      C,A
            CALL    TEST1
            DB      02CH
            JR      Z,L54DF             ; (+012H)
            CALL    L5522
            ADD     A,A
            ADD     A,A
            ADD     A,A
            ADD     A,A
            XOR     C
            AND     070H
            XOR     C
            LD      C,A
            CALL    TEST1
            DB      02CH
            JR      NZ,L54F0            ; (+011H)
L54DF:      CALL    L414A
            JR      Z,L54F0             ; (+00cH)
            CP      05DH
            JR      Z,L54F0             ; (+008H)
            CALL    L5522
            XOR     C
            AND     007H
            XOR     C
            RET     

L54F0:      LD      A,C
            RET     

L54F2:      INC     HL
L54F3:      CALL    L6E67
            LD      A,B
            OR      A
            JR      Z,L5509             ; (+00fH)
            PUSH    HL
            LD      HL,L11A4
            PUSH    HL
            CALL    LDHLDE
            LD      (HL),00DH
            POP     DE
            CALL    L0030
            POP     HL
L5509:      CALL    HLFTCH
            CP      03BH
            JR      Z,L54F2             ; (-01eH)
            CP      02CH
            JR      Z,L54F2             ; (-022H)
            RET     

L5515:      CALL    L6E43
            DEC     A
            CP      007H
            JP      NC,04AECH
            INC     A
            JP      L0041

L5522:      PUSH    BC
            CALL    L6E43
            POP     BC
            CP      008H
            JP      NC,04AECH
            RET     

L552D:      RST     018H
            DB      045H
            RET     

            DS      208, 000H
L5600:      LD      A,(L1042)
            CP      088H
            RET     

L5606:      CALL    L6E82
            LD      A,(L84C7)
            CP      003H
            PUSH    HL
            EX      DE,HL
            JR      Z,L5619             ; (+007H)
            CALL    L6026
            POP     HL
            RST     018H
            DB      017H
            RET     

L5619:      CALL    L6E76
            POP     HL
            RET     

L561E:      LD      A,(L005D)
            LD      (0574DH),A
            XOR     A
            LD      (L1090),A
            CALL    L5882
            RST     018H
            DB      02EH
            JP      C,L57B4
            BIT     2,A
            JP      NZ,L5D16
            BIT     1,A
            JP      Z,057B7H
            CALL    L58C2
            CALL    L5600
            JR      NZ,L5655            ; (+013H)
            CALL    TEST1
            DB      05BH
            JR      NZ,L5655            ; (+00dH)
            LD      A,(0574DH)
            CALL    L54C6
            LD      (0574DH),A
            CALL    TESTX
            DB      05DH
L5655:      CALL    L414A
            JP      Z,L5733
L565B:      LD      A,(HL)
            CP      LSE3
            JR      Z,L56DA             ; (+07aH)
            LD      BC,L5674
            PUSH    BC
            CP      03BH
            RET     Z
            CP      02CH
            RET     Z
            CP      LSE6
            JR      Z,L56AA             ; (+03cH)
            CALL    L5606
            JP      L573E

L5674:      CALL    L414A
            JP      Z,L5733
            CP      02CH
            JR      NZ,L569A            ; (+01cH)
            CALL    L5600
            JR      C,L5697             ; (+014H)
            LD      IX,(ZDELT)
            CALL    IOCALL
            LD      B,A
L568B:      SUB     00AH
            JR      NC,L568B            ; (-004H)
            NEG     
            LD      B,A
            CALL    L56CC
            JR      L569A               ; (+003H)

L5697:      CALL    L5733
L569A:      LD      A,(HL)
            CP      02CH
            JR      Z,L56A1             ; (+002H)
            CP      03BH
L56A1:      JR      NZ,L56A4            ; (+001H)
            INC     HL
L56A4:      CALL    L414A
            RET     Z
            JR      L565B               ; (-04fH)

L56AA:      CALL    L5600
            JP      C,057B7H
            CALL    L5E75
            CALL    L6E43
            CALL    L5E7D
            LD      IX,(ZDELT)
            CALL    IOCALL
            SUB     E
            RET     NC
            NEG     
            LD      B,A
            CALL    L5600
            LD      A,013H
            JR      Z,L56CE             ; (+002H)
L56CC:      LD      A,020H
L56CE:      LD      DE,L11A4
            PUSH    BC
            PUSH    DE
            CALL    ?SETDE
            POP     DE
            POP     BC
            JR      L573E               ; (+064H)

L56DA:      INC     HL
            CALL    L6E67
            LD      A,B
            OR      A
            JP      Z,04AECH
            PUSH    HL
            LD      HL,L11A4
            PUSH    HL
            PUSH    BC
            CALL    LDHLDE
            POP     BC
            LD      A,LSPAL
            LD      E,B
            LD      D,000H
            INC     DE
            RST     018H
            DB      02AH
            LD      (L6304),HL
            LD      (L6306),HL
            POP     DE
            CALL    LDHLDE
            LD      (HL),000H
            POP     HL
L5702:      CALL    L414A
            JR      Z,L5729             ; (+022H)
            INC     HL
            CP      02CH
            JR      Z,L5711             ; (+005H)
            CP      03BH
            JP      NZ,L4AE6
L5711:      CALL    L414A
            JR      Z,L572C             ; (+016H)
            CALL    L6E8A
            PUSH    HL
            LD      BC,(TMPEND)
            PUSH    BC
            CALL    L6308
            POP     DE
            CALL    L573C
            POP     HL
            JR      L5702               ; (-027H)

L5729:      CALL    L5733
L572C:      LD      A,LSPAL
            RST     018H
            DB      02BH
            RET     

L5731:      DEC     C
            NOP     
L5733:      LD      A,(L005D)
            LD      (0574DH),A
            LD      DE,L5731
L573C:      RST     018H
            DB      017H
L573E:      CALL    L5600
            JR      Z,L5746             ; (+003H)
            RST     018H
            DB      037H
            RET     

L5746:      PUSH    HL
            PUSH    BC
            LD      HL,L005D
            LD      C,(HL)
            LD      (HL),070H
            RST     018H
            DB      037H
            LD      (HL),C
            POP     BC
            POP     HL
            RET     

L5754:      LD      A,08AH
            LD      (L1042),A
            JR      L5792               ; (+037H)

L575B:      CALL    L5882
            RST     018H
            DB      02EH
            JP      C,L57B4
            BIT     2,A
            JP      NZ,L5D27
            BIT     0,A
            JP      Z,057B7H
            CALL    L58C2
            CALL    L5600
            JR      NZ,L5792            ; (+01dH)
            CALL    HLFTCH
            CP      022H
            LD      DE,L57BC
            LD      B,002H
            JR      NZ,L5788            ; (+007H)
            CALL    L6E67
            CALL    TESTX
            DB      03BH
L5788:      LD      A,B
            OR      A
            JR      Z,L5792             ; (+006H)
L578C:      LD      A,(DE)
            INC     DE
            RST     018H
            DB      003H
            DJNZ    L578C               ; (-006H)
L5792:      LD      (057EBH),SP
            LD      DE,(VARED)
            LD      (TMPEND),DE
L579E:      LD      DE,(TMPEND)
            CALL    L74E1
            CALL    L742F
            PUSH    AF
            PUSH    BC
            CALL    L414A
            JR      Z,057BEH             ; (+00fH)
            CALL    L5E71
            JR      L579E               ; (-016H)

L57B4:      LD      A,02CH
            LD      HL,0BB3EH
            JP      L0182

L57BC:      CCF     
            JR      NZ,0576EH            ; (-051H)
            PUSH    AF
            PUSH    HL
            RST     018H
            DB      034H
            LD      HL,(057EBH)
            DEC     HL
L57C7:      LD      A,(HL)
            OR      A
            JR      Z,L57E9             ; (+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    L57EE
            LD      H,000H
            LD      L,B
            ADD     HL,DE
            LD      (HL),000H
            POP     DE
            POP     AF
            CALL    L57F8
            POP     HL
            JR      L57C7               ; (-022H)

L57E9:      POP     HL
            LD      SP,L0000
            RET     

L57EE:      LD      A,(L1042)
            CP      08AH
            JR      Z,L5839             ; (+044H)
            RST     018H
            DB      035H
            RET     

L57F8:      CP      003H
            JR      NZ,L5803            ; (+007H)
            LD      HL,(L107A)
            LD      A,B
$START:     JP      L4CC8               ; $START - BASIC warm start / system entry

L5803:      PUSH    DE
            LD      HL,(L107C)
            LD      DE,(TMPEND)
            EX      DE,HL
            CALL    HLFTCH
            CP      045H
            JP      Z,04AECH
            EX      DE,HL
            CALL    L5EDA
            EX      DE,HL
            CALL    TEST1
            DB      000H
            JP      NZ,04AECH
            EX      DE,HL
            POP     DE
            JP      L5E91

L5825:      XOR     A
            JR      L587E               ; (+056H)

L5828:      CALL    L5825
            CALL    L414A
            CALL    NZ,L45B2
            EX      DE,HL
            CALL    NZ,L5869
            EX      DE,HL
            JP      L4F80

L5839:      PUSH    HL
            PUSH    DE
            CALL    L5847
            POP     DE
            POP     HL
            RET     

L5841:      LD      HL,(L1070)
            CALL    L5869
L5847:      LD      A,(L8488)
            CP      001H
            JP      Z,04B19H
            JR      C,L5841             ; (-010H)
            LD      HL,(L8489)
            LD      C,03AH
            RST     018H
            DB      036H
            LD      (L8489),HL
            CALL    L414A
            SCF     
            CCF     
            RET     NZ
            DEC     HL
L5862:      CALL    L5194
            OR      A
            JR      NZ,L5874            ; (+00cH)
            INC     HL
L5869:      LD      A,(HL)
            INC     HL
            OR      (HL)
            LD      A,001H
            JR      Z,L587E             ; (+00eH)
            INC     HL
            INC     HL
            JR      L5862               ; (-012H)

L5874:      CP      094H
            JR      NZ,L5862            ; (-016H)
            INC     HL
            LD      (L8489),HL
            LD      A,002H
L587E:      LD      (L8488),A
            RET     

L5882:      CALL    TEST1
            DB      023H
            JR      NZ,L58AD            ; (+025H)
            CALL    HLFTCH
            CP      020H
            JP      NC,L4AE6
            PUSH    DE
            PUSH    BC
            LD      DE,L84C8
            PUSH    DE
            CALL    L7052
            EX      (SP),HL
            CALL    L60B5
            LD      A,H
            OR      A
            JP      NZ,04B22H
            OR      L
            JP      Z,04B22H
            JP      M,04B22H
            POP     HL
            POP     BC
            POP     DE
            RET     

L58AD:      CALL    TEST1
            DB      FDPD
            LD      A,088H
            RET     NZ
            CALL    TEST1
            DB      050H
            LD      A,089H
            RET     Z
            CALL    TESTX
            DB      054H
            LD      A,080H
            RET     

L58C2:      LD      A,(L1042)
            OR      A
            RET     M
            JP      L5E6E

L58CA:      CALL    L593A
            RST     018H
            DB      03AH
            RET     

L58D0:      CALL    L414A
            LD      B,000H
            CALL    NZ,L6E67
L58D8:      PUSH    HL
            RST     018H
            DB      02CH
            RST     018H
            DB      03CH
            POP     HL
            RET     

L58DF:      LD      A,001H
            LD      BC,0023EH
            LD      BC,0043EH
            PUSH    AF
            LD      (L1043),A
            CALL    L5882
            CP      088H
            JR      NZ,L58F4            ; (+002H)
            LD      A,080H
L58F4:      LD      (L1042),A
            CALL    L58C2
            CALL    L592D
            POP     AF
            CP      004H
            JR      Z,L5904             ; (+002H)
L5902:      LD      A,003H
L5904:      LD      (L1000),A
            PUSH    AF
            RST     018H
            DB      033H
            LD      A,(L1000)
            POP     BC
            CP      B
            JP      NZ,04B49H
            RET     

L5913:      OR      0AFH
            LD      B,A
            CALL    L414A
            JR      Z,L5929             ; (+00eH)
L591B:      CALL    L5882
            CP      088H
            RET     NC
            RST     018H
            DB      038H
            CALL    TEST1
            DB      02CH
            JR      L591B               ; (-00eH)

L5929:      XOR     A
            RST     018H
            DB      038H
            RET     

L592D:      CALL    L46AE
            LD      B,000H
            CALL    NZ,L6E67
            PUSH    HL
            RST     018H
            DB      02DH
            POP     HL
            RET     

L593A:      PUSH    HL
            CALL    HLFTCH
            LD      DE,L5982
            LD      B,001H
            CALL    L5975
            CALL    NC,L5975
            JR      C,L5962             ; (+017H)
            CALL    L5975
            CALL    L5EC2
            CALL    L597B
            CALL    L414A
            JR      NZ,L5962            ; (+009H)
            LD      A,03AH
            LD      (DE),A
            POP     AF
            LD      DE,L5982
            JR      L596B               ; (+009H)

L5962:      POP     HL
            CALL    L414A
            LD      B,000H
            CALL    NZ,L6E67
L596B:      PUSH    HL
            RST     018H
            DB      02CH
            INC     (HL)
            DEC     (HL)
            JP      NZ,04B1FH
            POP     HL
            RET     

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

L5982:      NOP     
            NOP     
            NOP     
            NOP     
L5986:      CALL    L592D
            CALL    TEST1
            DB      02CH
            JP      Z,L5A47
            PUSH    HL
            CALL    L5BDC
            DEC     A
            JR      Z,L59A9             ; (+012H)
            DEC     A
            JP      NZ,04B49H
            CALL    L5C08
            CALL    L5BE5
            CALL    L5C0F
            CALL    L5C42
            POP     HL
            RET     

L59A9:      LD      HL,(ELMD22)
            PUSH    HL
            LD      DE,(MEMLMT)
            CALL    L59CF
            LD      DE,(ELMD20)
            LD      BC,(MEMMAX)
            CALL    NC,L59CA
            JP      C,04B0DH
            POP     HL
            RST     018H
            DB      030H
            CALL    L5C42
            POP     HL
            RET     

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

L59D5:      CALL    L592D
            CALL    L5BDC
            CP      002H
            JP      NZ,04B49H
            LD      A,(L8493)
            OR      A
            JP      Z,L5B0D
            JP      L5DB0

L59EA:      CALL    L5C08
            CALL    L592D
            CALL    TEST1
            DB      02CH
            JR      Z,05A4DH             ; (+057H)
            RST     018H
            DB      02FH
            CP      002H
            JP      NZ,04B49H
            PUSH    HL
            LD      HL,(L1078)
            LD      (L107A),HL
            LD      BC,003E8H
            ADD     HL,BC
            JP      C,L4B26
            PUSH    HL
            LD      BC,(ELMD20)
            INC     B
            ADD     HL,BC
            JP      C,L4B26
            SBC     HL,SP
            JP      NC,L4B26
            POP     HL
            PUSH    HL
            RST     018H
            DB      030H
            POP     HL
            CALL    L5A24
            POP     HL
            RET     

L5A24:      CALL    LDDEMI
            LD      A,D
            OR      E
            RET     Z
            PUSH    DE
            CALL    LDDEMI
            PUSH    HL
            LD      H,D
            LD      L,E
            LD      (L8478),HL
            CALL    L49B9
            POP     HL
            POP     BC
            PUSH    BC
            PUSH    HL
            CALL    L479C
            POP     HL
            POP     BC
            ADD     HL,BC
            DEC     HL
            DEC     HL
            DEC     HL
            DEC     HL
            JR      L5A24               ; (-023H)

L5A47:      CALL    L5C08
            LD      A,001H
            LD      BC,L003E
            LD      BC,0023EH
            PUSH    AF
            CALL    TESTX
            DB      041H
            CALL    L5E46
            LD      A,001H
            LD      (L1043),A
            LD      A,081H
            LD      (L1042),A
            CALL    L5902
            POP     AF
            PUSH    AF
            PUSH    HL
            LD      HL,L0000
            LD      DE,0FFFFH
            OR      A
            CALL    NZ,L49B9
            LD      A,081H
            RST     018H
            DB      02EH
            LD      HL,(L1078)
            LD      (L107A),HL
            LD      BC,003E8H
            ADD     HL,BC
            JP      C,04AF5H
            PUSH    HL
            LD      (L5AEB),HL
L5A89:      LD      HL,0FE00H
            ADD     HL,SP
            LD      DE,(05AEBH)
            SBC     HL,DE
            JP      C,04AF5H
            LD      DE,(TMPEND)
            RST     018H
            DB      035H
            LD      A,B
            OR      A
            JR      Z,L5AD6             ; (+036H)
            CALL    L6A09
            LD      A,B
            OR      C
            JP      Z,04AECH
            LD      HL,(L5AEB)
            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,04AECH
            POP     HL
            LD      A,(DE)
            CP      020H
            JR      NZ,L5AC3            ; (+001H)
            INC     DE
L5AC3:      CALL    L66ED
            LD      (HL),000H
            INC     HL
            LD      (L5AEB),HL
            POP     DE
            OR      A
            SBC     HL,DE
            EX      DE,HL
            LD      (HL),E
            INC     HL
            LD      (HL),D
            JR      L5A89               ; (-04dH)

L5AD6:      LD      HL,(L5AEB)
            CALL    L4952
            CALL    L4928
            POP     HL
            CALL    L5A24
            POP     HL
            POP     AF
            CP      002H
            RET     NZ
            JP      L4810

L5AEB:      NOP     
            NOP     
L5AED:      CALL    L592D
            PUSH    HL
            CALL    TEST1
            DB      02CH
            JR      NZ,L5AFF            ; (+008H)
            CALL    HLFTCH
            CP      041H
            JP      Z,05A50H
L5AFF:      CALL    L5BDC
            POP     HL
            DEC     A
            JR      Z,L5B16             ; (+010H)
            DEC     A
            JP      NZ,04B49H
            CALL    L5BE5
L5B0D:      CALL    L5C0F
            CALL    L5C42
            JP      L4810

L5B16:      LD      D,0C9H
            LD      BC,0FF00H
            CALL    TEST1
            DB      02CH
            JR      NZ,L5B2A            ; (+009H)
            CALL    TESTX
            DB      052H
            LD      D,000H
            LD      BC,0CF00H
L5B2A:      LD      A,D
            LD      (L5B93),A
            LD      HL,(L1014)
            LD      DE,(ELMD22)
            PUSH    HL
            CALL    L59CA
            POP     DE
            LD      HL,(L1070)
            LD      BC,0FF00H
            CALL    NC,L59CA
            JP      C,L4B26
            LD      SP,L0000
            CALL    L4930
            XOR     A
            LD      (L5C07),A
            LD      HL,(L1018)
            PUSH    HL
            LD      DE,(ELMD20)
            PUSH    DE
            LD      HL,(L107A)
            RST     018H
            DB      030H
            LD      A,004H
            RST     018H
            DB      003H
            LD      A,016H
            RST     018H
            DB      003H
            POP     BC
            PUSH    BC
            LD      DE,(ELMD22)
            CALL    L59CF
            LD      A,0B0H
            JR      NC,L5B7B            ; (+008H)
            EX      DE,HL
            ADD     HL,BC
            DEC     HL
            EX      DE,HL
            ADD     HL,BC
            DEC     HL
            LD      A,0B8H
L5B7B:      LD      (05B92H),A
            DI      
            PUSH    HL
            PUSH    DE
            LD      BC,00016H
            LD      HL,L5B8E
            LD      DE,0FF80H
            PUSH    DE
            LDIR    
            RET     

L5B8E:      POP     DE
            POP     HL
            POP     BC
            LDIR    
L5B93:      RET     

            POP     BC
            LD      SP,0D000H
            EX      DE,HL
            PUSH    BC
            PUSH    HL
            LD      (HL),LSD3
            INC     HL
            LD      (HL),LSE4
            INC     HL
            LD      (HL),0C9H
            RET     

L5BA4:      LD      HL,(L1078)
            LD      (L107A),HL
            LD      DE,(TEXTED)
            LD      (05C01H),DE
            OR      A
            SBC     HL,DE
            LD      (L5C03),HL
            LD      HL,0FE00H
            ADD     HL,SP
            LD      (L5C05),HL
            LD      DE,(VARED)
            PUSH    HL
            OR      A
            SBC     HL,DE
            JP      C,L4B26
            EX      (SP),HL
            EX      DE,HL
            LD      BC,(05C03H)
            INC     BC
            LDDR    
            POP     DE
            RST     018H
            DB      018H
            LD      A,001H
            LD      (L5C07),A
            RET     

L5BDC:      CALL    L5BA4
            RST     018H
            DB      02FH
            LD      A,(L1000)
            RET     

L5BE5:      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      (L5C03),HL
            RET     

L5C01:      NOP     
            NOP     
L5C03:      NOP     
            NOP     
L5C05:      NOP     
            NOP     
L5C07:      NOP     
L5C08:      CALL    L4152
            JP      NZ,04B10H
            RET     

L5C0F:      LD      BC,(ELMD20)
            PUSH    BC
            LD      HL,(L1072)
            LD      DE,(TEXTST)
            OR      A
            SBC     HL,DE
            LD      L,000H
            SBC     HL,BC
            JP      C,L4B26
            LD      HL,L0000
            LD      (L5C01),HL
            CALL    L4824
            LD      HL,L0000
            LD      (L847C),HL
            LD      HL,(L1070)
            RST     018H
            DB      030H
            POP     BC
            LD      HL,(L1070)
            ADD     HL,BC
            LD      (L5C01),HL
            RET     

L5C42:      LD      A,081H
            LD      B,000H
            RST     018H
            DB      038H
            LD      HL,L5C07
            LD      A,(HL)
            OR      A
            RET     Z
            LD      (HL),000H
            LD      HL,(L5C01)
            LD      A,H
            OR      L
            JR      NZ,L5C5D            ; (+006H)
            LD      HL,(L1070)
            CALL    L4952
L5C5D:      EX      DE,HL
            LD      HL,(L1072)
            LD      BC,(05C03H)
            LDIR    
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      DE,HL
            RST     018H
            DB      018H
            RET     

L5C6F:      PUSH    HL
            CALL    L46C8
            POP     HL
            CALL    L592D
            PUSH    HL
            RST     018H
            DB      02FH
            CP      002H
            JP      NZ,04B49H
            LD      HL,(L1070)
            RST     018H
            DB      032H
            POP     HL
            RET     

L5C86:      PUSH    HL
            CALL    L46C8
            POP     HL
            CALL    L592D
            CALL    TEST1
            DB      02CH
            JR      Z,L5CB3             ; (+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,04B46H
            RST     018H
            DB      031H
            POP     HL
            RET     

L5CB3:      CALL    TESTX
            DB      041H
            PUSH    HL
            LD      A,002H
            LD      (L1043),A
            LD      A,081H
            LD      (L1042),A
            CALL    L5902
            POP     HL
            CALL    L52E3
            CALL    L5733
            LD      B,001H
            LD      A,081H
            RST     018H
            DB      038H
            RET     

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

L5CE1:      CALL    L5882
            PUSH    AF
            RST     018H
            DB      02EH
            JP      C,L57B4
            BIT     1,A
            JP      Z,057B7H
            CALL    L58C2
            CALL    L593A
            LD      B,A
            XOR     A
            RST     018H
            DB      039H
            LD      A,B
            RST     018H
            DB      03AH
            POP     AF
            RST     018H
            DB      039H
            RET     

L5D00:      CALL    L6E67
            RST     018H
            DB      02DH
            RST     018H
            DB      03DH
            RET     

L5D08:      CALL    L6E67
            RST     018H
            DB      02DH
            CALL    L5E6E
            CALL    L6E67
            RST     018H
            DB      03EH
            RET     

L5D16:      CALL    L5D4C
L5D19:      CALL    L5606
            RST     018H
            DB      042H
            CALL    L414A
            RET     Z
            CALL    L5E71
            JR      L5D19               ; (-00eH)

L5D27:      CALL    L5D4C
            LD      DE,(TMPEND)
            CALL    L74E1
L5D31:      CALL    L742F
            PUSH    HL
            PUSH    AF
            PUSH    BC
            LD      DE,(TMPEND)
            RST     018H
            DB      041H
            POP     DE
            POP     AF
            CALL    L57F8
            POP     HL
            CALL    L414A
            RET     Z
            CALL    L5E71
            JR      L5D31               ; (-01bH)

L5D4C:      CALL    TEST1
            DB      028H
            RET     NZ
            CALL    L6E57
            LD      A,D
            OR      E
            JP      Z,04AECH
            RST     018H
            DB      040H
            CALL    L5E7D
            CALL    TEST1
            DB      02CH
            RET     

L5D63:      LD      A,(L8493)
            OR      A
            JP      NZ,04B1CH
            PUSH    HL
            LD      B,000H
            RST     018H
            DB      02CH
            LD      (05E18H),DE
            LD      (L5E1A),A
            LD      HL,(L1072)
            LD      DE,(TEXTST)
            XOR     A
            SBC     HL,DE
            LD      (L1014),HL
            RST     018H
            DB      044H
            POP     HL
            CALL    L592D
            CALL    L5E46
            LD      A,(L1050)
            BIT     5,A
            JP      Z,057B7H
            PUSH    HL
            LD      HL,(0848DH)
            ADD     HL,SP
            LD      SP,HL
            EX      DE,HL
            LD      HL,L8476
            LD      BC,(0848BH)
            LDIR    
            CALL    L5BDC
            CP      002H
            JP      NZ,04B49H
            LD      (05DB1H),SP
L5DB0:      LD      SP,L0000
            CALL    L5C0F
            CALL    L5C42
            LD      HL,0FFFDH
            PUSH    HL
            PUSH    HL
            LD      A,001H
            LD      (L8493),A
            LD      HL,(L1070)
            JP      L40F0

L5DC9:      XOR     A
            LD      (L8493),A
            POP     IX
L5DCF:      POP     BC
            LD      A,B
            CP      0FFH
            JP      NZ,04B1CH
            LD      A,C
            CP      0FDH
            JR      Z,L5DEE             ; (+013H)
            CP      0FEH
            LD      HL,00004H
            JR      Z,L5DEA             ; (+008H)
            CP      012H
            LD      HL,00010H
            JP      NZ,04B1CH
L5DEA:      ADD     HL,SP
            LD      SP,HL
            JR      L5DCF               ; (-01fH)

L5DEE:      LD      DE,(05E18H)
            LD      A,(L5E1A)
            RST     018H
            DB      03AH
            LD      B,000H
            RST     018H
            DB      02CH
            CALL    L5BA4
            OR      0FFH
            RST     018H
            DB      044H
            CALL    L5C0F
            CALL    L5C42
            LD      HL,L0000
            ADD     HL,SP
            LD      DE,L8476
            LD      BC,(0848BH)
            LDIR    
            LD      SP,HL
            POP     HL
            RET     

            NOP     
            NOP     
L5E1A:      NOP     
L5E1B:      LD      DE,L5E35
            LD      B,005H
            CALL    L58D8
            LD      A,031H
            CALL    L5E2A
            LD      A,032H
L5E2A:      LD      (05E3CH),A
            LD      DE,05E3AH
            LD      B,00CH
            JP      L58D8

L5E35:      DB      "CMT:TRS?:0,$8C,13"
L5E46:      CALL    L414A
            RET     Z
            JP      L4AE6

L5E4D:      XOR     A
            LD      (L1091),A
            CALL    TEST1
            DB      FDPD
            RET     NZ
            CALL    TESTX
            DB      050H
            CALL    L6ABE
            LD      A,050H
            LD      (L1091),A
            CP      A
            RET     

L5E64:      LD      DE,L8495
            LD      B,000H
            PUSH    DE
            RST     018H
            DB      016H
            POP     DE
            RET     

L5E6E:      CALL    HLFTCH
L5E71:      CP      02CH
            JR      L5E82               ; (+00dH)

L5E75:      INC     HL
L5E76:      CALL    HLFTCH
L5E79:      CP      028H
            JR      L5E82               ; (+005H)

L5E7D:      CALL    HLFTCH
L5E80:      CP      029H
L5E82:      INC     HL
            RET     Z
            JP      L4AE6

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

L5E8E:      LD      HL,L6110
L5E91:      LD      BC,00005H
            LDIR    
            RET     

L5E97:      CALL    L7960
            LD      A,E
            OR      D
            RET     Z
            BIT     7,D
            LD      A,07FH
            JR      Z,L5EAC             ; (+009H)
            LD      A,D
            CPL     
            LD      D,A
            LD      A,E
            CPL     
            LD      E,A
            INC     DE
            LD      A,0FFH
L5EAC:      LD      B,091H
L5EAE:      DEC     B
            BIT     7,D
            JR      NZ,L5EB9            ; (+006H)
            RL      E
            RL      D
            JR      L5EAE               ; (-00bH)

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

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

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

L5EDA:      CALL    L7960
            LD      (L62FF),A
            LD      (L6300),A
            LD      (L6301),A
            LD      (05F81H),A
            LD      A,005H
            LD      (L84C7),A
L5EEE:      CALL    L5E87
            CP      02BH
            JR      Z,L5EEE             ; (-007H)
            CP      02DH
            JR      NZ,L5EFF            ; (+006H)
            CALL    L5EEE
            JP      L796B

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

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

L5F17:      LD      A,(DE)
            INC     DE
L5F19:      CP      020H
            JR      Z,L5F17             ; (-006H)
            CP      02EH
            JR      Z,L5F3C             ; (+01bH)
            CALL    L5EC2
            JR      C,L5F76             ; (+050H)
            SUB     030H
            CALL    L60A8
            CALL    L6012
            LD      A,001H
            LD      (L6300),A
            LD      A,(L62FF)
            INC     A
            LD      (L62FF),A
            JR      L5F17               ; (-025H)

L5F3C:      LD      A,001H
            LD      (05F81H),A
            LD      C,A
L5F42:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L5F42             ; (-006H)
            CALL    L5EC2
            JR      C,L5F6E             ; (+021H)
            INC     C
            SUB     030H
            JR      Z,L5F59             ; (+007H)
            PUSH    AF
            LD      A,001H
            LD      (L6300),A
            POP     AF
L5F59:      PUSH    AF
            LD      A,(L6300)
            LD      B,A
            LD      A,(L62FF)
            ADD     A,B
            LD      (L62FF),A
            POP     AF
            CALL    L60A8
            CALL    L6012
            JR      L5F42               ; (-02cH)

L5F6E:      DEC     C
            JR      Z,L5F76             ; (+005H)
            CALL    L5FFC
            JR      L5F6E               ; (-008H)

L5F76:      CP      045H
            JR      Z,L5F87             ; (+00dH)
L5F7A:      DEC     DE
            LD      A,(L6301)
            OR      A
            RET     NZ
            LD      A,000H
            OR      A
            RET     NZ
            LD      A,005H
            RET     

L5F87:      LD      A,(DE)
            CP      02DH
            JR      Z,L5F95             ; (+009H)
            CP      02BH
            JR      Z,L5F95             ; (+005H)
            CALL    L5EC2
            JR      C,L5F7A             ; (-01bH)
L5F95:      LD      A,001H
            LD      (05F81H),A
            PUSH    HL
            LD      HL,L7BAC
            LD      (05FF5H),HL
            LD      HL,L0000
            LD      A,(DE)
            INC     DE
            CP      02BH
            JR      Z,L5FB6             ; (+00cH)
            CP      02DH
            JR      NZ,L5FB8            ; (+00aH)
            PUSH    HL
            LD      HL,L7C97
            LD      (05FF5H),HL
            POP     HL
L5FB6:      LD      A,(DE)
            INC     DE
L5FB8:      SUB     030H
            JR      C,L5FD8             ; (+01cH)
            CP      00AH
            JR      NC,L5FD8            ; (+018H)
            PUSH    DE
            CALL    L600D
            LD      E,L
            LD      D,H
            CALL    L600D
            CALL    L600D
            CALL    L6009
            LD      E,A
            LD      D,000H
            CALL    L6009
            POP     DE
            JR      L5FB6               ; (-022H)

L5FD8:      LD      A,H
            OR      A
            JR      NZ,L600F            ; (+033H)
            LD      A,L
            POP     HL
            PUSH    DE
            PUSH    BC
            PUSH    HL
            LD      DE,L84C8
            PUSH    DE
            CALL    L5E8E
            POP     HL
            LD      B,A
            INC     B
            JR      L5FF0               ; (+003H)

L5FED:      CALL    L60A8
L5FF0:      DJNZ    L5FED               ; (-005H)
            EX      DE,HL
            POP     HL
            CALL    L0000
            POP     BC
            POP     DE
            JP      L5F7A

L5FFC:      PUSH    AF
            PUSH    BC
            PUSH    DE
            LD      DE,L610B
            CALL    L7C97
            POP     DE
            POP     BC
            POP     AF
            RET     

L6009:      ADD     HL,DE
            RET     NC
            JR      L600F               ; (+002H)

L600D:      ADD     HL,HL
            RET     NC
L600F:      JP      04AE9H

L6012:      PUSH    DE
            PUSH    HL
            LD      HL,L84C8
            LD      E,A
            LD      D,000H
            CALL    L5E97
            EX      DE,HL
            POP     HL
            PUSH    BC
            CALL    L797E
            POP     BC
            POP     DE
            RET     

L6026:      LD      A,005H
            LD      (L84C7),A
            LD      A,(HL)
            OR      A
            JR      Z,L6033             ; (+004H)
            INC     HL
            LD      A,(HL)
            DEC     HL
            RLCA    
L6033:      LD      A,020H
            JR      NC,L603C            ; (+005H)
            CALL    L796B
            LD      A,02DH
L603C:      PUSH    AF
            CALL    L61AB
            CALL    L6238
            POP     AF
            DEC     DE
            LD      (DE),A
            RET     

L6047:      PUSH    BC
            CALL    L7A15
            POP     BC
            RET     

L604D:      CALL    SKPDE
            LD      A,(HL)
            CP      081H
            JP      C,L7960
            LD      A,(HL)
            CP      0A0H
            RET     NC
            INC     HL
            CALL    L6084
            PUSH    HL
            LD      L,(HL)
            LD      B,000H
L6062:      SRL     E
            RR      D
            RR      C
            RR      L
            INC     A
            INC     B
            CP      0A0H
            JR      NZ,L6062            ; (-00eH)
L6070:      SLA     L
            RL      C
            RL      D
            RL      E
            DJNZ    L6070               ; (-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     

L6084:      LD      E,(HL)
            INC     HL
L6086:      LD      D,(HL)
            INC     HL
            LD      C,(HL)
            INC     HL
            RET     

L608B:      LD      A,(HL)
            CP      081H
            RET     C
            PUSH    DE
            PUSH    HL
            LD      DE,L60A3
            PUSH    DE
            CALL    L5E91
            POP     HL
            CALL    L604D
            EX      DE,HL
            POP     HL
            CALL    L7975
            POP     DE
            RET     

L60A3:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L60A8:      PUSH    AF
            PUSH    BC
            PUSH    DE
            LD      DE,L610B
            CALL    L7BAC
            POP     DE
            POP     BC
            POP     AF
            RET     

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

L60C5:      DEC     HL
            LD      A,(HL)
            CP      091H
            JP      NC,04AE9H
            CP      081H
            JR      C,L60E3             ; (+013H)
            PUSH    AF
            INC     HL
            LD      A,(HL)
            INC     HL
            LD      L,(HL)
            LD      H,A
            POP     AF
            SET     7,H
L60D9:      CP      090H
            RET     Z
            INC     A
            SRL     H
            RR      L
            JR      L60D9               ; (-00aH)

L60E3:      CCF     
            LD      HL,L0000
            RET     

L60E8:      SBC     A,E
            LD      A,0BCH
            JR      NZ,L60ED            ; (+000H)
L60ED:      SBC     A,B
            JR      L6086               ; (-06aH)

            ADD     A,B
            NOP     
            SUB     H
            LD      (HL),H
            INC     H
            NOP     
            NOP     
            SUB     C
            LD      B,E
            LD      D,B
            NOP     
            NOP     
            ADC     A,(HL)
            INC     E
            LD      B,B
            NOP     
            NOP     
            ADC     A,D
            LD      A,D
            NOP     
            NOP     
            NOP     
            ADD     A,A
            LD      C,B
            NOP     
            NOP     
            NOP     
L610B:      ADD     A,H
            JR      NZ,L610E            ; (+000H)
L610E:      NOP     
            NOP     
L6110:      ADD     A,C
            NOP     
            NOP     
            NOP     
            NOP     
            LD      A,L
            LD      C,H
            CALL    Z,0CDCCH
L611A:      LD      H,(HL)
            DEC     HL
            CALL    Z,L1277
L611F:      LD      HL,(L6302)
            LD      B,000H
L6124:      LD      DE,L610B
            CALL    L6047
            JR      C,L6132             ; (+006H)
            CALL    L5FFC
            INC     B
            JR      L6124               ; (-00eH)

L6132:      LD      DE,L6110
            CALL    L6047
            JR      NC,L6140            ; (+006H)
            CALL    L60A8
            DEC     B
            JR      L6132               ; (-00eH)

L6140:      PUSH    BC
            CALL    L61AB
            CALL    L6238
            POP     BC
            PUSH    DE
            EX      DE,HL
L614A:      LD      A,(HL)
            OR      A
            JR      Z,L6151             ; (+003H)
            INC     HL
            JR      L614A               ; (-007H)

L6151:      DEC     HL
            LD      A,(HL)
            INC     HL
            CP      030H
            JR      NZ,L615A            ; (+002H)
            INC     B
            DEC     HL
L615A:      LD      A,045H
            LD      (HL),A
            INC     HL
            LD      A,B
            LD      B,02BH
            BIT     7,A
            JR      Z,L6169             ; (+004H)
            NEG     
            LD      B,02DH
L6169:      LD      (HL),B
            INC     HL
            LD      (HL),030H
L616D:      SUB     00AH
            JR      C,L6174             ; (+003H)
            INC     (HL)
            JR      L616D               ; (-007H)

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

L617D:      PUSH    HL
            CALL    L60B5
            LD      DE,L84A0
            PUSH    DE
            LD      B,001H
            RST     018H
            DB      016H
            POP     HL
            LD      A,030H
            LD      B,005H
L618E:      CP      (HL)
            JR      NZ,L6196            ; (+005H)
            INC     HL
            DJNZ    L618E               ; (-006H)
            JR      L619F               ; (+009H)

L6196:      LD      A,B
            LD      (L62FF),A
            LD      A,001H
            LD      (L6300),A
L619F:      LD      A,02EH
            LD      (L84A5),A
            POP     HL
            CALL    L608B
            JP      L61FB

L61AB:      LD      (L6302),HL
            XOR     A
            LD      (L62FF),A
            LD      (L6300),A
            PUSH    HL
            LD      HL,L849C
            LD      (HL),0FFH
            LD      B,021H
            LD      A,030H
L61BF:      INC     HL
            LD      (HL),A
            DJNZ    L61BF               ; (-004H)
            LD      A,02EH
            LD      (L84A5),A
            POP     HL
            LD      A,(HL)
            OR      A
            RET     Z
            LD      DE,L60E8
            CALL    L7A15
            CCF     
            RET     C
            LD      DE,L611A
            CALL    L7A15
            RET     C
            LD      DE,L84D0
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      A,(HL)
            CP      081H
            JR      C,L61FB             ; (+013H)
            CP      090H
            JP      C,L617D
            LD      IX,L849D
            LD      DE,L60ED
            CALL    L62C2
            CALL    L62F6
            RET     NC
L61FB:      LD      IX,L84A6
L61FF:      LD      DE,L60E8
            PUSH    BC
            PUSH    IX
            CALL    L7BAC
            POP     IX
            POP     BC
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            CALL    L62C2
            CALL    L62F6
            JR      C,L61FF             ; (-019H)
            RET     

L6219:      LD      A,005H
            LD      (L84C7),A
            PUSH    HL
            LD      DE,L84D8
            PUSH    DE
            CALL    L5E91
            POP     HL
            CALL    L61AB
            CALL    L6235
            POP     HL
            RET     

L622F:      LD      DE,L84A5
            LD      (DE),A
            DEC     DE
            RET     

L6235:      JP      C,L611F
L6238:      LD      HL,(L6302)
            LD      A,(HL)
            OR      A
            JR      Z,L622F             ; (-010H)
            LD      DE,L849D
            DEC     DE
            EX      DE,HL
            LD      DE,00001H
L6247:      INC     HL
            LD      A,(HL)
            CP      02EH
            JR      NZ,L6252            ; (+005H)
            LD      DE,L0000
            JR      L6247               ; (-00bH)

L6252:      CP      030H
            JR      Z,L6247             ; (-00fH)
            ADD     HL,DE
            LD      DE,00008H
            ADD     HL,DE
            LD      A,(HL)
L625C:      LD      (HL),030H
            CP      035H
            JR      C,L6271             ; (+00fH)
L6262:      DEC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L6262             ; (-006H)
            INC     A
            JR      Z,L62AB             ; (+040H)
            LD      (HL),A
            CP      03AH
            JR      Z,L625C             ; (-014H)
            INC     HL
L6271:      LD      DE,L84A5
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      DE,HL
            JR      C,L6280             ; (+005H)
            LD      HL,L84A5
            JR      L6297               ; (+017H)

L6280:      DEC     HL
            LD      A,(HL)
            CP      02EH
            DEC     HL
            JR      Z,L6296             ; (+00fH)
            INC     HL
            CP      030H
            JR      Z,L6271             ; (-01bH)
            PUSH    HL
            LD      DE,L84AE
            SBC     HL,DE
            POP     HL
            JP      NC,L611F
L6296:      INC     HL
L6297:      LD      (HL),000H
            LD      DE,L849D
L629C:      LD      A,(DE)
            CP      030H
            JR      NZ,L62A4            ; (+003H)
            INC     DE
            JR      L629C               ; (-008H)

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

L62AB:      LD      HL,L8495
            LD      DE,L62BC
            PUSH    BC
            LD      BC,L0006
            LDIR    
            POP     BC
            LD      DE,L8495
            RET     

L62BC:      LD      SP,L2B45
            JR      NC,L62F9            ; (+038H)
            NOP     
L62C2:      LD      A,(DE)
            CP      07DH
            RET     Z
L62C6:      CALL    L7A15
            JR      C,L62DE             ; (+013H)
            INC     (IX+000H)
            PUSH    IX
            PUSH    BC
            CALL    L7975
            POP     BC
            POP     IX
            LD      A,001H
            LD      (L6300),A
            JR      L62C6               ; (-018H)

L62DE:      INC     IX
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            LD      A,(L6300)
            LD      B,A
            LD      A,(L62FF)
            ADD     A,B
            LD      (L62FF),A
            CALL    L62F6
            RET     NC
            JR      L62C2               ; (-034H)

L62F6:      LD      A,(HL)
            OR      A
            RET     Z
L62F9:      LD      A,(L62FF)
            CP      009H
            RET     

L62FF:      NOP     
L6300:      NOP     
L6301:      NOP     
L6302:      NOP     
            NOP     
L6304:      NOP     
            NOP     
L6306:      NOP     
            NOP     
L6308:      LD      HL,(L6306)
            PUSH    DE
L630C:      LD      A,(HL)
            OR      A
            JP      Z,04AECH
            CALL    L63AA
            JR      Z,L631B             ; (+005H)
            LD      (BC),A
            INC     BC
            INC     HL
            JR      L630C               ; (-00fH)

L631B:      EX      AF,AF'
            LD      A,(L84C7)
            CP      003H
            JP      NZ,L63D3
            EX      AF,AF'
            CP      021H
            JP      Z,L6332
            CP      026H
            JP      Z,L6359
            JP      04AEFH

L6332:      EX      (SP),HL
            PUSH    BC
            CALL    L6E76
            OR      A
            LD      A,020H
            JR      Z,L633D             ; (+001H)
            LD      A,(DE)
L633D:      POP     BC
            LD      (BC),A
            INC     BC
L6340:      POP     HL
            INC     HL
L6342:      LD      A,(HL)
            OR      A
            JR      Z,L6350             ; (+00aH)
            CALL    L63AA
            JR      Z,L6353             ; (+008H)
            LD      (BC),A
            INC     BC
            INC     HL
            JR      L6342               ; (-00eH)

L6350:      LD      HL,(L6304)
L6353:      LD      (L6306),HL
            XOR     A
            LD      (BC),A
            RET     

L6359:      LD      D,002H
L635B:      INC     HL
            LD      A,(HL)
            CP      026H
            JR      Z,L6369             ; (+008H)
            INC     D
            CP      020H
            JR      Z,L635B             ; (-00bH)
            JP      04AECH

L6369:      EX      (SP),HL
            LD      A,(HL)
            CP      D
            JR      C,L6383             ; (+015H)
            INC     HL
            CALL    INDRCT
            PUSH    BC
            LD      BC,(STRST)
            ADD     HL,BC
            POP     BC
L6379:      LD      A,(HL)
            LD      (BC),A
            INC     BC
            INC     HL
            DEC     D
            JR      NZ,L6379            ; (-007H)
            JP      L6340

L6383:      LD      E,(HL)
            INC     HL
            CALL    INDRCT
            LD      A,E
            OR      A
            JR      Z,L63A0             ; (+014H)
            PUSH    BC
            LD      BC,(STRST)
            ADD     HL,BC
            POP     BC
L6393:      LD      A,(HL)
            LD      (BC),A
            INC     BC
            INC     HL
            DEC     E
            JR      Z,L63A4             ; (+00aH)
            DEC     D
            JR      NZ,L6393            ; (-00aH)
            JP      L6340

L63A0:      LD      A,020H
            LD      (BC),A
            INC     BC
L63A4:      DEC     D
            JR      NZ,L63A0            ; (-007H)
            JP      L6340

L63AA:      CALL    CHKACC
            INC     B
            LD      HL,L2326
            DEC     HL
            RET     Z
            LD      E,A
            CP      02AH
            JR      Z,L63CD             ; (+015H)
            CALL    L65AA
            JR      Z,L63CD             ; (+010H)
            CP      02EH
            LD      E,023H
            JR      Z,L63CD             ; (+00aH)
            CP      0C4H
            RET     NZ
            INC     HL
            LD      A,(HL)
            OR      A
            JP      Z,04AECH
            RET     

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

L63D3:      XOR     A
            LD      (0651AH),A
            LD      (0656AH),A
            LD      (L6552),A
            LD      (06510H),A
            LD      (064CAH),A
            LD      (064F7H),A
            LD      (06515H),A
            LD      (064C3H),A
            DEC     A
            LD      (064C0H),A
            EX      AF,AF'
            LD      D,000H
            CP      023H
            JP      Z,L642F
            CP      02AH
            JP      Z,L6410
            CALL    L65AA
            JP      Z,L6421
            CP      02EH
            JP      Z,L6431
            CP      02BH
            JP      Z,L642A
            JP      04AEFH

L6410:      LD      A,001H
            LD      (0656AH),A
            INC     HL
            INC     D
            INC     HL
            INC     D
            LD      A,(HL)
            CALL    L65AA
            JR      NZ,L6431            ; (+012H)
            JR      L6423               ; (+002H)

L6421:      INC     HL
            INC     D
L6423:      INC     HL
            INC     D
            LD      (L6552),A
            JR      L6431               ; (+007H)

L642A:      LD      A,001H
            LD      (0651AH),A
L642F:      INC     HL
            INC     D
L6431:      EX      DE,HL
            DEC     H
L6433:      INC     H
            LD      A,(DE)
            INC     DE
            CP      023H
            JR      Z,L6433             ; (-007H)
            CP      02CH
            JR      NZ,L6445            ; (+007H)
            LD      A,001H
            LD      (064CAH),A
            JR      L6433               ; (-012H)

L6445:      CP      02EH
            JR      Z,L646C             ; (+023H)
            CP      02DH
            JR      NZ,L6455            ; (+008H)
            LD      A,001H
            LD      (06510H),A
            INC     DE
            JR      L6465               ; (+010H)

L6455:      CP      02BH
            JR      NZ,L6465            ; (+00cH)
            LD      A,(0651AH)
            OR      A
            JR      NZ,L6465            ; (+006H)
            LD      A,001H
            LD      (06515H),A
            INC     DE
L6465:      DEC     DE
            LD      A,H
            LD      (064F7H),A
            JR      L649F               ; (+033H)

L646C:      LD      A,H
            LD      (064F7H),A
            LD      H,0FFH
L6472:      INC     H
            LD      A,(DE)
            INC     DE
            CP      023H
            JR      Z,L6472             ; (-007H)
            CP      02DH
            JR      NZ,L6485            ; (+008H)
            LD      A,001H
            LD      (06510H),A
            INC     DE
            JR      L6495               ; (+010H)

L6485:      CP      02BH
            JR      NZ,L6495            ; (+00cH)
            LD      A,(0651AH)
            OR      A
            JR      NZ,L6495            ; (+006H)
            LD      A,001H
            LD      (06515H),A
            INC     DE
L6495:      DEC     DE
            LD      A,H
            LD      (064C0H),A
            JR      L649F               ; (+003H)

L649C:      POP     DE
            JR      L64B1               ; (+012H)

L649F:      LD      H,004H
            PUSH    DE
L64A2:      LD      A,(DE)
            INC     DE
            CP      05EH
            JR      NZ,L649C            ; (-00cH)
            DEC     H
            JR      NZ,L64A2            ; (-009H)
            POP     AF
            LD      A,001H
            LD      (064C3H),A
L64B1:      POP     HL
            PUSH    DE
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            DEC     HL
            LD      (06547H),A
            LD      A,(064F7H)
            LD      D,A
            LD      A,000H
            LD      E,A
            LD      A,000H
            PUSH    BC
            CALL    L65BC
            POP     BC
            LD      A,000H
            OR      A
            JR      Z,L650F             ; (+041H)
            PUSH    BC
            PUSH    DE
            LD      A,(064F7H)
            LD      L,A
            LD      H,000H
            ADD     HL,DE
            LD      DE,L8495
            LD      C,000H
            DEC     HL
L64DD:      LD      B,003H
L64DF:      LD      A,(HL)
            CP      020H
            JR      Z,L64F6             ; (+012H)
            INC     C
            LD      (DE),A
            INC     DE
            DEC     HL
            DJNZ    L64DF               ; (-00bH)
            LD      A,(HL)
            CP      020H
            JR      Z,L64F6             ; (+007H)
            LD      A,02CH
            LD      (DE),A
            INC     DE
            INC     C
            JR      L64DD               ; (-019H)

L64F6:      LD      A,000H
            CP      C
            JP      C,04AE9H
            LD      B,C
            LD      L,A
            LD      H,000H
            POP     DE
            PUSH    DE
            ADD     HL,DE
            LD      DE,L8495
            DEC     HL
L6507:      LD      A,(DE)
            LD      (HL),A
            DEC     HL
            INC     DE
            DJNZ    L6507               ; (-006H)
            POP     DE
            POP     BC
L650F:      LD      A,000H
            OR      A
            JR      NZ,L6551            ; (+03dH)
            LD      A,000H
            OR      A
            JR      NZ,L6551            ; (+038H)
            LD      A,000H
            OR      A
            JR      NZ,L6546            ; (+028H)
            LD      A,(06547H)
            RLCA    
            JR      NC,L6551            ; (+02dH)
            LD      A,(DE)
            CP      020H
            LD      H,02DH
            JR      Z,L6530             ; (+005H)
            CP      030H
            JP      NZ,04AE9H
L6530:      PUSH    DE
L6531:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L6531             ; (-006H)
            CP      030H
            JR      Z,L6531             ; (-00aH)
            OR      A
            JR      NZ,L653F            ; (+001H)
            DEC     DE
L653F:      DEC     DE
            DEC     DE
            LD      A,H
            LD      (DE),A
            POP     DE
            JR      L6551               ; (+00bH)

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

L6551:      DB      03EH
L6552:      NOP     
            OR      A
            JR      Z,L6569             ; (+013H)
            LD      A,(DE)
            CP      020H
            JR      NZ,L6569            ; (+00eH)
            PUSH    DE
L655C:      LD      A,(DE)
            INC     DE
            CP      020H
            JR      Z,L655C             ; (-006H)
            DEC     DE
            DEC     DE
            LD      A,(L6552)
            LD      (DE),A
            POP     DE
L6569:      LD      A,000H
            OR      A
            JR      Z,L657B             ; (+00dH)
            PUSH    DE
L656F:      LD      A,(DE)
            CP      020H
            JR      NZ,L657A            ; (+006H)
            LD      A,02AH
            LD      (DE),A
            INC     DE
            JR      L656F               ; (-00bH)

L657A:      POP     DE
L657B:      LD      A,(DE)
            OR      A
            JR      Z,L6584             ; (+005H)
            LD      (BC),A
            INC     BC
            INC     DE
            JR      L657B               ; (-009H)

L6584:      LD      A,(06515H)
            OR      A
            JR      Z,L6598             ; (+00eH)
            LD      A,(06547H)
            RLCA    
            LD      A,02BH
L6590:      JR      NC,L6594            ; (+002H)
            LD      A,02DH
L6594:      LD      (BC),A
            INC     BC
            JR      L65A6               ; (+00eH)

L6598:      LD      A,(06510H)
            OR      A
            JR      Z,L65A6             ; (+008H)
            LD      A,(06547H)
            RLCA    
            LD      A,020H
            JR      L6590               ; (-016H)

L65A6:      POP     HL
            JP      L6342

L65AA:      PUSH    HL
            LD      HL,L0036
            BIT     6,(HL)
            POP     HL
            JR      NZ,L65B6            ; (+003H)
            CP      07DH
            RET     

L65B6:      CP      FDPD
            RET     Z
            CP      024H
            RET     

L65BC:      OR      A
            JP      Z,L6647
            PUSH    DE
            LD      A,(HL)
            OR      A
            JR      Z,L6604             ; (+03fH)
            PUSH    HL
            LD      A,D
            LD      DE,L84D0
            PUSH    AF
            CALL    L5E8E
            POP     AF
            OR      A
            JR      Z,L65DD             ; (+00bH)
            LD      B,A
            LD      HL,L84D0
            JR      L65DB               ; (+003H)

L65D8:      CALL    L60A8
L65DB:      DJNZ    L65D8               ; (-005H)
L65DD:      POP     HL
            LD      B,000H
L65E0:      LD      DE,L84D0
            CALL    L6047
            JR      C,L65EE             ; (+006H)
            CALL    L5FFC
            INC     B
            JR      L65E0               ; (-00eH)

L65EE:      PUSH    HL
            LD      HL,L84D0
            CALL    L5FFC
            POP     HL
L65F6:      LD      DE,L84D0
            CALL    L6047
            JR      NC,L6604            ; (+006H)
            CALL    L60A8
            DEC     B
            JR      L65F6               ; (-00eH)

L6604:      POP     DE
            PUSH    BC
            CALL    L6661
            POP     BC
            PUSH    DE
            LD      A,(DE)
            CP      02EH
            JR      NZ,L6622            ; (+012H)
            LD      DE,L84A5
            DEC     DE
            LD      A,(DE)
            CP      031H
            POP     DE
            PUSH    DE
            JR      NZ,L663E            ; (+023H)
            EX      DE,HL
            INC     HL
            LD      (HL),031H
            DEC     HL
            JR      L663C               ; (+01aH)

L6622:      LD      A,(DE)
            CP      031H
            JR      NZ,L663E            ; (+017H)
            EX      DE,HL
            INC     HL
            LD      A,(HL)
            DEC     HL
            CP      02EH
            LD      A,030H
            JR      Z,L6633             ; (+002H)
            LD      A,020H
L6633:      LD      (HL),A
L6634:      INC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L6634             ; (-006H)
            LD      (HL),031H
L663C:      EX      DE,HL
            INC     B
L663E:      LD      A,(DE)
            INC     DE
            OR      A
            JR      NZ,L663E            ; (-005H)
            DEC     DE
            JP      L615A

L6647:      PUSH    DE
            CALL    L6661
            POP     AF
            OR      A
            RET     NZ
            PUSH    HL
            LD      HL,L84A5
            DEC     HL
            LD      A,030H
            CP      (HL)
L6656:      JP      NZ,04AE9H
            DEC     HL
            LD      A,020H
            CP      (HL)
            JR      NZ,L6656            ; (-009H)
            POP     HL
            RET     

L6661:      PUSH    DE
            CALL    L61AB
            JP      C,04AE9H
            POP     HL
            PUSH    HL
            LD      H,000H
            INC     L
            JR      Z,L6670             ; (+001H)
            DEC     L
L6670:      LD      DE,L84A6
            ADD     HL,DE
            LD      A,(HL)
            LD      (HL),000H
            LD      DE,L3036
            CP      035H
            JR      C,L668D             ; (+00fH)
L667E:      DEC     HL
            LD      A,(HL)
            CP      02EH
            JR      Z,L667E             ; (-006H)
            INC     A
            JP      Z,04AE9H
            LD      (HL),A
            CP      03AH
            JR      Z,06678H             ; (-015H)
L668D:      LD      HL,L11A3
            LD      DE,L2000
L6693:      LD      (HL),D
            INC     HL
            DEC     E
            JR      NZ,L6693            ; (-005H)
            POP     HL
            PUSH    HL
            LD      E,H
            LD      D,000H
            LD      HL,L11A4
            ADD     HL,DE
            PUSH    HL
            LD      HL,L849C
            LD      (HL),020H
            INC     HL
            LD      D,007H
L66AA:      LD      A,(HL)
            CP      030H
            JR      NZ,L66B5            ; (+006H)
            LD      (HL),020H
            INC     HL
            DEC     D
            JR      NZ,L66AA            ; (-00bH)
L66B5:      POP     HL
            PUSH    HL
            LD      B,E
            LD      A,B
            OR      A
            JR      Z,L66D3             ; (+017H)
            LD      DE,L84A5
L66BF:      DEC     HL
            DEC     DE
            LD      A,(DE)
            LD      (HL),A
            CP      020H
            JR      Z,L66D3             ; (+00cH)
            DJNZ    L66BF               ; (-00aH)
            DEC     DE
            LD      A,(DE)
            CP      020H
            JR      Z,L66D3             ; (+004H)
            INC     A
            JP      NZ,04AE9H
L66D3:      POP     HL
            POP     DE
            INC     E
            JR      Z,L66E7             ; (+00fH)
            LD      B,E
            LD      DE,L84A6
            LD      (HL),02EH
L66DE:      INC     HL
            DEC     B
            JR      Z,L66E7             ; (+005H)
            LD      A,(DE)
            INC     DE
            LD      (HL),A
            JR      L66DE               ; (-009H)

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

L66ED:      PUSH    DE
            PUSH    BC
            LD      C,000H
            DEC     DE
L66F2:      INC     DE
L66F3:      CALL    L6873
            OR      A
            JR      Z,L672A             ; (+031H)
            CP      0FFH
            JR      Z,L672E             ; (+031H)
            CP      060H
            JP      NC,L4AE6
            CP      020H
            JR      C,L66F2             ; (-014H)
            LD      IX,L66F3
            PUSH    IX
            CP      022H
            JR      Z,L6749             ; (+039H)
            CP      027H
            JR      Z,L673C             ; (+028H)
            CP      03FH
            JR      Z,L6735             ; (+01dH)
            CP      02EH
            JP      Z,L6896
            CP      024H
            JP      Z,L68B0
            CALL    L5EC2
            JR      C,L6771             ; (+04aH)
            JP      L687D

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

L672E:      LD      (HL),LSE4
            CALL    L6755
            JR      L66F3               ; (-042H)

L6735:      LD      A,08FH
            CALL    L6754
            JR      L67AC               ; (+070H)

L673C:      LD      (HL),03AH
            CALL    L6755
            LD      (HL),027H
            CALL    L6756
            JP      L6813

L6749:      LD      (HL),A
            CALL    L6755
L674D:      LD      A,(DE)
            OR      A
            RET     Z
            CP      022H
            JR      NZ,L6749            ; (-00bH)
L6754:      LD      (HL),A
L6755:      INC     DE
L6756:      INC     HL
L6757:      INC     C
            RET     NZ
            JP      04AFBH

L675C:      POP     BC
            LD      A,(DE)
            CALL    L5EC9
            JR      C,L6754             ; (-00fH)
L6763:      CALL    L6754
            LD      A,(DE)
            CP      024H
            JR      Z,L6754             ; (-017H)
            CALL    L5EC2
            RET     C
            JR      L6763               ; (-00eH)

L6771:      PUSH    BC
            LD      BC,L4167
            CALL    L6822
            JR      NC,L67A8            ; (+02eH)
            LD      BC,L42FE
            CALL    L6822
            LD      C,0FEH
            JR      NC,L678E            ; (+00aH)
            LD      BC,L4356
            CALL    L6822
            LD      C,0FFH
            JR      C,L675C             ; (-032H)
L678E:      LD      (HL),C
            INC     HL
            LD      (HL),A
            POP     BC
            CALL    L6757
            CALL    L6756
            CP      0B4H
            RET     NZ
            CALL    L6873
            CP      03DH
            RET     NZ
            LD      (HL),QDPC
            CALL    L6755
            JR      L67E8               ; (+040H)

L67A8:      POP     BC
            CALL    L6756
L67AC:      CP      097H
            JR      Z,L6813             ; (+063H)
            CP      094H
            JR      Z,L6813             ; (+05fH)
            CP      0C2H
            JR      Z,L6809             ; (+051H)
            CP      LSE2
            JR      Z,L67E8             ; (+02cH)
            CP      LSE0
            RET     NC
            PUSH    AF
            CALL    L6873
            CP      02FH
            JR      NZ,L67D4            ; (+00dH)
            LD      (HL),FDPD
            CALL    L6755
            CALL    L6A15
            CALL    L6754
            JR      L67E4               ; (+010H)

L67D4:      CP      023H
            JR      NZ,L67E4            ; (+00cH)
            CALL    L6754
            CALL    L6A15
            CALL    L5EC2
            CALL    NC,L687D
L67E4:      POP     AF
            CP      08DH
            RET     NC
L67E8:      CALL    L6873
            CP      022H
            JR      NZ,L67F4            ; (+005H)
            CALL    L6749
            JR      L67E8               ; (-00cH)

L67F4:      CP      02CH
            RET     C
            CP      02FH
            JR      C,L6804             ; (+009H)
            CALL    L5EC2
            RET     C
            CALL    L68A7
            JR      L67E8               ; (-01cH)

L6804:      CALL    L6754
            JR      L67E8               ; (-021H)

L6809:      DB      02BH
            LD      (HL),03AH
            INC     HL
            LD      (HL),A
            CALL    L6756
            JR      L67E8               ; (-02bH)

L6813:      LD      A,(DE)
            CALL    L414D
            RET     Z
            CALL    L6754
            CP      022H
            CALL    Z,L674D
            JR      L6813               ; (-00fH)

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

L6834:      CP      02EH
            JR      NZ,L6841            ; (+009H)
            INC     HL
            DEC     DE
            LD      A,(DE)
            INC     DE
            CALL    L5EC9
            JR      NC,L6860            ; (+01fH)
L6841:      LD      A,(DE)
            CP      020H
            JR      NZ,L6852            ; (+00cH)
            LD      A,(HL)
            AND     07FH
            SUB     041H
            CP      01AH
            JR      C,L6860             ; (+011H)
            CALL    L6A14
L6852:      LD      C,(HL)
            INC     HL
            INC     DE
            CP      02EH
            JR      Z,L6868             ; (+00fH)
            SUB     C
            JR      Z,L6841             ; (-01bH)
            CP      080H
            JR      Z,L686E             ; (+00eH)
L6860:      DEC     HL
L6861:      BIT     7,(HL)
            INC     HL
            JR      Z,L6861             ; (-005H)
            JR      L6828               ; (-040H)

L6868:      LD      A,B
            CP      0E8H
            JR      NC,L6860            ; (-00dH)
            CCF     
L686E:      POP     HL
            POP     HL
            LD      (HL),B
            LD      A,B
            RET     

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

L687D:      EX      AF,AF'
            PUSH    DE
            CALL    L6A14
            POP     DE
            CALL    L5EC2
            JR      NC,L6896            ; (+00eH)
            CP      02EH
            JR      Z,L6896             ; (+00aH)
            CP      045H
            JR      Z,L6896             ; (+006H)
            EX      AF,AF'
            SUB     02FH
            JP      L6896

L6896:      PUSH    BC
            LD      (HL),015H
            INC     HL
            PUSH    HL
            CALL    L5EDA
            POP     HL
            LD      BC,00005H
            ADD     HL,BC
            LD      A,006H
            JR      L68CA               ; (+023H)

L68A7:      PUSH    BC
            CALL    L6A09
            LD      (HL),00BH
            INC     HL
            JR      L68C4               ; (+014H)

L68B0:      LD      (HL),A
            INC     DE
            LD      A,(DE)
            RST     018H
            DB      015H
            JP      C,L6756
            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
L68C4:      LD      A,003H
            LD      (HL),C
            INC     HL
            LD      (HL),B
            INC     HL
L68CA:      POP     BC
            ADD     A,C
            JP      C,04AFBH
            LD      C,A
L68D0:      DEC     DE
            LD      A,(DE)
            CP      020H
            JR      Z,L68D0             ; (-006H)
            INC     DE
            RET     

L68D8:      PUSH    HL
            PUSH    DE
            PUSH    BC
            EXX     
            LD      B,000H
            EXX     
            LD      C,000H
L68E1:      LD      A,(HL)
            OR      A
            JR      Z,L6915             ; (+030H)
            LD      BC,L68E1
            PUSH    BC
            CP      027H
            JR      Z,L692F             ; (+042H)
            INC     HL
            LD      BC,L4167
            CP      020H
            JR      C,L6957             ; (+062H)
            CP      022H
            JR      Z,L6940             ; (+047H)
            CP      03AH
            JR      Z,L694D             ; (+050H)
            CP      097H
            JR      Z,L692B             ; (+02aH)
            CP      094H
            JR      Z,L692B             ; (+026H)
            CP      LSE4
            JR      Z,L691A             ; (+011H)
            CP      0FEH
            JR      NC,L691F            ; (+012H)
            CP      080H
            JP      NC,L699B
            JP      L69B8

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

L691A:      LD      A,0FFH
            JP      L69B8

L691F:      LD      BC,L4356
            JR      NZ,L6927            ; (+003H)
            LD      BC,L42FE
L6927:      LD      A,(HL)
            INC     HL
            JR      L699B               ; (+070H)

L692B:      CALL    L699B
            RET     Z
L692F:      LD      A,(HL)
            CALL    L414D
            RET     Z
            CALL    L69B8
            LD      A,(HL)
            INC     HL
            CP      022H
            CALL    Z,L6943
            JR      L692F               ; (-011H)

L6940:      CALL    L69B8
L6943:      LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            CP      022H
            JR      NZ,L6940            ; (-00bH)
            JR      L69B8               ; (+06bH)

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

L6957:      CP      015H
            JR      Z,L698B             ; (+030H)
            CP      00BH
            JR      NC,L6964            ; (+005H)
            DEC     A
            OR      030H
            JR      L69B8               ; (+054H)

L6964:      PUSH    DE
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            PUSH    HL
            CP      012H
            JR      Z,L697A             ; (+00cH)
            CP      00CH
            JR      C,L697A             ; (+008H)
            JR      NZ,L69C7            ; (+053H)
            EX      DE,HL
            INC     HL
            INC     HL
            LD      E,(HL)
            INC     HL
            LD      D,(HL)
L697A:      EX      DE,HL
            CALL    L5E64
            LD      B,D
            LD      C,E
            POP     HL
            POP     DE
L6982:      LD      A,(BC)
            OR      A
            RET     Z
            CALL    L69B8
            INC     BC
            JR      L6982               ; (-009H)

L698B:      PUSH    HL
            PUSH    DE
            CALL    L6219
            LD      B,D
            LD      C,E
            POP     DE
            POP     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            JR      L6982               ; (-019H)

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

L69A9:      LD      A,(BC)
            BIT     7,A
            JR      NZ,L69B6            ; (+008H)
            CP      02EH
            CALL    NZ,L69B8
            INC     BC
            JR      L69A9               ; (-00dH)

L69B6:      AND     07FH
L69B8:      LD      (DE),A
            OR      A
            RET     Z
L69BB:      INC     DE
            EXX     
            INC     B
            EXX     
            RET     NZ
            XOR     A
            LD      (DE),A
            DEC     DE
            EXX     
            DEC     B
            EXX     
            RET     

L69C7:      LD      A,024H
            EX      AF,AF'
            EX      DE,HL
            CALL    L69D8
            LD      B,D
            LD      C,E
            POP     HL
            POP     DE
            EX      AF,AF'
            CALL    L69B8
            JR      L6982               ; (-056H)

L69D8:      LD      DE,L84A1
            PUSH    DE
            LD      A,H
            CALL    L69F1
            LD      A,L
            CALL    L69F1
            XOR     A
            LD      (DE),A
            POP     DE
            LD      B,003H
L69E9:      LD      A,(DE)
            CP      030H
            RET     NZ
            INC     DE
            DJNZ    L69E9               ; (-007H)
            RET     

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

L6A09:      PUSH    HL
            EX      DE,HL
            RST     018H
            DB      013H
            LD      B,D
            LD      C,E
            EX      DE,HL
            POP     HL
            JP      L68D0

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

L6A1B:      LD      C,(HL)
L6A1C:      CALL    L6A24
            XOR     A
            LD      (L1095),A
            RET     

L6A24:      LD      A,(L004D)
            OR      A
            JP      NZ,L4B36
            CALL    TEST1
            DB      047H
            JR      Z,L6A74             ; (+043H)
            CALL    TESTX
            DB      054H
            LD      A,001H
            LD      (L1097),A
            CALL    TEST1
            DB      04EH
            JR      Z,L6A4A             ; (+00aH)
            CALL    TEST1
            DB      04CH
            JR      Z,L6A4A             ; (+004H)
            CALL    TESTX
            DB      053H
L6A4A:      LD      (L6A1B),A
            CALL    L5E46
            CALL    L6A6C
L6A53:      LD      A,001H
            RST     018H
            DB      006H
            LD      A,(L6A1B)
            CP      04EH
            RET     Z
            CP      04CH
            LD      A,00BH
            JR      Z,L6A69             ; (+006H)
            LD      A,009H
            RST     018H
            DB      006H
            RST     018H
            DB      006H
L6A69:      RST     018H
            DB      006H
            RET     

L6A6C:      LD      A,00AH
            RST     018H
            DB      006H
            LD      A,003H
            JR      L6A69               ; (-00bH)

L6A74:      INC     HL
            CALL    L5E46
            LD      A,002H
            LD      (L1097),A
            JR      L6A69               ; (-016H)

L6A7F:      CALL    L6ABE
            CALL    L6E57
            LD      A,E
            OR      A
            RET     Z
            CP      0ECH
            JR      NC,L6A91            ; (+005H)
            CP      015H
            JP      NC,04AECH
L6A91:      CALL    L5E46
            BIT     7,E
            JR      NZ,L6AA0            ; (+008H)
L6A98:      LD      A,00AH
            RST     018H
            DB      006H
            DEC     E
            JR      NZ,L6A98            ; (-007H)
            RET     

L6AA0:      LD      A,003H
            RST     018H
            DB      006H
            INC     E
            JR      NZ,L6AA0            ; (-007H)
            RET     

L6AA8:      PUSH    HL
            LD      HL,L03E7
            JR      L6AB2               ; (+004H)

L6AAE:      PUSH    HL
            LD      HL,L01E0
L6AB2:      PUSH    HL
            ADD     HL,DE
            POP     HL
            JR      C,L6ABC             ; (+005H)
            SBC     HL,DE
            JP      C,04AECH
L6ABC:      POP     HL
            RET     

L6ABE:      LD      B,001H
            JR      L6AC4               ; (+002H)

L6AC2:      LD      B,002H
L6AC4:      LD      A,(L1097)
            CP      B
            RET     Z
            JP      L4B36

L6ACC:      LD      C,044H
            LD      DE,04A0EH
            LD      DE,04D0EH
            LD      DE,0520EH
            CALL    L6AC2
            LD      A,C
            LD      (06B1EH),A
            CP      04DH
            JR      NC,L6B04            ; (+022H)
            CALL    TEST1
            DB      025H
            JR      NZ,L6B04            ; (+01cH)
            CALL    L6E43
            LD      A,E
            DEC     A
            CP      010H
            JP      NC,04AECH
            DEC     DE
            LD      A,04CH
            RST     018H
            DB      006H
            CALL    L6DDA
            CALL    L6B60
            CALL    L414A
            RET     Z
            CALL    L5E71
L6B04:      CALL    L6E57
            CALL    L5E71
            CALL    L6AAE
            PUSH    DE
            CALL    L6E57
            CP      02CH
            JR      Z,L6B18             ; (+003H)
            CALL    L5E46
L6B18:      CALL    L6AA8
            POP     BC
            PUSH    DE
            LD      A,000H
            RST     018H
            DB      006H
            LD      E,C
            LD      D,B
            CALL    L6DDA
            CALL    L6B64
            POP     DE
            CALL    L6DDA
            CALL    L6B60
            CALL    L414A
            RET     Z
            INC     HL
            JR      L6B04               ; (-033H)

L6B37:      CALL    L6E43
            LD      A,E
            CP      004H
            JP      NC,04AECH
            CALL    L5E46
            LD      A,(L1097)
            CP      002H
            JR      Z,L6B57             ; (+00dH)
            CALL    L6A6C
            LD      A,002H
            RST     018H
            DB      006H
            CALL    L6B57
            JP      L6A53

L6B57:      LD      A,043H
            RST     018H
            DB      006H
            LD      A,E
            OR      030H
            RST     018H
            DB      006H
L6B60:      LD      A,00DH
            JR      L6B66               ; (+002H)

L6B64:      LD      A,02CH
L6B66:      RST     018H
            DB      006H
            RET     

L6B69:      CALL    L6AC2
            CALL    L5E46
            LD      A,048H
            JR      L6B66               ; (-00dH)

L6B73:      CALL    L6AC2
            CALL    L5E46
            LD      A,049H
            JR      L6B66               ; (-017H)

L6B7D:      CALL    L6AC2
            CALL    TEST1
            DB      05BH
            JR      NZ,L6BBE            ; (+038H)
            CALL    L6E43
            CP      040H
            JP      NC,04AECH
            PUSH    DE
            CALL    L5E6E
            CALL    L6E43
            CP      004H
            JP      NC,04AECH
            PUSH    DE
            CALL    TESTX
            DB      05DH
            POP     BC
            POP     DE
            PUSH    BC
            LD      A,053H
            RST     018H
            DB      006H
            CALL    L6DDA
            CALL    L6B64
            POP     DE
            LD      A,051H
            RST     018H
            DB      006H
            CALL    L6DDA
            CALL    L6B60
            CALL    L414A
            RET     Z
            CALL    L5E71
L6BBE:      CALL    L6E67
            CALL    L414A
            JR      Z,L6BCA             ; (+004H)
            CALL    L5E71
            DEC     HL
L6BCA:      LD      A,B
            OR      A
            JR      Z,L6BDB             ; (+00dH)
            LD      A,050H
            RST     018H
            DB      006H
L6BD2:      LD      A,(DE)
            RST     018H
            DB      006H
            INC     DE
            DJNZ    L6BD2               ; (-006H)
            CALL    L6B60
L6BDB:      CALL    L414A
            RET     Z
            INC     HL
            JR      L6BBE               ; (-024H)

L6BE2:      CALL    L6AC2
            CALL    L6E43
            CP      002H
            JP      NC,04AECH
            PUSH    AF
            CALL    L5E6E
            CALL    L6E57
            PUSH    DE
            CALL    L5E71
            CALL    L6E43
            OR      A
            JP      Z,04AECH
            CALL    L5E46
            LD      A,058H
            RST     018H
            DB      006H
            POP     BC
            POP     AF
            PUSH    DE
            PUSH    BC
            OR      030H
            RST     018H
            DB      006H
            CALL    L6B64
            POP     DE
            CALL    L6AA8
            CALL    L6DDA
            CALL    L6B64
            POP     DE
            CALL    L6DDA
            JP      L6B60

L6C22:      CALL    L6AC2
            PUSH    HL
            LD      DE,L0000
            LD      HL,L6DBC
            CALL    L5E97
            LD      DE,L0168
            LD      HL,L6DC1
            CALL    L5E97
            LD      HL,L610B
            LD      DE,L6DC6
            CALL    L5E91
            POP     HL
            CALL    L6E82
            CALL    L5E71
            PUSH    HL
            LD      HL,L6DAD
            EX      DE,HL
            CALL    L5E91
            POP     HL
            CALL    L6E82
            CALL    L5E71
            PUSH    HL
            LD      HL,L6DB2
            EX      DE,HL
            CALL    L5E91
            POP     HL
            CALL    L6E82
            PUSH    HL
            PUSH    AF
            LD      HL,L6DB7
            EX      DE,HL
            CALL    L5E91
            LD      A,(06DB8H)
            RLCA    
            JP      C,04AECH
            POP     AF
            CP      02CH
            JR      NZ,L6CB2            ; (+03aH)
            POP     HL
            INC     HL
            CALL    L6E82
            PUSH    HL
            PUSH    AF
            LD      HL,L6DBC
            EX      DE,HL
            CALL    L5E91
            POP     AF
            CP      02CH
            JR      NZ,L6CB2            ; (+027H)
            POP     HL
            INC     HL
            CALL    L6E82
            PUSH    HL
            PUSH    AF
            LD      HL,L6DC1
            EX      DE,HL
            CALL    L5E91
            POP     AF
            CP      02CH
            JR      NZ,L6CB2            ; (+014H)
            POP     HL
            INC     HL
            CALL    L6E82
            PUSH    HL
            LD      HL,L6DC6
            EX      DE,HL
            CALL    L5E91
            LD      A,(06DC7H)
            RLCA    
            JP      C,04AECH
L6CB2:      POP     HL
            CALL    L5E46
            PUSH    HL
            LD      HL,L6DC1
            LD      DE,L6DBC
            LD      A,(L6DC6)
            OR      A
            CALL    NZ,L7A15
            JP      C,04AECH
            CALL    L6D63
            LD      HL,L6DCB
            LD      (06D3BH),HL
            LD      HL,L6DD0
            LD      (06D46H),HL
            CALL    06D37H
            LD      A,(L6DC6)
            OR      A
            JR      Z,L6D11             ; (+032H)
L6CDF:      LD      HL,L6DBC
            LD      DE,L6DC6
            CALL    L797E
            LD      DE,L6DC1
            CALL    L7A15
            JR      NC,L6CFC            ; (+00cH)
            CALL    L6D63
            CALL    L6D34
            RST     018H
            DB      00EH
            JR      NZ,L6CDF            ; (-01bH)
            POP     HL
            RET     

L6CFC:      CALL    L6D04
            CALL    L6D34
            POP     HL
            RET     

L6D04:      LD      HL,L6DC1
            LD      DE,L6DBC
            LD      BC,00005H
            LDIR    
            JR      L6D63               ; (+052H)

L6D11:      LD      HL,L6DAD
            LD      (06D3BH),HL
            LD      HL,L6DB2
            LD      (06D46H),HL
            CALL    L6D34
            CALL    L6D04
            LD      HL,L6DCB
            LD      (06D3BH),HL
            LD      HL,L6DD0
            LD      (06D46H),HL
            CALL    L6D34
            POP     HL
            RET     

L6D34:      LD      A,044H
            LD      HL,L4D3E
            PUSH    AF
            LD      HL,L6DAD
            CALL    L60B5
            PUSH    HL
            EX      DE,HL
            CALL    L6AA8
            LD      HL,L6DB2
            CALL    L60B5
            PUSH    HL
            EX      DE,HL
            CALL    L6AA8
            POP     HL
            POP     DE
            POP     AF
            RST     018H
            DB      006H
            PUSH    HL
            CALL    L6DDA
            CALL    L6B64
            POP     DE
            CALL    L6DDA
            JP      L6B60

L6D63:      LD      DE,(INTFAC)
            LD      HL,L6DBC
            CALL    L5E91
            LD      HL,(L107C)
            CALL    L8175
            CALL    L7FBB
            LD      DE,L6DB7
            CALL    L7BAC
            LD      DE,L6DAD
            CALL    L797E
            LD      DE,L6DCB
            CALL    L5E91
            LD      DE,(INTFAC)
            LD      HL,L6DBC
            CALL    L5E91
            LD      HL,(L107C)
            CALL    L8175
            CALL    L7FCB
            LD      DE,L6DB7
            CALL    L7BAC
            LD      DE,L6DB2
            CALL    L797E
            LD      DE,L6DD0
            JP      L5E91

L6DAD:      DS      5, 000H
L6DB2:      DS      5, 000H
L6DB7:      DS      5, 000H
L6DBC:      DS      5, 000H
L6DC1:      DS      5, 000H
L6DC6:      DS      5, 000H
L6DCB:      DS      5, 000H
L6DD0:      DS      10, 000H
L6DDA:      PUSH    AF
            PUSH    HL
            LD      HL,(L107C)
            CALL    L5E97
            CALL    L6026
            RST     018H
            DB      017H
L6DE7:      LD      A,(DE)
            RST     018H
            DB      006H
            INC     DE
            DJNZ    L6DE7               ; (-006H)
            POP     HL
            POP     AF
            RET     

L6DF0:      CALL    L6ABE
            CALL    L5E46
            LD      A,004H
            RST     018H
            DB      006H
            RET     

L6DFB:      CALL    L6ABE
            CALL    L6E57
            LD      A,E
            OR      A
            JP      Z,04AECH
            CP      049H
            JP      NC,04AECH
            CALL    L5E46
            LD      A,009H
            RST     018H
            DB      006H
            RST     018H
            DB      006H
            CALL    L6DDA
            JP      L6B60

L6E1A:      CP      09DH
            JR      Z,L6E29             ; (+00bH)
            CP      0A1H
            JP      NZ,L4AE6
            XOR     A
L6E24:      LD      (L004D),A
            INC     HL
            RET     

L6E29:      CALL    L6ABE
            LD      A,(L6A1B)
            CP      04EH
            JP      NZ,L4B36
            LD      A,(L004D)
            OR      A
            JR      NZ,L6E24            ; (-016H)
            CALL    L527B
            LD      A,016H
            RST     018H
            DB      003H
            JR      L6E24               ; (-01fH)

L6E43:      CALL    L6E57
L6E46:      LD      A,D
            OR      A
            JP      NZ,04AECH
            LD      A,E
            RET     

L6E4D:      CALL    L6E94
            DEC     DE
            DEC     DE
            DEC     DE
            DEC     DE
            DEC     DE
            JR      L6E5A               ; (+003H)

L6E57:      CALL    L6E82
L6E5A:      PUSH    AF
            PUSH    HL
            EX      DE,HL
            CALL    L7918
            CALL    L60B5
            EX      DE,HL
            POP     HL
            POP     AF
            RET     

L6E67:      CALL    L6E82
            PUSH    AF
            CALL    L790F
            PUSH    HL
            EX      DE,HL
            CALL    L6E76
            POP     HL
            POP     AF
            RET     

L6E76:      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     

L6E82:      LD      DE,(VARED)
            LD      (TMPEND),DE
L6E8A:      LD      DE,(INTFAC)
            PUSH    DE
            CALL    L6E94
            POP     DE
            RET     

L6E94:      PUSH    DE
            LD      DE,(TMPEND)
            CALL    L74E1
            POP     DE
            CALL    L6EB8
L6EA0:      CP      EM_P0
            RET     NZ
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            CALL    L6EB8
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    07E5EH
            POP     HL
            POP     AF
            JR      L6EA0               ; (-018H)

L6EB8:      CALL    L6ED3
L6EBB:      CP      EM_P1
            RET     NZ
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            CALL    L6ED3
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    07E5BH
            POP     HL
            POP     AF
            JR      L6EBB               ; (-018H)

L6ED3:      CALL    L6EEE
L6ED6:      CP      0ECH
            RET     NZ
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            CALL    L6EEE
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7E58
            POP     HL
            POP     AF
            JR      L6ED6               ; (-018H)

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

L6F03:      CALL    L6F6D
L6F06:      CP      0EEH
            RET     C
            PUSH    AF
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            CALL    L6F6D
            POP     BC
            EX      (SP),HL
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7A15
            EX      AF,AF'
            POP     AF
            CP      0F6H
            JR      NZ,L6F40            ; (+01eH)
            EX      AF,AF'
            JR      C,L6F3B             ; (+016H)
L6F25:      LD      BC,L0000
L6F28:      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      (L84C7),A
            POP     AF
            POP     HL
            JR      L6F06               ; (-035H)

L6F3B:      LD      BC,08081H
            JR      L6F28               ; (-018H)

L6F40:      CP      QDPD
            JR      NZ,L6F4B            ; (+007H)
            EX      AF,AF'
            JR      Z,L6F25             ; (-022H)
            JR      C,L6F25             ; (-024H)
            JR      L6F3B               ; (-010H)

L6F4B:      CP      QDPC
            JR      NZ,L6F54            ; (+005H)
            EX      AF,AF'
            JR      Z,L6F3B             ; (-017H)
            JR      L6F25               ; (-02fH)

L6F54:      CP      QDPA
            JR      C,L6F5D             ; (+005H)
            EX      AF,AF'
            JR      NC,L6F3B            ; (-020H)
            JR      L6F25               ; (-038H)

L6F5D:      CP      LSPAL
            JR      C,L6F68             ; (+007H)
            EX      AF,AF'
            JR      Z,L6F3B             ; (-029H)
            JR      C,L6F3B             ; (-02bH)
            JR      L6F25               ; (-043H)

L6F68:      EX      AF,AF'
            JR      Z,L6F25             ; (-046H)
            JR      L6F3B               ; (-032H)

L6F6D:      CALL    L6F98
L6F70:      CP      0F7H
            RET     C
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            JR      Z,L6F8A             ; (+010H)
            CALL    L6F98
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7975
L6F86:      POP     HL
            POP     AF
            JR      L6F70               ; (-01aH)

L6F8A:      CALL    L6F98
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L797E
            JR      L6F86               ; (-012H)

L6F98:      CALL    L6FC3
L6F9B:      CP      FDPB
            RET     C
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            JR      Z,L6FB5             ; (+010H)
            CALL    L6FC3
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7EB4
L6FB1:      POP     HL
            POP     AF
            JR      L6F9B               ; (-01aH)

L6FB5:      CALL    L6FC3
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7ED3
            JR      L6FB1               ; (-012H)

L6FC3:      CALL    L6FEE
L6FC6:      CP      FDPD
            RET     C
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            JR      Z,L6FE0             ; (+010H)
            CALL    L6FEE
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7BAC
L6FDC:      POP     HL
            POP     AF
            JR      L6FC6               ; (-01aH)

L6FE0:      CALL    L6FEE
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7C97
            JR      L6FDC               ; (-012H)

L6FEE:      CALL    TEST1
            DB      0F7H
            JR      Z,L6FEE             ; (-006H)
            CP      FDPA
            JR      NZ,L6FFE            ; (+006H)
            INC     HL
            CALL    L6FFE
            JR      L7027               ; (+029H)

L6FFE:      CALL    L7033
L7001:      CP      0FDH
            RET     NZ
            LD      A,(L84C7)
            PUSH    AF
            INC     HL
            CALL    L7019
            POP     BC
            PUSH    AF
            PUSH    HL
            CALL    L74BE
            CALL    L7DCC
            POP     HL
            POP     AF
            JR      L7001               ; (-018H)

L7019:      CALL    TEST1
            DB      0F7H
            JR      Z,L7019             ; (-006H)
            CP      FDPA
            JR      NZ,L7033            ; (+010H)
            INC     HL
            CALL    L7033
L7027:      PUSH    AF
            PUSH    HL
            LD      HL,0FFFBH
            ADD     HL,DE
            CALL    L7968
            POP     HL
            POP     AF
            RET     

L7033:      CALL    L414A
            JP      Z,L4AE6
            CALL    L703F
            JP      HLFTCH

L703F:      PUSH    HL
            LD      HL,(L107E)
            SCF     
            SBC     HL,DE
            JP      C,04AF5H
            POP     HL
            CP      LSE4
            JR      Z,L705C             ; (+00eH)
            CP      020H
            JR      NC,L709C            ; (+04aH)
L7052:      INC     HL
            CP      015H
            JR      C,L706B             ; (+014H)
            CALL    L5E91
            JR      L7065               ; (+009H)

L705C:      INC     HL
            PUSH    HL
            LD      HL,08188H
            CALL    L5E91
            POP     HL
L7065:      LD      A,005H
L7067:      LD      (L84C7),A
            RET     

L706B:      CP      00BH
            JR      NC,L7078            ; (+009H)
            DEC     A
            JP      M,L4AE6
            LD      B,000H
            LD      C,A
            JR      L7089               ; (+011H)

L7078:      LD      C,(HL)
            INC     HL
            LD      B,(HL)
            INC     HL
            CP      00CH
            JR      NZ,L7089            ; (+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
L7089:      PUSH    HL
            PUSH    DE
            EX      DE,HL
            LD      E,C
            LD      D,B
            CALL    L5E97
            POP     DE
            POP     HL
            LD      A,005H
L7095:      INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            JR      L7067               ; (-035H)

L709C:      CP      022H
            JR      NZ,L70CF            ; (+02fH)
            INC     HL
            PUSH    HL
            CALL    L74C9
            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    L74D5
            LD      (L107A),HL
            POP     DE
            POP     HL
            LD      A,003H
            LD      (L84C7),A
            RET     

L70CF:      CP      028H
            JR      NZ,L70DA            ; (+007H)
            INC     HL
            CALL    L6E94
            JP      L5E80

L70DA:      OR      A
            JP      P,L76EE
            CP      0E7H
            INC     HL
            JR      NZ,L70E8            ; (+005H)
            LD      A,0A8H
            PUSH    AF
            JR      L711D               ; (+035H)

L70E8:      CP      0FFH
            JP      NZ,L4AE6
            LD      A,(HL)
            INC     HL
            CP      0A0H
            JP      Z,L71A0
            CP      0C8H
            JP      NC,L4AE6
            CP      0BAH
            JR      NC,L714D            ; (+050H)
            PUSH    AF
            CP      0B3H
            JR      NC,L713E            ; (+03cH)
            LD      B,003H
            CP      0AAH
            JR      Z,L711D             ; (+015H)
            CP      0ABH
            JR      NC,L711D            ; (+011H)
            LD      B,005H
            CP      088H
            JR      Z,L7138             ; (+026H)
            CP      089H
            JR      NZ,L711D            ; (+007H)
            CALL    TEST1
            DB      040H
            LD      (081A1H),A
L711D:      CALL    L5E76
L7120:      PUSH    BC
            CALL    L6E94
            CALL    L5E80
            POP     AF
            CALL    L790B
L712B:      POP     AF
            PUSH    DE
            PUSH    HL
            LD      HL,0FFFBH
            ADD     HL,DE
            CALL    L714D
            POP     HL
            POP     DE
            RET     

L7138:      CALL    TEST1
            DB      028H
            JR      Z,L7120             ; (-01eH)
L713E:      LD      A,005H
            LD      (L84C7),A
            PUSH    HL
            LD      HL,L6110
            CALL    L5E91
            POP     HL
            JR      L712B               ; (-022H)

L714D:      PUSH    HL
            ADD     A,A
            LD      L,A
            LD      H,000H
            LD      BC,L4512
            ADD     HL,BC
            LD      A,(HL)
            INC     HL
            LD      H,(HL)
            LD      L,A
            EX      (SP),HL
            RET     

            EX      DE,HL
            LD      HL,L0000
            ADD     HL,SP
            LD      BC,(TMPEND)
            OR      A
            SBC     HL,BC
            OR      A
            LD      BC,L0100
            SBC     HL,BC
            EX      DE,HL
            JR      L7181               ; (+010H)

            LD      A,(L0054)
            JR      L717E               ; (+008H)

            LD      A,(00055H)
            JR      L717E               ; (+003H)

            LD      A,(L847E)
L717E:      LD      E,A
            LD      D,000H
L7181:      LD      A,005H
            LD      (L84C7),A
            JP      L5E97

            LD      DE,(08480H)
            CALL    L5E97
            INC     HL
            BIT     7,(HL)
            DEC     HL
            RET     Z
            LD      DE,L719B
            JP      L797E

L719B:      SUB     C
            NOP     
            NOP     
            NOP     
            NOP     
L71A0:      CALL    L5E76
            LD      BC,(TMPEND)
            PUSH    BC
            XOR     A
            PUSH    AF
L71AA:      PUSH    BC
            PUSH    DE
            CALL    L6E4D
            CALL    L6E46
            POP     DE
            POP     BC
            LD      (BC),A
            INC     BC
            LD      (TMPEND),BC
            POP     AF
            INC     A
            PUSH    AF
            CALL    TEST1
            DB      02CH
            JR      Z,L71AA             ; (-019H)
            CALL    L5E80
            PUSH    BC
            EXX     
            POP     DE
            POP     AF
            LD      B,A
            POP     HL
            CALL    L74E1
L71CF:      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
L71E8:      EX      DE,HL
            LD      A,003H
            LD      (L84C7),A
            RET     

            PUSH    HL
            CALL    L60B5
            CALL    L69D8
            RST     018H
            DB      017H
L71F8:      LD      A,B
            OR      A
            JR      Z,L720C             ; (+010H)
            LD      HL,(L107A)
            PUSH    HL
            PUSH    BC
            CALL    L74D5
            POP     BC
            EX      DE,HL
            POP     HL
            EXX     
            POP     DE
            EXX     
            JR      L71CF               ; (-03dH)

L720C:      POP     HL
            CALL    L7960
            JR      L71E8               ; (-02aH)

            PUSH    HL
            CALL    L7223
            LD      B,A
            LD      C,A
            OR      A
            LD      A,020H
            PUSH    DE
            CALL    NZ,?SETDE
            POP     DE
            LD      B,C
            JR      L71F8               ; (-02bH)

L7223:      CALL    L60B5
            LD      DE,L11A4
            LD      A,H
            OR      A
            JP      NZ,04AECH
            LD      A,L
            RET     

            PUSH    HL
            CALL    L6026
            LD      A,(DE)
            CP      020H
            JR      NZ,L723A            ; (+001H)
            INC     DE
L723A:      RST     018H
            DB      017H
            JR      L71F8               ; (-046H)

            CALL    L5E76
            CALL    L5882
            LD      B,A
            CALL    L5E7D
            LD      A,B
            PUSH    HL
            PUSH    DE
            RST     018H
            DB      029H
            LD      DE,0FFFFH
            JR      C,L725A             ; (+008H)
            INC     HL
            BIT     7,(HL)
            JR      NZ,L725A            ; (+003H)
            LD      DE,L0000
L725A:      POP     HL
            CALL    L5E97
            LD      A,005H
            LD      (L84C7),A
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            INC     HL
            EX      DE,HL
            POP     HL
            RET     

            PUSH    HL
            CALL    L6E76
            OR      A
            JR      Z,L7273             ; (+001H)
            LD      A,(DE)
L7273:      JR      L7279               ; (+004H)

            PUSH    HL
            CALL    L6E76
L7279:      POP     HL
            JP      L717E

            PUSH    HL
            CALL    L6E76
            LD      HL,(L107A)
            PUSH    HL
            CALL    L74D5
            LD      (HL),000H
            POP     DE
            POP     HL
            JP      L5EDA

            CALL    L730B
            CALL    L5E80
            CALL    L7304
            EX      DE,HL
            LD      A,(HL)
            CP      C
            JR      NC,L729E            ; (+001H)
            LD      C,A
L729E:      LD      (HL),C
            LD      BC,00005H
L72A2:      LD      A,003H
            ADD     HL,BC
            EX      DE,HL
            LD      (L84C7),A
            JP      HLFTCH

            CALL    L730B
            CALL    L5E80
            CALL    L7304
            EX      DE,HL
            LD      A,(HL)
            SUB     C
            JR      NC,L72BC            ; (+002H)
            XOR     A
            LD      C,(HL)
L72BC:      LD      (HL),C
            INC     HL
            ADD     A,(HL)
            LD      (HL),A
            INC     HL
            JR      NC,L72C4            ; (+001H)
            INC     (HL)
L72C4:      LD      BC,L0003
            JR      L72A2               ; (-027H)

            CALL    L730B
            CALL    L7304
            OR      A
            JP      Z,04AECH
            PUSH    AF
            CALL    TEST1
            DB      029H
            LD      A,0FFH
            JR      Z,L72F0             ; (+014H)
            CALL    L5E6E
            PUSH    DE
            EX      DE,HL
            LD      BC,00005H
            ADD     HL,BC
            EX      DE,HL
            CALL    L6E4D
            CALL    L5E80
            CALL    L6E46
            POP     DE
L72F0:      POP     BC
            LD      C,A
            EX      DE,HL
            LD      A,(HL)
            SUB     B
            JR      C,L7300             ; (+009H)
            INC     A
            CP      C
            JR      NC,L72FC            ; (+001H)
            LD      C,A
L72FC:      LD      A,B
            DEC     A
            JR      L72BC               ; (-044H)

L7300:      XOR     A
            LD      C,A
            JR      L72BC               ; (-048H)

L7304:      LD      A,B
            OR      A
            JP      NZ,04AECH
            LD      A,C
            RET     

L730B:      CALL    L5E76
            PUSH    DE
            CALL    L6E94
            CALL    L5E71
            CALL    L790F
            CALL    L6E4D
            LD      C,E
            LD      B,D
            POP     DE
            RET     

            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,L7337             ; (+005H)
            INC     (HL)
            INC     HL
            INC     (HL)
            INC     (HL)
            DEC     HL
L7337:      EX      DE,HL
            LD      BC,L8CA0
            CALL    L73AE
            LD      BC,L0E10
            CALL    L73AE
            CP      03AH
            JR      C,L7352             ; (+00aH)
            SUB     00AH
            DEC     DE
            LD      (DE),A
            DEC     DE
            LD      A,(DE)
            INC     A
            LD      (DE),A
            INC     DE
            INC     DE
L7352:      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,L7370            ; (+011H)
            LD      A,C
            CP      034H
            JR      NZ,L7370            ; (+00cH)
            LD      HL,(L107A)
            LD      A,030H
            LD      B,006H
            CALL    ?SETHL
            JR      L7386               ; (+016H)

L7370:      LD      BC,L0258
            CALL    L73AE
            LD      BC,0003CH
            CALL    L73AE
            LD      BC,0000AH
            CALL    L73AE
            LD      A,030H
            ADD     A,L
            LD      (DE),A
L7386:      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      (L84C7),A
            JP      HLFTCH

L73AE:      OR      A
            SBC     HL,BC
            JR      C,L73B8             ; (+005H)
            LD      A,(DE)
            INC     A
            LD      (DE),A
            JR      L73AE               ; (-00aH)

L73B8:      ADD     HL,BC
            INC     DE
            RET     

L73BB:      CALL    TESTX
            DB      QDPC
            CALL    L6E67
            LD      A,B
            CP      006H
            JP      NZ,04AECH
            PUSH    HL
            PUSH    DE
            LD      HL,L0000
            CALL    L73FC
            CP      018H
            JP      NC,04AECH
            CP      00CH
            LD      A,000H
            JR      C,L73E4             ; (+009H)
            PUSH    DE
            LD      DE,L000C
            OR      A
            SBC     HL,DE
            POP     DE
            INC     A
L73E4:      PUSH    AF
            CALL    L73FC
            CP      03CH
            JP      NC,04AECH
            CALL    L73FC
            CP      03CH
            JP      NC,04AECH
            POP     AF
            EX      DE,HL
            RST     018H
            DB      026H
            POP     DE
            POP     HL
            RET     

L73FC:      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,04AECH
            CP      00AH
            JP      NC,04AECH
            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,04AECH
            CP      00AH
            JP      NC,04AECH
            ADD     A,C
            LD      C,A
L742A:      LD      B,000H
            ADD     HL,BC
            POP     BC
            RET     

L742F:      LD      DE,(VARED)
            LD      (TMPEND),DE
            LD      DE,(INTFAC)
L743B:      PUSH    DE
            CALL    L748E
L743F:      LD      A,(HL)
            CP      028H
            JP      Z,L74F4
            PUSH    HL
            CALL    L77AF
            JR      NC,L7451            ; (+006H)
            LD      A,C
            LD      C,L
            LD      B,H
            POP     HL
            POP     DE
            RET     

L7451:      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    L74E1
            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
L747D:      LD      A,(DE)
            LD      (HL),A
            INC     DE
            INC     HL
            DJNZ    L747D               ; (-006H)
            PUSH    HL
            LD      B,C
            CALL    ?CLRHL
            LD      (HL),A
            LD      A,C
            POP     BC
            POP     HL
            POP     DE
            RET     

L748E:      CALL    HLFTCH
            SUB     041H
            CP      01AH
            JP      NC,L4AE6
            LD      DE,L11A4
            LD      B,000H
L749D:      INC     DE
            LD      A,(HL)
            CALL    L5EC9
            JR      C,L74AF             ; (+00bH)
            LD      (DE),A
            INC     B
            LD      A,B
            CP      003H
            JR      C,L74AC             ; (+001H)
            DEC     B
L74AC:      INC     HL
            JR      L749D               ; (-012H)

L74AF:      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     

L74BE:      LD      HL,0FFFBH
            EX      DE,HL
            ADD     HL,DE
            EX      DE,HL
            ADD     HL,DE
            LD      A,B
            JP      L790B

L74C9:      LD      B,0FFH
L74CB:      INC     B
            LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            CP      022H
            RET     Z
            JR      L74CB               ; (-00aH)

L74D5:      LD      A,B
            OR      A
            RET     Z
            CALL    LDHLDE
            EX      DE,HL
            CALL    L74E1
            EX      DE,HL
            RET     

L74E1:      PUSH    HL
            LD      HL,0FE00H
            ADD     HL,SP
            SBC     HL,DE
            POP     HL
            RET     NC
            JP      L4B26

L74ED:      LD      DE,(INTFAC)
            PUSH    DE
            JR      L74FC               ; (+008H)

L74F4:      XOR     A
            LD      (L76ED),A
            INC     HL
            LD      (L76EB),HL
L74FC:      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    L74D5
            POP     DE
            LD      (L107A),HL
            LD      HL,(L1076)
            EX      DE,HL
            OR      A
            SBC     HL,DE
            EX      (SP),HL
            PUSH    HL
            EXX     
L751F:      POP     DE
            PUSH    DE
            PUSH    BC
            LD      BC,(076EBH)
            LD      A,(L76ED)
            PUSH    BC
            PUSH    AF
            LD      BC,(08495H)
            PUSH    BC
            CALL    L6E4D
            BIT     7,D
            JP      NZ,04AECH
            EX      AF,AF'
            POP     BC
            LD      (08495H),BC
            POP     AF
            LD      (L76ED),A
            POP     BC
            LD      (076EBH),BC
            EX      AF,AF'
            INC     HL
            CP      029H
            JR      Z,L7565             ; (+018H)
            CP      02CH
            JP      NZ,L4AE6
            POP     BC
            INC     B
            LD      A,B
            CP      004H
            JP      NC,04AECH
            EXX     
            POP     HL
            POP     DE
            EXX     
            PUSH    DE
            EXX     
            PUSH    DE
            PUSH    HL
            EXX     
            JR      L751F               ; (-046H)

L7565:      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    L77AF
            RES     7,C
            JR      NC,L75DA            ; (+056H)
            LD      A,B
            CP      (HL)
            JP      NZ,04AF8H
            INC     HL
            EX      DE,HL
            POP     HL
            LD      (L8495),HL
            EXX     
            LD      HL,L0000
            EXX     
            EX      DE,HL
L7595:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            INC     HL
            EX      (SP),HL
            PUSH    DE
            EXX     
            POP     DE
            CALL    L76C1
            EXX     
            PUSH    HL
            OR      A
            SBC     HL,DE
            JP      NC,04AECH
            EXX     
            POP     DE
            CALL    L76BD
            EXX     
            POP     HL
            DJNZ    L7595               ; (-01cH)
            PUSH    HL
            EXX     
            LD      A,C
            LD      D,B
            BIT     6,A
            JR      NZ,L75CD            ; (+014H)
            AND     00FH
            LD      E,A
            PUSH    AF
            CALL    L76C1
            PUSH    HL
            EXX     
            POP     BC
            POP     AF
            POP     HL
            ADD     HL,BC
            LD      C,L
            LD      B,H
L75C8:      LD      HL,(L8495)
            POP     DE
            RET     

L75CD:      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      L75C8               ; (-012H)

L75DA:      EXX     
            LD      A,(L76ED)
            OR      A
            JP      Z,04AECH
            POP     HL
            LD      (L8495),HL
            EXX     
            LD      DE,(TMPEND)
            LD      L,B
            LD      H,000H
            ADD     HL,HL
            ADD     HL,DE
            EX      DE,HL
            INC     DE
            CALL    L74E1
            LD      (HL),B
            INC     HL
            EXX     
            LD      HL,00001H
            EXX     
L75FC:      POP     DE
            LD      A,(L76ED)
            OR      A
            JR      NZ,L760F            ; (+00cH)
            PUSH    HL
            EX      DE,HL
            LD      DE,0000AH
            SCF     
            SBC     HL,DE
            JP      NC,04AECH
            POP     HL
L760F:      INC     DE
            LD      (HL),E
            INC     HL
            LD      (HL),D
            INC     HL
            PUSH    DE
            EXX     
            POP     DE
            CALL    L76C1
            EXX     
            DJNZ    L75FC               ; (-021H)
            DB      059H
            LD      D,000H
            PUSH    BC
            PUSH    DE
            EXX     
            POP     DE
            CALL    L76C1
            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,L7645             ; (+005H)
            ADD     HL,BC
            JR      C,L7645             ; (+002H)
            PUSH    HL
            ADD     HL,DE
L7645:      JP      C,L4B26
            EX      DE,HL
            CALL    L74E1
            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
L7689:      XOR     A
            LD      (HL),A
            INC     HL
            DEC     BC
            LD      A,B
            OR      C
            JR      NZ,L7689            ; (-008H)
            LD      (HL),A
            EXX     
            POP     DE
            LD      A,(L76ED)
            OR      A
            JR      Z,L769E             ; (+004H)
            LD      HL,(L8495)
            RET     

L769E:      LD      HL,(L76EB)
            PUSH    DE
            JP      L74FC

L76A5:      LD      A,0FFH
            LD      (L76ED),A
L76AA:      CALL    L748E
            LD      A,(HL)
            CALL    L5E79
            CALL    L74ED
            CALL    HLFTCH
            CP      02CH
            RET     NZ
            INC     HL
            JR      L76AA               ; (-013H)

L76BD:      ADD     HL,DE
            RET     NC
            JR      L76E8               ; (+027H)

L76C1:      PUSH    BC
            EX      DE,HL
            LD      C,L
            LD      A,H
            LD      HL,L0000
            CALL    L76D1
            LD      A,C
            CALL    L76D1
            POP     BC
            RET     

L76D1:      OR      A
            JR      Z,L76E2             ; (+00eH)
            LD      B,008H
L76D6:      ADD     HL,HL
            JR      C,L76E8             ; (+00fH)
            RLCA    
            JR      NC,L76DF            ; (+003H)
            ADD     HL,DE
            JR      C,L76E8             ; (+009H)
L76DF:      DJNZ    L76D6               ; (-00bH)
            RET     

L76E2:      LD      A,H
            LD      H,L
            LD      L,000H
            OR      A
            RET     Z
L76E8:      JP      04AECH

L76EB:      NOP     
            NOP     
L76ED:      NOP     
L76EE:      SUB     041H
            CP      01AH
            JP      NC,L4AE6
            LD      BC,(07921H)
            LD      A,B
            OR      C
            JR      NZ,L770F            ; (+012H)
            CALL    L743B
L7700:      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      L7095

L770F:      PUSH    DE
            CALL    L748E
            PUSH    HL
            INC     B
            LD      DE,L11A4
            LD      HL,(L107A)
            CALL    L74D5
            LD      B,000H
            LD      HL,(L7921)
            CALL    HLFTCH
            CP      QDPC
            JR      Z,L7759             ; (+02fH)
            CP      028H
            JR      NZ,L7756            ; (+028H)
L772E:      INC     HL
            INC     B
            PUSH    BC
            CALL    L748E
            LD      A,C
            POP     DE
            CP      E
            LD      C,E
            JR      NZ,L774B            ; (+011H)
            PUSH    DE
            LD      C,B
            INC     C
            PUSH    HL
            LD      HL,(L107A)
            LD      DE,L11A4
            CALL    L794C
            POP     HL
            POP     BC
            JR      Z,L776F             ; (+024H)
L774B:      CALL    HLFTCH
            CP      029H
            JR      Z,L7759             ; (+007H)
            CP      02CH
            JR      Z,L772E             ; (-028H)
L7756:      JP      L4AE6

L7759:      LD      HL,(L107A)
            LD      DE,L11A4
            LD      A,(HL)
            LD      (DE),A
            LD      B,A
L7762:      INC     HL
            INC     DE
            LD      A,(HL)
            LD      (DE),A
            DJNZ    L7762               ; (-006H)
            POP     HL
            POP     DE
            CALL    L77AB
            JR      L7700               ; (-06fH)

L776F:      LD      HL,(L7923)
            CALL    L5E76
            DEC     B
            JR      Z,L7790             ; (+018H)
            DEC     HL
L7779:      PUSH    BC
L777A:      CALL    L5198
            CALL    L414A
            JP      Z,L4AE6
            CP      029H
            JP      Z,L4AE6
            CP      02CH
            JR      NZ,L777A            ; (-012H)
            POP     BC
            DJNZ    L7779               ; (-016H)
            INC     HL
L7790:      EX      DE,HL
            POP     HL
            EX      (SP),HL
            EX      DE,HL
            LD      BC,(07921H)
            PUSH    BC
            LD      BC,L0000
            LD      (07921H),BC
            CALL    L6E94
            POP     HL
            LD      (L7921),HL
            POP     HL
            JP      HLFTCH

L77AB:      PUSH    DE
            JP      L743F

L77AF:      LD      HL,(L1074)
L77B2:      LD      DE,L11A4
            LD      A,(HL)
            OR      A
            RET     Z
            CP      040H
            JR      NC,L77E3            ; (+027H)
            CP      C
            JR      NZ,L77D8            ; (+019H)
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L77D6            ; (+012H)
            LD      B,A
L77C5:      INC     DE
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L77D0            ; (+005H)
            DJNZ    L77C5               ; (-008H)
            INC     HL
            SCF     
            RET     

L77D0:      INC     HL
            DJNZ    L77D0               ; (-003H)
            LD      A,C
            JR      L77DD               ; (+007H)

L77D6:      LD      A,C
            DEC     HL
L77D8:      AND     00FH
            INC     HL
            ADD     A,(HL)
            INC     HL
L77DD:      LD      E,A
            LD      D,000H
            ADD     HL,DE
            JR      L77B2               ; (-031H)

L77E3:      CP      C
            JR      Z,L77FA             ; (+014H)
            INC     HL
L77E7:      LD      E,(HL)
            INC     HL
            LD      D,(HL)
            DEC     HL
            ADD     HL,DE
            JR      L77B2               ; (-03cH)

L77EE:      LD      A,C
            SUB     B
            CPL     
            LD      C,A
            LD      B,0FFH
            ADD     HL,BC
            POP     BC
L77F6:      DEC     HL
            DEC     HL
            JR      L77E7               ; (-013H)

L77FA:      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,L77F6            ; (-018H)
            PUSH    BC
            LD      B,A
            LD      C,A
L7811:      INC     HL
            INC     DE
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L77EE            ; (-029H)
            DJNZ    L7811               ; (-008H)
            INC     HL
            POP     BC
            SCF     
            RET     

L781D:      CALL    L748E
            SET     6,C
            PUSH    HL
            CALL    L77AF
            JP      C,04AF8H
            LD      (HL),C
            EX      (SP),HL
            PUSH    HL
            DEC     HL
L782D:      CALL    L5198
            OR      A
            JR      Z,L7837             ; (+004H)
            CP      03AH
            JR      NZ,L782D            ; (-00aH)
L7837:      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,L4B28
            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
L7887:      INC     DE
            INC     HL
            LD      A,(DE)
            LD      (HL),A
            DJNZ    L7887               ; (-006H)
            INC     HL
            PUSH    HL
            EXX     
            POP     HL
            CALL    LDHLDE
            LD      (HL),000H
            POP     HL
            RET     

            PUSH    DE
            CALL    L748E
            POP     IX
            PUSH    BC
            SET     6,C
            LD      DE,(07923H)
            LD      (L7923),HL
            PUSH    DE
            CALL    L77AF
            JP      NC,04B04H
            LD      DE,(07921H)
            LD      (L7921),HL
            PUSH    DE
            PUSH    IX
            DEC     HL
L78BA:      CALL    L5198
            CALL    L414A
            JP      Z,L4AE6
            CP      QDPC
            JR      NZ,L78BA            ; (-00dH)
            INC     HL
            POP     DE
            PUSH    DE
            CALL    L6E94
            POP     DE
            LD      HL,(L7923)
            POP     BC
            LD      (07921H),BC
            POP     BC
            LD      (07923H),BC
            EX      DE,HL
            POP     BC
            LD      A,C
            CALL    L790B
            LD      BC,00005H
            ADD     HL,BC
            EX      DE,HL
            CALL    HLFTCH
            CP      028H
            RET     NZ
            PUSH    DE
            LD      B,001H
L78EF:      PUSH    BC
            CALL    L5198
            POP     BC
            CALL    L414D
            JP      Z,L4AE6
            CP      028H
            JR      NZ,L78FF            ; (+001H)
            INC     B
L78FF:      CP      029H
            JR      NZ,L78EF            ; (-014H)
            DJNZ    L78EF               ; (-016H)
            INC     HL
            CALL    HLFTCH
            POP     DE
            RET     

L790B:      CP      003H
            JR      NZ,L7918            ; (+009H)
L790F:      LD      A,(L84C7)
            CP      003H
            RET     Z
            JP      04AEFH

L7918:      LD      A,(L84C7)
            CP      003H
            RET     NZ
            JP      04AEFH

L7921:      NOP     
            NOP     
L7923:      NOP     
            NOP     
            PUSH    HL
            CALL    L60B5
            LD      A,H
            OR      A
            JP      NZ,04AECH
            LD      A,L
            CP      008H
            JP      NC,04AECH
            RST     018H
            DB      012H
            POP     HL
            JR      C,L7947             ; (+00eH)
            JR      Z,L7947             ; (+00cH)
            LD      DE,0FFFFH
L793E:      CALL    L5E97
            LD      A,005H
            LD      (L84C7),A
            RET     

L7947:      LD      E,A
            LD      D,000H
            JR      L793E               ; (-00eH)

L794C:      LD      A,(DE)
            CP      (HL)
            RET     NZ
            PUSH    BC
            PUSH    DE
            PUSH    HL
            LD      B,C
L7953:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L795C            ; (+005H)
            INC     DE
            INC     HL
            DJNZ    L7953               ; (-008H)
            XOR     A
L795C:      POP     HL
            POP     DE
            POP     BC
            RET     

L7960:      PUSH    HL
            LD      B,005H
            CALL    ?CLRHL
            POP     HL
            RET     

L7968:      CALL    L7918
L796B:      LD      A,(HL)
            OR      A
            RET     Z
            INC     HL
            LD      A,(HL)
            XOR     080H
            LD      (HL),A
            DEC     HL
            RET     

L7975:      CALL    L7918
            LD      C,A
            LD      A,080H
            JP      L7988

L797E:      LD      A,(L84C7)
            CP      003H
            JP      Z,L79D2
            LD      C,A
            XOR     A
L7988:      LD      (L7D82),HL
            PUSH    DE
            PUSH    HL
            LD      (07D85H),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      (L7D84),A
            JP      C,L7A93
            XOR     A
            CP      (HL)
            JP      Z,L79C7
            LD      A,(DE)
            OR      A
            JR      Z,L79AF             ; (+004H)
            SUB     (HL)
            JP      L7AD6

L79AF:      LD      SP,(07D85H)
            POP     HL
            POP     DE
            EI      
            LD      A,(HL)
            OR      A
            JP      Z,L7E7F
            LD      A,(L7D84)
            AND     080H
            INC     HL
            RES     7,(HL)
            OR      (HL)
            LD      (HL),A
            DEC     HL
            RET     

L79C7:      LD      B,000H
            LD      A,005H
            LD      C,A
            EX      DE,HL
            LDIR    
            JP      L79AF

L79D2:      LD      B,(HL)
            LD      A,(DE)
            ADD     A,B
            JP      C,04AF2H
            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    L74D5
            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    L74D5
            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     

L7A15:      LD      A,(L84C7)
            CP      003H
            JR      NZ,L7A50            ; (+034H)
            PUSH    DE
            PUSH    HL
            LD      A,(DE)
            OR      (HL)
            JR      Z,L7A4D             ; (+02bH)
            LD      A,(DE)
            CP      (HL)
            JR      C,L7A27             ; (+001H)
            LD      A,(HL)
L7A27:      OR      A
            JR      Z,L7A47             ; (+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,L7A4D             ; (+00eH)
L7A3F:      LD      A,(DE)
            CP      (HL)
            JR      NZ,L7A4D            ; (+00aH)
            INC     DE
            INC     HL
            DJNZ    L7A3F               ; (-008H)
L7A47:      POP     DE
            POP     HL
            LD      A,(DE)
            CP      (HL)
            EX      DE,HL
            RET     

L7A4D:      POP     HL
            POP     DE
            RET     

L7A50:      INC     DE
            INC     HL
            LD      A,(DE)
            DEC     DE
            XOR     (HL)
            RLCA    
            JR      NC,L7A5C            ; (+004H)
            LD      A,(HL)
            DEC     HL
            RLCA    
            RET     

L7A5C:      LD      A,(HL)
            DEC     HL
            RLCA    
            JR      NC,L7A67            ; (+006H)
            CALL    L7A67
            RET     Z
            CCF     
            RET     

L7A67:      PUSH    DE
            PUSH    HL
            EX      DE,HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L7A88            ; (+01aH)
            INC     DE
            INC     HL
            LD      A,(HL)
            OR      080H
            LD      B,A
            LD      A,(DE)
            OR      080H
            CP      B
            JR      NZ,L7A88            ; (+00eH)
            LD      A,(L84C7)
            LD      B,A
            DEC     B
            DEC     B
L7A80:      INC     DE
            INC     HL
            LD      A,(DE)
            CP      (HL)
            JR      NZ,L7A88            ; (+002H)
            DJNZ    L7A80               ; (-008H)
L7A88:      POP     HL
            POP     DE
            RET     

L7A8B:      POP     HL
            PUSH    HL
            CALL    L7960
            JP      L79AF

L7A93:      CALL    L7A67
            JR      Z,L7A8B             ; (-00dH)
            JR      NC,L7AA3            ; (+009H)
            LD      A,(L7D84)
            XOR     080H
            LD      (L7D84),A
            SCF     
L7AA3:      EX      AF,AF'
            LD      A,(HL)
            OR      A
            JP      Z,L79C7
            LD      A,(DE)
            OR      A
            JP      Z,L79AF
            SUB     (HL)
            JR      C,L7AB8             ; (+007H)
            CP      020H
            JP      NC,L79C7
            JR      L7ABF               ; (+007H)

L7AB8:      NEG     
            CP      020H
            JP      NC,L79AF
L7ABF:      EX      AF,AF'
            JR      C,L7AC3             ; (+001H)
            EX      DE,HL
L7AC3:      EX      AF,AF'
            JP      L7B5D

L7AC7:      LD      SP,(07D85H)
            EI      
            POP     HL
            POP     DE
            LD      A,(07D8CH)
            OR      A
            JP      Z,04AE9H
            RET     

L7AD6:      JR      NC,L7AE2            ; (+00aH)
            NEG     
            CP      020H
            JP      NC,L79AF
            EX      DE,HL
            JR      L7AE7               ; (+005H)

L7AE2:      CP      020H
            JP      NC,L79C7
L7AE7:      CALL    L7B1D
            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,L7B0A            ; (+00bH)
            RRA     
            RR      D
            RR      L
            RR      H
            INC     C
            JP      Z,L7AC7
L7B0A:      LD      E,A
            LD      A,C
            EXX     
            LD      BC,00005H
            LD      HL,(L7D82)
            LD      (HL),A
            ADD     HL,BC
            DI      
            LD      SP,HL
            EXX     
            PUSH    HL
            PUSH    DE
            JP      L79AF

L7B1D:      DI      
            LD      (07D87H),SP
            EX      AF,AF'
            INC     HL
            LD      SP,HL
            EXX     
            POP     DE
            SET     7,E
            POP     HL
            OR      A
L7B2B:      EX      AF,AF'
            CP      008H
            JR      C,L7B3C             ; (+00cH)
            SUB     008H
            EX      AF,AF'
            RL      H
            LD      H,L
            LD      L,D
            LD      D,E
            LD      E,000H
            JR      L7B2B               ; (-011H)

L7B3C:      OR      A
            JR      Z,L7B4D             ; (+00eH)
L7B3F:      EX      AF,AF'
            OR      A
            RR      E
            RR      D
            RR      L
            RR      H
            EX      AF,AF'
            DEC     A
            JR      NZ,L7B3F            ; (-00eH)
L7B4D:      EXX     
            EX      DE,HL
            LD      C,(HL)
            INC     HL
            LD      SP,HL
            POP     DE
            SET     7,E
            POP     HL
            EX      AF,AF'
            LD      SP,(07D87H)
            EI      
            RET     

L7B5D:      CP      020H
            JP      NC,L79AF
            CALL    L7B1D
            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     
L7B78:      OR      A
            JR      Z,L7B91             ; (+016H)
L7B7B:      BIT     7,A
            JR      NZ,L7B8D            ; (+00eH)
            RL      H
            RL      L
            RL      D
            RLA     
            DEC     C
            JP      NZ,L7B7B
            JP      L7A8B

L7B8D:      LD      E,A
            JP      L7B0A

L7B91:      LD      A,C
            SUB     008H
            LD      C,A
            LD      A,D
            LD      D,L
            LD      L,H
            LD      H,000H
            JR      Z,L7B9E             ; (+002H)
            JR      NC,L7B78            ; (-026H)
L7B9E:      JP      L7A8B

L7BA1:      LD      C,A
L7BA2:      INC     HL
            INC     DE
            LD      A,(DE)
            XOR     (HL)
            LD      (L7D84),A
            DEC     HL
            DEC     DE
            RET     

L7BAC:      CALL    L7918
            CALL    L7BA1
            PUSH    DE
            PUSH    HL
            LD      (07D85H),SP
            LD      A,(HL)
            OR      A
            JP      Z,L7A8B
            LD      A,(DE)
            OR      A
            JP      Z,L7A8B
            INC     DE
            PUSH    DE
            POP     IX
            ADD     A,(HL)
            LD      E,A
            LD      A,000H
            ADC     A,A
            LD      D,A
            LD      (07D8AH),DE
            INC     HL
            XOR     A
            LD      (L7D89),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
L7BEF:      LD      B,008H
            OR      A
            JP      Z,L7C84
L7BF5:      RLCA    
            JR      NC,L7C0A            ; (+012H)
            EX      AF,AF'
            EXX     
            LD      A,C
            ADD     A,B
            LD      C,A
            ADC     HL,DE
            EXX     
            ADC     HL,DE
            JR      NC,L7C09            ; (+005H)
            LD      A,001H
            LD      (L7D89),A
L7C09:      EX      AF,AF'
L7C0A:      SRL     D
            RR      E
            EXX     
            RR      D
            RR      E
            RR      B
            EXX     
            DJNZ    L7BF5               ; (-023H)
L7C18:      INC     IX
            LD      A,(IX+000H)
            DEC     C
            JR      NZ,L7BEF            ; (-031H)
            EXX     
            LD      A,(L7D89)
            OR      A
            JR      Z,L7C3D             ; (+016H)
            LD      DE,(07D8AH)
            INC     DE
            LD      (07D8AH),DE
            EXX     
            SCF     
            RR      H
            RR      L
            EXX     
            RR      H
            RR      L
            RR      C
L7C3D:      BIT     7,C
            JR      Z,L7C5B             ; (+01aH)
            LD      DE,00001H
            ADD     HL,DE
            EXX     
            LD      DE,L0000
            ADC     HL,DE
            EXX     
            JR      NC,L7C5B            ; (+00dH)
            LD      DE,(07D8AH)
            INC     DE
            LD      (07D8AH),DE
            EXX     
            LD      H,080H
            EXX     
L7C5B:      POP     IX
            PUSH    IX
            LD      (IX+004H),L
            LD      (IX+003H),H
            EXX     
            LD      (IX+002H),L
            LD      (IX+001H),H
            LD      HL,(07D8AH)
            OR      A
            LD      DE,L0081
            SBC     HL,DE
            LD      A,H
            ADD     A,000H
            JP      M,L7C90
            JP      NZ,L7AC7
            LD      (IX+000H),L
            JP      L79AF

L7C84:      LD      A,E
            EXX     
            LD      B,E
            LD      E,D
            LD      D,A
            EXX     
            LD      E,D
            LD      D,000H
            JP      L7C18

L7C90:      LD      SP,(07D85H)
            JP      L7A8B

L7C97:      CALL    L7918
            CALL    L7BA1
            PUSH    DE
            PUSH    HL
            LD      (07D85H),SP
            LD      A,(DE)
            OR      A
            JP      Z,04AE9H
            EX      AF,AF'
            LD      A,(HL)
            OR      A
            JP      Z,L7A8B
            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,L7C90
            JP      NZ,L7AC7
            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
L7CE9:      LD      B,008H
            XOR     A
L7CEC:      BIT     7,H
            JR      NZ,L7D00            ; (+010H)
            OR      A
L7CF1:      RLA     
            EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            DJNZ    L7CEC               ; (-00dH)
            PUSH    AF
            DEC     C
            JR      NZ,L7CE9            ; (-014H)
            JP      L7D3A

L7D00:      OR      A
            EXX     
            SBC     HL,DE
            EXX     
            SBC     HL,DE
            CCF     
            JR      C,L7CF1             ; (-019H)
            EXX     
            ADD     HL,DE
            EXX     
            ADC     HL,DE
            OR      A
            RLA     
            EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            DJNZ    L7D1F               ; (+007H)
            PUSH    AF
            LD      B,008H
            DEC     C
            JP      Z,L7D3A
L7D1F:      EXX     
            OR      A
            SBC     HL,DE
            EXX     
            SBC     HL,DE
            SCF     
            RLA     
            DJNZ    L7D30               ; (+006H)
            PUSH    AF
            LD      B,008H
            DEC     C
            JR      Z,L7D3A             ; (+00aH)
L7D30:      EXX     
            ADD     HL,HL
            EXX     
            ADC     HL,HL
            JR      C,L7D1F             ; (-018H)
            JP      L7CEC

L7D3A:      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
L7D46:      BIT     7,B
            JR      NZ,L7D5D            ; (+013H)
            EXX     
            SLA     H
            EXX     
            RL      E
            RL      D
            RL      C
            RL      B
            DEC     A
            JP      NZ,L7D46
            JP      L7A8B

L7D5D:      EXX     
            RL      H
            EXX     
            JR      NC,L7D74            ; (+011H)
            LD      HL,00001H
            ADD     HL,DE
            EX      DE,HL
            LD      HL,L0000
            ADC     HL,BC
            LD      B,H
            LD      C,L
            JR      NC,L7D74            ; (+003H)
            LD      B,080H
            INC     A
L7D74:      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      L79AF

L7D82:      NOP     
            NOP     
L7D84:      NOP     
            NOP     
            NOP     
            NOP     
            NOP     
L7D89:      NOP     
            NOP     
            NOP     
            NOP     
L7D8D:      INC     HL
            BIT     7,(HL)
            DEC     HL
            RET     

L7D92:      INC     (HL)
            RET     NZ
            JP      04AE9H

L7D97:      LD      A,(HL)
            OR      A
            RET     Z
            DEC     (HL)
            RET     NZ
            JP      L7960

L7D9F:      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,04AF5H
            POP     HL
            RET     

L7DB1:      PUSH    HL
            LD      (L846A),HL
            CALL    L7D9F
            EX      DE,HL
            LD      (L846C),HL
            CALL    L7D9F
            EX      DE,HL
            LD      (L846E),HL
            CALL    L7D9F
            LD      (08470H),DE
            POP     HL
            RET     

L7DCC:      CALL    L7918
            EX      DE,HL
            LD      A,(HL)
            OR      A
            JP      Z,L7E2E
            EX      DE,HL
            LD      A,(HL)
            OR      A
            JP      Z,L7960
            CALL    L7D8D
            JR      Z,L7E08             ; (+028H)
            CALL    L796B
            EX      DE,HL
            PUSH    DE
            PUSH    HL
            LD      DE,L84D0
            CALL    L5E91
            LD      HL,L84D0
            CALL    L608B
            LD      A,(HL)
            OR      A
            JP      NZ,04AECH
            POP     HL
            PUSH    HL
            CALL    L60B5
            BIT     0,L
            POP     DE
            POP     HL
            JR      Z,L7E08             ; (+006H)
            CALL    L7E08
            JP      L796B

L7E08:      EX      DE,HL
            LD      A,(HL)
            OR      A
            JR      Z,L7E2E             ; (+021H)
            CALL    L7D8D
            JR      Z,L7E34             ; (+022H)
            CALL    L796B
            CALL    L7E34
            PUSH    DE
            PUSH    HL
            LD      DE,L84D0
            CALL    L5E8E
            LD      HL,L84D0
            POP     DE
            CALL    L7C97
            PUSH    DE
            CALL    L5E91
            POP     HL
            POP     DE
            RET     

L7E2E:      PUSH    DE
            CALL    L5E8E
            POP     HL
            RET     

L7E34:      PUSH    DE
            LD      DE,L84D0
            CALL    L5E91
            POP     HL
            CALL    L8319
            LD      DE,L84D0
            CALL    L7BAC
            JP      L81F5

L7E48:      CALL    L7918
            PUSH    DE
            PUSH    HL
            CALL    L60B5
            LD      A,L
            CPL     
            LD      E,A
            LD      A,H
            CPL     
            LD      D,A
            JR      L7E79               ; (+021H)

L7E58:      LD      A,0A2H
            LD      BC,0B23EH
            LD      BC,0AA3EH
            LD      (L7E74),A
            INC     A
            LD      (L7E77),A
            CALL    L7918
            PUSH    DE
            PUSH    HL
            CALL    L60B5
            EX      DE,HL
            CALL    L60B5
            LD      A,H
L7E74:      AND     D
            LD      D,A
            LD      A,L
L7E77:      AND     E
            LD      E,A
L7E79:      POP     HL
            CALL    L5E97
            POP     DE
            RET     

L7E7F:      INC     HL
            RES     7,(HL)
            DEC     HL
            RET     

            CALL    L7D8D
            JP      Z,L604D
            CALL    L7EA9
            CALL    L604D
            LD      DE,L84D0
            CALL    L7A15
            RET     Z
L7E97:      LD      DE,L6110
            JP      L7975

L7E9D:      LD      DE,L6110
            JP      L797E

L7EA3:      LD      DE,L6110
            JP      L7A15

L7EA9:      PUSH    HL
            PUSH    DE
            LD      DE,L84D0
            CALL    L5E91
            POP     DE
            POP     HL
            RET     

L7EB4:      CALL    L604D
            EX      DE,HL
            CALL    L604D
            EX      DE,HL
            CALL    L7EA9
            CALL    L7C97
            CALL    L604D
            CALL    L7BAC
            PUSH    DE
            LD      DE,L84D0
            CALL    L7975
            POP     DE
            JP      L796B

L7ED3:      CALL    L604D
            EX      DE,HL
            CALL    L604D
            EX      DE,HL
            CALL    L7C97
            JP      L604D

            LD      A,(HL)
            OR      A
            RET     Z
            CALL    L7D8D
            JP      NZ,04AECH
            CALL    L8319
            CALL    L7D97
            JP      L81F5

L7EF3:      PUSH    HL
            EX      DE,HL
            CALL    L5E8E
            POP     HL
            POP     BC
            RET     

L7EFB:      LD      A,(HL)
            LD      C,H
L7EFD:      ADD     A,B
            DEC     HL
            PUSH    BC
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            DEC     HL
            PUSH    AF
            CALL    L7F10
            POP     AF
            POP     BC
            RLCA    
            RET     NC
            JP      L796B

L7F10:      CALL    L7EA3
            JR      C,L7F33             ; (+01eH)
            CALL    L7D9F
            PUSH    DE
            PUSH    HL
            CALL    L5E91
            POP     DE
            PUSH    DE
            CALL    L5E8E
            POP     HL
            POP     DE
            CALL    L7C97
            CALL    L7F33
            LD      DE,0818DH
            CALL    L7975
            JP      L7E7F

L7F33:      LD      A,0FFH
            LD      (L80A9),A
            LD      DE,L7EFB
            CALL    L7A15
            JR      C,07F8FH             ; (+04fH)
            LD      DE,L7EFD
            CALL    L7A15
            PUSH    AF
            CALL    L7D9F
            POP     AF
            PUSH    HL
            PUSH    DE
            CALL    L5E91
            POP     HL
            JR      C,L7F67             ; (+014H)
            CALL    L7E9D
            EX      (SP),HL
            CALL    L7975
            POP     DE
            CALL    L7C97
            CALL    07F8FH
            LD      DE,08192H
            JP      L797E

L7F67:      LD      DE,L7F8A
            CALL    L7BAC
            CALL    L7E9D
            EX      (SP),HL
            LD      DE,L7F8A
            CALL    L7975
            POP     DE
            CALL    L7C97
            CALL    07F8FH
            CALL    L7D92
            LD      DE,08192H
            CALL    L797E
            JP      L7D97

L7F8A:      LD      A,A
            LD      D,H
            INC     DE
            CALL    Z,0C5D0H
            PUSH    HL
            CALL    L7DB1
            POP     HL
            PUSH    HL
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      E,L
            LD      D,H
            CALL    L7BAC
            LD      DE,(0846EH)
            POP     HL
            PUSH    HL
            CALL    L5E91
            LD      A,(L84C7)
            DEC     A
            CP      004H
            LD      B,A
            LD      HL,08130H
            JP      Z,L8036
            LD      B,00AH
            JP      L8036

L7FBB:      PUSH    BC
            LD      A,(HL)
            OR      A
            JP      Z,L7EF3
            LD      DE,0818DH
            CALL    L7975
            CALL    L796B
            POP     BC
L7FCB:      PUSH    BC
            INC     HL
            LD      A,(HL)
            RES     7,(HL)
            AND     080H
            CPL     
            LD      (L80A9),A
            DEC     HL
            LD      DE,L8183
            PUSH    HL
            CALL    L7A15
            JR      C,L7FE9             ; (+009H)
            CALL    L7C97
            CALL    L608B
            CALL    L7BAC
L7FE9:      LD      DE,08188H
            CALL    L7A15
            JR      C,L7FFC             ; (+00bH)
            CALL    L7975
            LD      A,(L80A9)
            XOR     080H
            LD      (L80A9),A
L7FFC:      LD      DE,0818DH
            CALL    L7A15
            JR      C,L800D             ; (+009H)
            LD      DE,08188H
            CALL    L7975
            CALL    L7E7F
L800D:      CALL    L7DB1
            POP     HL
            PUSH    DE
            LD      DE,08192H
            CALL    L7A15
            JR      NC,L807F            ; (+065H)
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      E,L
            LD      D,H
            CALL    L7BAC
            LD      DE,(0846EH)
            POP     HL
            PUSH    HL
            CALL    L5E91
            LD      A,(L84C7)
            LD      B,A
            LD      HL,L80E0
L8036:      PUSH    BC
            PUSH    HL
            LD      HL,(L846E)
            LD      DE,(08470H)
            CALL    L7BAC
            POP     HL
            PUSH    HL
            LD      DE,(0846CH)
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      DE,(0846EH)
            CALL    L7BAC
            EX      DE,HL
            LD      HL,(L846A)
            CALL    L797E
            POP     HL
            LD      DE,00005H
            ADD     HL,DE
            POP     BC
            DJNZ    L8036               ; (-02dH)
            POP     HL
            POP     BC
            LD      A,(L80A9)
            INC     HL
            XOR     (HL)
            CPL     
            LD      (HL),A
            DEC     HL
            LD      A,(L84C7)
            CP      008H
            LD      A,(HL)
            JR      Z,L807B             ; (+006H)
            CP      05CH
L8077:      RET     NC
            JP      L7960

L807B:      CP      04DH
            JR      L8077               ; (-008H)

L807F:      LD      DE,0818DH
            CALL    L7975
            CALL    L7E7F
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L5E91
L808E:      POP     HL
            LD      E,L
            LD      D,H
            CALL    L7BAC
            LD      DE,(0846EH)
            CALL    L5E8E
L809B:      POP     DE
            PUSH    DE
            CALL    L5E8E
            LD      A,(L84C7)
            LD      B,A
            LD      HL,L8108
            JR      L8036               ; (-073H)

L80A9:      NOP     
            PUSH    BC
            PUSH    HL
            CALL    L7D9F
            EX      DE,HL
            LD      (L8472),HL
            CALL    L7D9F
            LD      (08474H),DE
            POP     HL
            PUSH    HL
            CALL    L5E91
            LD      HL,(L8472)
            EX      DE,HL
            POP     HL
            PUSH    HL
            CALL    L5E91
            LD      HL,(08474H)
L80CB:      CALL    L7FCB
            POP     DE
            PUSH    DE
            CALL    L5E91
            LD      HL,(L8472)
            CALL    L7FBB
            EX      DE,HL
            POP     HL
            CALL    L7C97
            POP     BC
            RET     

L80E0:      LD      A,(HL)
L80E1:      XOR     D
            XOR     D
            XOR     D
            XOR     E
            LD      A,D
            EX      AF,AF'
            ADC     A,B
            ADC     A,B
            ADC     A,C
            LD      (HL),H
            RET     NC
            DEC     C
            NOP     
            RET     NC
            LD      L,(HL)
            JR      C,L80E1             ; (-011H)
            DEC     E
            DEC     HL
            LD      H,A
            RST     010H
L80F6:      LD      (L402B),A
            LD      H,B
            JR      NC,L808E            ; (-06eH)
            JR      NC,L809B            ; (-063H)
            LD      E,B
            RST     010H
            CCF     
            SBC     A,A
            LD      A,(04A50H)
            SUB     (HL)
            DEC     SP
            ADD     A,D
L8108:      ADD     A,B
            ADD     A,B
            NOP     
            NOP     
            NOP     
            LD      A,H
            LD      HL,(0AAAAH)
            XOR     E
            LD      (HL),A
            OR      (HL)
            DEC     BC
            LD      H,B
            OR      (HL)
            LD      (HL),C
            LD      D,B
            DEC     C
            NOP     
            RET     NC
            LD      L,E
            SUB     E
            JP      P,0BC7DH
            LD      H,H
            RRCA    
            HALT    
            RST     000H
L8125:      ADD     A,B
            LD      E,H
            RET     

L8128:      RES     4,L
            LD      B,(HL)
            LD      D,H
            LD      D,A
            CCF     
            SBC     A,A
            LD      A,(0AA7FH)
            XOR     D
            XOR     D
            XOR     E
            LD      A,(HL)
            LD      C,H
            CALL    Z,0CDCCH
            LD      A,(HL)
            SUB     D
            LD      C,C
            INC     H
            SUB     D
            LD      A,L
            LD      H,E
            ADC     A,(HL)
            JR      C,L8128             ; (-01cH)
            LD      A,L
            CP      D
            LD      L,08BH
            AND     E
            LD      A,L
            DEC     E
            ADC     A,C
            RET     C
            SBC     A,(HL)
            LD      A,L
            ADC     A,B
            ADC     A,B
            ADC     A,B
            ADC     A,C
            LD      A,H
            LD      (HL),B
            RET     P
            RET     P
            POP     AF
            LD      A,H
            RST     010H
            SUB     H
            DEC     (HL)
            PUSH    HL
            LD      A,H
            LD      B,E
            INC     C
            JR      NC,L8125            ; (-03dH)
            LD      DE,L0000
            LD      A,(HL)
            OR      A
            JR      Z,L8171             ; (+008H)
            CALL    L7D8D
            INC     DE
            JR      Z,L8171             ; (+002H)
            DEC     DE
            DEC     DE
L8171:      CALL    L5E97
            RET     

L8175:      LD      DE,08197H
            JR      L817D               ; (+003H)

            LD      DE,08188H
L817D:      PUSH    BC
            CALL    L7BAC
            POP     BC
            RET     

L8183:      ADD     A,E
            LD      C,C
            RRCA    
            JP      C,082A2H
            LD      C,C
            RRCA    
            JP      C,L81A2
            LD      C,C
            RRCA    
            JP      C,080A2H
            LD      C,C
            RRCA    
            JP      C,L7BA2
            LD      C,FDPC
            DEC     (HL)
            INC     DE
            PUSH    HL
            CALL    L60B5
            LD      A,000H
L81A2:      CP      040H
            LD      A,(HL)
            CALL    NZ,BREAKX
            LD      E,A
            LD      D,000H
            POP     HL
            CALL    L5E97
            RET     

            LD      A,(HL)
            OR      A
            JR      Z,L81B9             ; (+005H)
            CALL    L7D8D
            JR      Z,L81C4             ; (+00bH)
L81B9:      PUSH    HL
            LD      HL,L4193
            LD      (L81F3),HL
            POP     HL
            XOR     A
            LD      R,A
L81C4:      PUSH    BC
            LD      DE,(081F3H)
            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      (081F3H),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
            CALL    L7E97
            POP     BC
            RET     

L81F3:      SUB     E
            LD      B,C
L81F5:      PUSH    BC
            LD      A,(HL)
            OR      A
            JP      Z,L7EF3
            INC     HL
            LD      A,(HL)
            LD      (L830B),A
            RES     7,(HL)
            DEC     HL
            LD      DE,L8460
            CALL    L7BAC
            PUSH    HL
            CALL    L7D9F
            PUSH    DE
            CALL    L5E91
            POP     HL
            CALL    L604D
            PUSH    HL
            CALL    L60B5
            XOR     A
            CP      H
            JP      NZ,04AE9H
            LD      A,L
            LD      (L830A),A
            POP     DE
            POP     HL
            PUSH    HL
            CALL    L7975
            PUSH    DE
            PUSH    HL
            CALL    L5E8E
            POP     DE
            POP     HL
            CALL    L7D97
            EX      DE,HL
            XOR     A
            LD      B,008H
L8236:      PUSH    BC
            PUSH    AF
            CALL    L7A15
            JR      C,L8244             ; (+007H)
            CALL    L7975
            POP     AF
            SET     7,A
            PUSH    AF
L8244:      POP     AF
            RLC     A
            EX      DE,HL
            PUSH    AF
            CALL    L7D97
            POP     AF
            EX      DE,HL
            POP     BC
            DJNZ    L8236               ; (-01bH)
            LD      (L830C),A
            PUSH    DE
            LD      DE,L8456
            LD      A,(L84C7)
            BIT     3,A
            JR      NZ,L8262            ; (+003H)
            LD      DE,L845B
L8262:      CALL    L7BAC
            POP     DE
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      A,(L84C7)
            BIT     3,A
            JP      Z,L82FA
            CALL    L7D92
            LD      DE,L610B
            CALL    L797E
            CALL    L7D97
            POP     DE
            PUSH    DE
            CALL    L7BAC
            LD      DE,L610B
            CALL    L7D97
            CALL    L797E
            CALL    L7D92
            POP     DE
            PUSH    DE
            CALL    L7BAC
            LD      DE,L8451
            CALL    L7BAC
            CALL    L7D92
            CALL    L7E9D
            CALL    L7D97
            POP     DE
            PUSH    DE
            CALL    L7BAC
            CALL    L7E9D
            POP     DE
            PUSH    DE
            CALL    L7BAC
L82B1:      CALL    L7E9D
            EX      (SP),HL
            EX      DE,HL
            PUSH    DE
            CALL    L5E8E
            POP     HL
            LD      DE,L8401
            LD      A,(L830C)
            LD      B,008H
L82C3:      RLC     A
            JR      NC,L82CE            ; (+007H)
            PUSH    AF
            PUSH    BC
            CALL    L7BAC
            POP     BC
            POP     AF
L82CE:      INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            DJNZ    L82C3               ; (-012H)
            LD      A,(L830A)
            ADD     A,(HL)
            JP      C,04AE9H
            LD      (HL),A
            POP     DE
            CALL    L7BAC
            POP     BC
            LD      A,(L830B)
            RLC     A
            RET     NC
            PUSH    BC
            PUSH    DE
            PUSH    HL
            CALL    L5E91
            POP     DE
            PUSH    DE
            CALL    L5E8E
            POP     HL
            POP     DE
            CALL    L7C97
            POP     BC
            RET     

L82FA:      POP     DE
            PUSH    DE
            CALL    L7BAC
            LD      A,(HL)
            OR      A
            CALL    NZ,L7D97
            CALL    L797E
            JP      L82B1

L830A:      NOP     
L830B:      NOP     
L830C:      NOP     
            PUSH    BC
            CALL    L8319
            LD      DE,L83F2
            CALL    L7BAC
            POP     BC
            RET     

L8319:      PUSH    BC
            CALL    L7D8D
            JP      NZ,04AECH
            LD      A,(HL)
            OR      A
            JP      Z,04AECH
            SUB     081H
            LD      (L83F1),A
            LD      (HL),081H
            XOR     A
            LD      B,008H
            LD      DE,L8401
L8332:      PUSH    BC
            PUSH    AF
            CALL    L7A15
            JR      C,L8348             ; (+00fH)
            PUSH    HL
            LD      HL,00028H
            ADD     HL,DE
            EX      DE,HL
            EX      (SP),HL
            CALL    L7BAC
            POP     DE
            POP     AF
            SET     7,A
            PUSH    AF
L8348:      POP     AF
            RLC     A
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            INC     DE
            POP     BC
            DJNZ    L8332               ; (-021H)
            DB      022H
            LD      L,D
            ADD     A,H
            CALL    L7D9F
            EX      DE,HL
            LD      E,A
            LD      D,000H
            CALL    L5E97
            LD      A,(HL)
            OR      A
            JR      Z,L8367             ; (+003H)
            SUB     008H
            LD      (HL),A
L8367:      LD      A,(L83F1)
            CP      080H
            JR      C,L8370             ; (+002H)
            NEG     
L8370:      PUSH    HL
            CALL    L7D9F
            EX      DE,HL
            LD      (L846C),HL
            LD      E,A
            LD      D,000H
            CALL    L5E97
            LD      A,(L83F1)
            AND     080H
            INC     HL
            OR      (HL)
            LD      (HL),A
            DEC     HL
            EX      DE,HL
            POP     HL
            CALL    L797E
            LD      A,(L84C7)
            LD      DE,08465H
            CP      005H
            JR      Z,L8399             ; (+003H)
            LD      DE,L8456
L8399:      CALL    L7BAC
            PUSH    HL
            LD      DE,(0846CH)
            LD      HL,(L846A)
            PUSH    HL
            PUSH    DE
            CALL    L5E91
            POP     HL
            CALL    L7E9D
            EX      (SP),HL
            CALL    L7975
            POP     DE
            CALL    L7C97
            PUSH    DE
            CALL    L5E91
            POP     HL
            PUSH    DE
            LD      E,L
            LD      D,H
            CALL    L7BAC
            POP     DE
            PUSH    HL
            PUSH    DE
            CALL    L5E91
            POP     HL
            LD      DE,L83FC
            CALL    L797E
            EX      DE,HL
            POP     HL
            CALL    L7BAC
            LD      DE,L610B
            CALL    L7D92
            CALL    L797E
            CALL    L7D97
            EX      DE,HL
            LD      HL,(L846A)
            CALL    L7BAC
            LD      DE,L83F7
            CALL    L7BAC
            POP     DE
            CALL    L797E
            POP     BC
            RET     

L83F1:      NOP     
L83F2:      LD      A,A
            LD      E,(HL)
            LD      E,E
            RET     C
            XOR     C
L83F7:      LD      A,A
            LD      C,H
            CALL    Z,0CDCCH
L83FC:      ADD     A,C
            LD      D,L
            LD      D,L
            LD      D,L
            LD      D,(HL)
L8401:      ADD     A,C
            DEC     (HL)
            INC     B
            DI      
            INC     (HL)
            ADD     A,C
            JR      L8440               ; (+037H)

            RET     P
            LD      D,D
            ADD     A,C
            DEC     BC
L840D:      SUB     L
            POP     BC
            CALL    PO,00581H
            XOR     D
            JP      08168H

            LD      (BC),A
            CALL    09986H
            ADD     A,C
            LD      BC,0D164H
            CALL    P,L0081
            OR      C
            IN      D,(C)
            ADD     A,C
            NOP     
            LD      E,B
            RST     010H
            OUT     (080H),A
            DEC     (HL)
            INC     B
            DI      
            INC     (HL)
            ADD     A,B
            LD      D,A
            LD      B,H
            CALL    M,L80CB
            LD      L,D
            RET     NZ
            ADD     A,0E8H
            ADD     A,B
            LD      (HL),L
            DEC     H
            LD      A,L
            LD      D,080H
            LD      A,D
            ADD     A,E
L8440:      OR      D
            CALL    C,07D80H
            LD      A,00CH
            DEC     C
            ADD     A,B
            LD      A,(HL)
            SBC     A,(HL)
            LD      DE,0805DH
            LD      A,A
            LD      C,(HL)
            BIT     3,D
L8451:      LD      A,D
            EX      AF,AF'
            ADC     A,B
            ADC     A,B
            ADC     A,C
L8456:      ADD     A,B
            LD      SP,L1772
            RET     M
L845B:      ADD     A,B
            LD      SP,L1772
            RET     M
L8460:      ADD     A,C
            JR      C,L840D             ; (-056H)
            DEC     SP
            LD      HL,(03180H)
            LD      (HL),D
            RLA     
            RET     M
L846A:      DS      2, 000H
L846C:      DS      2, 000H
L846E:      DS      4, 000H
L8472:      DS      4, 000H
L8476:      DS      2, 000H
L8478:      DS      2, 000H
L847A:      DS      2, 000H
L847C:      DS      2, 000H
L847E:      DB      000H
L847F:      DB      000H
L8480:      DS      2, 000H
L8482:      DS      2, 000H
L8484:      DS      4, 000H
L8488:      DB      000H
L8489:      DS      2, 000H
            DB      015H
            DB      000H
            DB      EM_P1
            DB      0FFH
            DS      2, 000H
L8491:      DS      2, 000H
L8493:      DS      2, 000H
L8495:      DS      7, 000H
L849C:      DB      000H
L849D:      DS      3, 000H
L84A0:      DB      000H
L84A1:      DS      4, 000H
L84A5:      DB      000H
L84A6:      DS      8, 000H
L84AE:      DS      25, 000H
L84C7:      DB      008H                ; Splash screen / banner text
L84C8:      DS      8, 000H
L84D0:      DS      8, 000H
L84D8:      DS      8, 000H
L84E0:      DB      016H
            DB      00DH
            DB      020H
            DS      38, 0D7H
            DS      2, 020H
            DB      044H,005H,"ISK ",006H,042H,005H,"ASIC INTERPRETER ",006H,"MZ-2Z"
            DS      2, 030H
            DB      039H
L852E:      DS      2, 020H
            DB      "V1.0A ",00DH
            DS      3, 020H
            DB      043H,005H,"OPYRIGHT ",006H,"(C) 1984 ",005H,"BY ",006H,"SHARP ",005H,"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
            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,00DH," 30406 ",005H,"BYTES FR"
            DS      2, 045H
            DS      2, 00DH
            DS      93, 000H
L85FE:      DS      1698, 0FFH
L8CA0:      DS      864, 0FFH

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:
