;кодировка DOS

IDBLC   LD A,(HL)
        INC HL
        CP "L"
        RET NZ
        LD A,(HL)
        INC HL
        CP "C"
        RET NZ
        LD A,(HL)
        INC HL
        CP "M"
        RET NZ
        LD A,(HL)
        INC HL
        CP "P"
        RET NZ
        LD A,(HL)
        INC HL
        CP "5"
        RET 

TABC    DB 1,"p..",#00

ppc     LD HL,SORTblc
        RET 

LUP     LD HL,#1900
el      LD (add),HL
        LD A,GUIPage
        CALL RAM

        XOR A
        LD HL,NEWCAT-16
        LD (HL),A
        LD HL,NEWCAT
        LD DE,NEWCAT+1
        LD BC,#FFFF-NEWCAT
        LD (HL),A
        LDIR 
        LD HL,FNameScr
        LD DE,23773
        LD BC,9
        LDIR 
        LD HL,SORTscr
        LD A,(FNameScr+8)
        CP "p"
        CALL Z,ppc
        LD (TAB_SORT),HL
        LD A,SORT
        CALL GUI

        LD C,#FE
        CALL DOS_FUNC_
        JP C,main_

        LD DE,16
add     DW 0      ; ADD HL,DE / SBC HL,DE

        LD A,(HL)
        AND A
        JP Z,main_
        PUSH HL
        LD DE,FNameScr
        LD BC,11
        LDIR 
        POP HL
        LD DE,23773
        LD BC,16
        LDIR 

        LD A,(FNameScr+8)
        CP "p"
        JR Z,DPC

        LD A,(SEC_LEN)
        LD B,A
        LD HL,#8000
        LD DE,SCREEN
        LD IX,(START_SEC)
        LD A,ScrPage
        LD C,#05
        EX AF,AF'
        LD A,SL_BANK
        CALL GUI
        JP Main

LDN     LD HL,#52ED
        JP el

DPC     LD A,(SEC_LEN)
        LD B,A
        LD HL,#8000
        LD DE,SCRBGE
        LD IX,(START_SEC)
        LD A,ScrPage
        LD C,#05
        EX AF,AF'
        LD A,SL_BANK
        CALL GUI    
        JP C,main_
        LD A,ScrPage
        CALL RAM
        LD HL,SCRBGE
        CALL IDBLC
        JP NZ,main_
        CALL CLS
        LD HL,SCRBGE
        CALL DECOMPR
        CALL SAVESCR
        JP Main


