ELES EQU 1
*L-
MON EQU 0
EXOS MACRO @P1
 RST 30H
 DEFB @P1
 ENDM
KARBE MACRO @CSAT
 LD A,@CSAT
 EXOS 5
 LD A,B
 ENDM
EXOPEN MACRO @CSAT,@NEV
 LD A,@CSAT
 LD DE,@NEV
 EXOS 1
 ENDM
EXCLOSE MACRO @CSAT
 LD A,@CSAT
 EXOS 3
 ENDM
BLOUT MACRO @CSAT,@STR,@HOSSZ
 LD DE,@STR
 LD BC,@HOSSZ
 LD A,@CSAT
 EXOS 8
 ENDM
KURZHOM MACRO @REGPAR
 LD @REGPAR,101H
 LD (KURZY),@REGPAR
 ENDM
EOFE MACRO @REG
 LD A,@REG
 CP EOF
 ENDM
VIDX EQU 40
VIDY EQU 20
ELINE EQU VIDY
SLINE EQU 1
SPACE EQU #20
CR EQU #D
LF EQU #A
ESC EQU #1B
EOF EQU #E4
SPEC EQU #0B
EKEPCS EQU 3
EDCSAT EQU 4
VCSAT EQU 2
FILECSAT EQU 1
KEYCSAT EQU #69
USZEG EQU 24
FPUFHO EQU 1000H
 IF (MON+ELES)>0
 ORG #100
 LD SP,#100
 ENDC
 ENT $
 EXOPEN KEYCSAT,KEYBOARD
 LD HL,VIDDATA
 CALL SZETEL
 EXOPEN VCSAT VIDEO
 IF ELES=1
 LD HL,4000H
 EXOS USZEG
 OR A
 JR NZ,TETOIR
 LD H,80H
 LD A,C
 OUT (#B1),A
 EXOS USZEG
 OR A
 JR NZ,TETOIR
 LD H,0C0H
 LD A,C
 OUT (#B2),A
 EXOS USZEG
 OR A
 JR NZ,TETOIR
 LD H,A
 LD A,C
 OUT (#B3),A
 ENDC
TETOIR LD (RAMTOP),HL
 EXCLOSE VCSAT
 LD A,EOF
 LD (TEXTKEZD),A
INIC LD HL,VIDDATA
 CALL SZETEL
 EXOPEN VCSAT,VIDEO
 BLOUT VCSAT,COLORS,10
 LD A,VCSAT
 LD BC,#101
 LD D,VIDY
 LD E,1
 EXOS SPEC
 LD A,(VIDMOD)
 OR A
 LD A,VIDX
 JR Z,INIC1
 ADD A,A
INIC1 LD (MAXOSZ),A
 DI
 IN A,(#B3)
 LD (LAP3+1),A
 IN A,(#B2)
 LD (LAP2+1),A
 EI
KTEXT LD HL,TEXTKEZD
 LD (BFSM),HL
 KURZHOM HL
FOFRISS EQU KTEXT
 CALL FRISSIT
LEGFO CALL KRBE
FOCIK CALL VILI
 PUSH AF
 CALL KRKI
 POP AF
 LD B,A
 CP SPACE
 JR NC,FOC2
 LD HL,CTRTAB
FOC1 PUSH HL
 PUSH AF
 CALL KIURIT
 POP AF
 POP HL
 CALL UGRAS
 JR LEGFO
FOC2 CP #A0
 JR NC,FOC3
 CALL UJWK
 JR LEGFO
FOC3 CP #B0
 JR NC,FOC4
 SUB #A0
 LD HL,DELTAB
 JR FOC1
FOC4 CP #C0
 JR NC,FOCIK
 SUB #B0
 LD HL,JOYTAB
 JR FOC1
STOP IF ELES=1
 LD C,60H
 EXOS 0
 LD DE,EXDOS
 EXOS 1AH
 ELSE
 EXCLOSE,VCSAT
 ENDC
 IF MON=1
 RST 18H
 ENDC
 IF (MON+ELES)=0
 POP AF
 RET
 ENDC
MODKAP LD A,(VIDMOD)
 XOR 2
 LD (VIDMOD),A
 EXCLOSE VCSAT
 POP AF
 JP INIC
PGDWN LD A,(KURZY)
 CP SLINE
 LD A,SLINE
 JR Z,PGD2
PGD1 LD (KURZY),A
 RETN
PGD2 LD HL,(BFSM)
 LD DE,TEXTKEZD
 CALL CPHLDE
 RET Z
 LD B,VIDY-1
PG3 PUSH BC
 CALL ELOSOR
 POP BC
 DJNZ PG3
PG4 LD (BFSM),HL
 JP FRISSIT
PGUP LD A,(KURZY)
 CP ELINE
 LD A,ELINE
 JR NZ,PGD1
 LD B,VIDY-1
 LD HL,(BFSM)
PGUP1 PUSH BC
 CALL KOVSOR
 POP BC
 RET C
 DJNZ PGUP1
 JR PG4
THOME KURZHOM HL
 LD HL,TEXTKEZD
 JR PG4
TEND LD HL,(BFSM)
TEND1 LD B,ELINE-1
TEND2 PUSH BC
 CALL KOVSOR
 POP BC
 JR C,TEND3
 DJNZ TEND2
 LD (BFSM),HL
 JR TEND1
TEND3 CALL CURPOSU
 JP FRISSIT
SCRUP LD HL,(BFSM)
 CALL KOVSOR
 RET C
 LD (UJBFSM+1),HL
 LD B,VIDY-1
VEGKER PUSH BC
 CALL KOVSOR
 POP BC
 RET C
 DJNZ VEGKER
 PUSH HL
UJBFSM LD HL,0
 LD (BFSM),HL
 CALL ROLLFEL
 POP HL
 LD BC,(KURZY)
 PUSH BC
 LD C,ELINE
 LD B,1
 JR SCRDWN1
SCRDWN LD HL,(BFSM)
 CALL ELOSOR
 RET C
 LD (BFSM),HL
 CALL ROLLEF
 LD BC,(KURZY)
 PUSH BC
 LD BC,101H
SCRDWN1 LD (KURZY),BC
 CALL UJSORKI
SCRDWN2 POP BC
 LD (KURZY),BC
 RET
FRISSIT LD HL,(BFSM)
 LD BC,(KURZY)
 PUSH BC
 KURZHOM BC
 CALL SOROKKI
 JR SCRDWN2
ROLLEF LD DE,-16
 LD BC,-18
 LD A,ELINE
 JR ROLLOZ
ROLLFEL LD DE,16
 LD BC,14
 LD A,1
ROLLOZ LD (VSOR0+1),A
 LD (ROLL2+1),DE
 LD (ROLL3+1),BC
 PUSH HL
 CALL VIDSOR
 EX DE,HL
 LD (SORPUFF),HL
 DI
 LD A,-1
ROLL2 LD HL,16
 ADD HL,DE
 OUT (#B2),A
 LD A,VIDY-1
ROLL3 LD BC,14
RLLFC LDI
 LDI
 INC C
 INC C
 ADD HL,BC
 EX DE,HL
 ADD HL,BC
 EX DE,HL
 DEC A
 JR NZ,RLLFC
 LD HL,SORPUFF
 LDI
 LDI
 LD A,(LAP2+1)
 OUT (#B2),A
 POP HL
 EI
 RET
VIDSOR DI
 LD A,-1
 OUT (#B2),A
 LD HL,#B904
VSOR0 LD A,0
 LD BC,16
VSOR1 ADD HL,BC
 DEC A
 JR NZ,VSOR1
 LD E,(HL)
 INC HL
 LD D,(HL)
 LD (VSOR+1),DE
 DEC HL
LAP2 LD A,0
 OUT (#B2),A
 EI
 RET
ESCAPE LD DE,FOMENU
 CALL MENUKI
 JP Z,FRISSIT
 LD HL,FOMDAT
 JR MUGRIK
FILEKEZ LD DE,FILMENU
 CALL MENUKI
 JP Z,ESCAPE
 LD HL,FIMDAT
 JR MUGRIK
EDITKEZ LD DE,EDMENU
 CALL MENUKI
 JP Z,ESCAPE
 LD HL,EDITDAT
 JR MUGRIK
OPTKEZ LD DE,OPTMENU
 CALL MENUKI
 JP Z,ESCAPE
 LD HL,OPTADAT
 JR MUGRIK
OFKEZ LD DE,OFMENU
 CALL MENUKI
 JP Z,ESCAPE
 LD HL,OFADAT
 JR MUGRIK
MUGRIK LD B,(HL)
MUGRIK1 INC HL
 CP (HL)
 INC HL
 LD E,(HL)
 INC HL
 LD D,(HL)
 JR Z,MUGRIK2
 DJNZ MUGRIK1
MUGRIK2 EX DE,HL
 JP (HL)
CUT JP ESCAPE
COPY JP ESCAPE
PASTE JP ESCAPE
SBLOKK JP ESCAPE
EBLOKK JP ESCAPE
NEW LD HL,TEXTKEZD
 LD (TEXTEND),HL
 LD (HL),EOF
NEW1 POP AF
 JP KTEXT
*INCLUDE SAVE
*INCLUDE LOAD
MENUKI LD HL,(KURZY)
 PUSH HL
 KURZHOM HL
 LD A,-1
 LD (SORAND+1),A
 EX DE,HL
 CALL UJSORKI
 LD A,#7F
 LD (SORAND+1),A
 POP HL
 LD (KURZY),HL
KEYBE KARBE KEYCSAT
 JR NZ,KEYBE
 LD A,B
 CP ESC
 RES 5,A
 RET
VILI CALL VILLOGO
 LD A,KEYCSAT
 EXOS 9
 INC C
 DEC C
 JR NZ,VILI
 KARBE KEYCSAT
 RET
HLES CALL HELYKER
 POP BC
 LD A,D
 OR E
 JP NZ,CURPOSU
 PUSH BC
 RET
HLRE LD DE,(BFSM)
HLRE1 LD C,1
HLRE2 LD B,1
HLRE3 CALL CPHLDE
 RET Z
 EOFE (DE)
 RET Z
 INC DE
 CP CR
 JR Z,HLRE4
 INC B
 LD A,(MAXOSZ)
 INC A
 CP B
 JR NZ,HLRE3
HLRE4 INC C
 LD A,C
 CP ELINE+1
 JR NZ,HLRE2
 LD (BFSM),DE
 JR HLRE1
SZETEL LD B,1
 EOFE (HL)
 LD C,A
 RET Z
 INC HL
 LD D,(HL)
 INC HL
 EXOS #10
 JR SZETEL
UGRAS ADD A,A
 ADD A,L
 LD L,A
 JR NC,UGR
 INC H
UGR LD A,(HL)
 INC HL
 LD H,(HL)
 LD L,A
 JP (HL)
CRRET LD A,1
 LD (KURZX),A
HELYKER LD HL,(KURZY)
 LD D,L
 LD E,H
 LD HL,(BFSM)
HELYK1 DEC D
 JR Z,HELYK2
 CALL KOVSOR
 JR NC,HELYK1
HELYK2 DEC E
 RET Z
 EOFE (HL)
 RET Z
 CP CR
 RET Z
 INC HL
 JR HELYK2
KOVSOR LD A,(MAXOSZ)
 LD B,A
KOVSOR1 EOFE (HL)
 SCF
 RET Z
 CP CR
 INC HL
 RET Z
 DJNZ KOVSOR1
 OR A
 RET
ELOSOR CALL ELOSO
 RET Z
 LD BC,(MAXOSZ)
 LD B,0
ELOSO1 PUSH BC
 CALL ELOSO
 POP BC
 JR Z,ELOSO2
 LD A,(MAXOSZ)
 ADD A,C
 LD C,A
 ADC A,B
 SUB C
 LD B,A
 JR ELOSO1
ELOSO2 ADD HL,BC
 XOR A
 RET
ELOSO LD DE,TEXTKEZD
 CALL CPHLDE
 SCF
 RET Z
 LD A,(MAXOSZ)
 LD B,A
ELOSOR1 DEC HL
 CALL CPHLDE
 RET Z
 DEC HL
 LD A,(HL)
 INC HL
 CP CR
 RET Z
 DJNZ ELOSOR1
 OR A
 RET
CPHLDE LD A,D
 CP H
 RET NZ
 LD A,E
 CP L
 RET
MARADEK LD D,H
 LD E,L
 LD HL,(TEXTEND)
 OR A
 SBC HL,DE
 LD B,H
 LD C,L
 ADD HL,DE
 INC BC
 RET
RW CALL HELYKER
 LD BC,SZOI
 DEC HL
 LD A,(KURZY)
 PUSH AF
 CALL SZOH
 JR C,RWV
 DEC HL
RWV PUSH HL
 LD DE,(BFSM)
 PUSH DE
 CALL CURPOSU
 POP DE
 POP HL
 POP AF
 PUSH HL
 LD HL,(BFSM)
 OR A
 SBC HL,DE
 POP HL
 JR NZ,RW3
 CP C
 RET Z
 RET C
RW3 PUSH AF
 PUSH HL
 LD (BFSM),DE
 CALL SCRUP
 POP HL
 JR RWV
LW CALL HELYKER
LW1 LD DE,TEXTKEZD
 CALL CPHLDE
 JP Z,CURPOSU
 LD DE,(BFSM)
 CALL CPHLDE
 JR NZ,LW2
 PUSH HL
 CALL SCRDWN
 POP HL
LW2 LD BC,SZOD
 INC HL
 LD DE,(BFSM)
 CALL SZOH
 JR C,LW1
 INC HL
SZOKV JP CURPOSU
SZOD DEC HL
 CALL CPHLDE
 LD A,(HL)
 JR SZOI1
SZOI INC HL
 EOFE (HL)
SZOI1 SCF
 RET Z
 CP CR
 RET Z
 CP SPACE
 RET Z
 CP ","
 SCF
 CCF
 RET
SZOU JP 0
SZOH LD (SZOU+1),BC
 CALL SZOU
 JR NZ,SZOH1
 RET C
SZOH1 CALL SZOU
 JR NZ,SZOH2
 JR NC,SZOH1
 RET
SZOH2 CALL SZOU
 JR NZ,SZOH2
 RET
CURSK CALL CRRET
CURSK0 LD DE,TEXTKEZD
 CALL CPHLDE
 JR Z,CURSK1
 DEC HL
 LD A,(HL)
 CP CR
 INC HL
 JR Z,CURSK1
 CALL ELOSOR
 JR CURSK0
CURSK1 LD DE,(BFSM)
 OR A
 SBC HL,DE
 ADD HL,DE
 JP NC,CURPOSU
 PUSH HL
 CALL SCRDWN
 POP HL
 JR CURSK1
CURF LD A,(KURZY)
 CP SLINE
 JP Z,SCRDWN
 JP DECY
CURL LD A,(KURZY)
 CP ELINE
 JP Z,SCRUP
 JP INCY
CURSV CALL KCRRE
 JR C,CURPOSU
 DEC HL
CURPOSU CALL HLRE
 LD (KURZY),BC
 RET
KCRRE CALL CRRET
ENTER1 CALL KOVSOR
 RET Z
 PUSH HL
 CALL INCY
 POP HL
 JR ENTER1
ENTER LD A,(MODE)
 OR A
 JR NZ,ILINE
 CALL KCRRE
ENTER2 JR C,ILIN
 CALL INCY
 RET
INSERT LD C,SPACE
 LD A,-1
 JR ILINE1
ILIN CALL CURPOSU
ILINE CALL URIT
 CALL HLES
 PUSH HL
 CALL CRRET
 EX (SP),HL
 CALL MARADEK
 LD HL,(TEXTEND)
 LD D,H
 LD E,L
 INC DE
 LD (TEXTEND),DE
 LDDR
 EX DE,HL
 LD (HL),CR
 LD A,1
 LD (KURZX),A
 POP HL
 CALL SOROKKI
 JP INCY
ILINE1 PUSH AF
 LD A,-1
 LD (MODE),A
 LD A,C
 CALL UJWK
 POP AF
 LD (MODE),A
 RET
INSKAP LD A,(MODE)
 CPL
 LD (MODE),A
 RET
TABOL LD A,(KURZX)
 LD C,A
 LD HL,TABSZ
 LD A,(MAXOSZ)
 INC A
 LD D,A
 LD A,1
TABOU ADD A,(HL)
 CP C
 JR C,TABOU
 JR Z,TABOU
 LD E,A
 LD A,(MODE)
 OR A
 LD A,E
 JR NZ,TABINS
 CP D
 JR C,TABJO
 CALL INCY
 LD A,1
TABJO LD (KURZX),A
 RET
TABINS SUB C
 LD B,A
TABTOLT PUSH BC
 LD A,SPACE
 CALL UJWK
 POP BC
 DJNZ TABTOLT
 RET
INCX PUSH AF
 LD A,(MAXOSZ)
 INC A
 LD (INCX1+1),A
 LD A,(KURZX)
 INC A
INCX1 CP 0
 JR NZ,INCX2
 CALL INCY
 LD A,1
INCX2 LD (KURZX),A
INCXV POP AF
 RET
DECX PUSH AF
 LD A,(KURZX)
 DEC A
 JR NZ,INCX2
 CALL DECY
 LD A,(MAXOSZ)
 JR INCX2
INCY PUSH AF
 LD A,(KURZY)
 INC A
 CP ELINE+1
 JR Z,INCY2
INCY1 LD (KURZY),A
INCYV POP AF
 RET
INCY2 PUSH HL
 PUSH DE
 PUSH BC
 CALL SCRUP
INCY3 POP BC
 POP DE
 POP HL
 POP AF
 RET
DECY PUSH AF
 LD A,(KURZY)
 DEC A
 JR NZ,INCY1
DECY1 PUSH HL
 PUSH DE
 PUSH BC
 CALL SCRDWN
 JR INCY3
DLE CALL HLES
 EOFE (HL)
 RET Z
 CP CR
 RET Z
 PUSH HL
 LD A,(KURZX)
 LD B,A
 LD A,(MAXOSZ)
 SUB B
 INC A
 LD B,A
DLE1 INC HL
 EOFE (HL)
 JR Z,KLINE1
 CP CR
 JR Z,KLINE1
 DJNZ DLE1
 JR KLINE1
KLINE CALL HLES
 CALL SORKCIM
 EOFE (HL)
 RET Z
 PUSH HL
 CALL KOVSOR
 JR Z,KLINE1
 DEC HL
KLINE1 PUSH HL
 CALL MARADEK
 POP HL
 POP DE
 LDIR
 EX DE,HL
 DEC HL
 LD (TEXTEND),HL
 JP SROKKI
DELK EOFE (HL)
 RET Z
 CALL MARADEK
 LD (TEXTEND),HL
 LD H,D
 LD L,E
 PUSH HL
 INC HL
 LDIR
 POP HL
 RET
DRALL CALL HLES
 JR DELRUT
DLALL CALL HLES
 CALL DECX
 LD DE,TEXTKEZD
 CALL CPHLDE
 RET Z
 DEC HL
DELRUT CALL DELK
 CALL HLRE
 LD (KURZY),BC
 JP FRISSIT
VILLOGO LD HL,VILLID
 DEC (HL)
 RET NZ
 LD (HL),128
 INC HL
 LD A,(HL)
 CPL
 LD (HL),A
 OR A
 JR Z,KRKI
KRBE LD A,80H
 LD (MASZK+1),A
 LD A,(MODE)
 OR A
 LD A,"Ž"
 JR Z,KRKI2
 LD A,"_"
 JR KRKI2
KRKI LD A,(PFM)
 OR A
 LD HL,(SZURCIM)
 JR NZ,KRKI0
 CALL HELYKER
KRKI0 XOR A
 LD (MASZK+1),A
 LD A,(HL)
 CP CR
 JR Z,KRKI1
 CP EOF
 JR NZ,KRKI11
KRKI1 LD A,SPACE
KRKI11 AND #7F
KRKI2 LD (CHAR+1),A
 CALL KURZVID
 DI
 LD A,-1
 OUT (#B3),A
 DEC A
 OUT (#B2),A
 LD A,(VIDMOD)
 OR A
CHAR LD A,0
 JR Z,HARDCH
 LD IX,#F480
 LD (KRKI5+2),A
 LD B,9
KRKI5 LD A,(IX)
 AND #7E
MASZK OR 0
 LD (HL),A
 LD A,(MAXOSZ)
 LD E,A
 ADD HL,DE
 LD E,#80
 ADD IX,DE
 DJNZ KRKI5
 JR HARDCH1
HARDCH LD C,A
 LD A,(MASZK+1)
 OR C
 LD (HL),A
HARDCH1 LD A,(LAP3+1)
 OUT (#B3),A
 JP LAP2
KURZVID DI
 LD A,-1
 OUT (#B2),A
 LD BC,(KURZY)
 LD HL,#B904
 LD DE,16
KRKI3 ADD HL,DE
 DEC C
 JR NZ,KRKI3
 LD A,(HL)
 INC HL
 LD H,(HL)
 LD L,A
 DEC HL
KRKI4 INC HL
 DJNZ KRKI4
 JP LAP2
KARNYOM PUSH AF
 PUSH HL
 CALL KRKI2
 POP HL
 POP AF
 RET
SORKCIM LD A,(KURZX)
 PUSH AF
 CALL CRRET
 POP AF
 LD (KURZX),A
 RET
SROKKI CALL SORKCIM
SOROKKI LD A,(KURZY)
 LD B,A
 LD A,ELINE
 SUB B
 PUSH AF
 CALL UJSORKI
 POP AF
 RET Z
 LD B,A
SKKI1 PUSH BC
 CALL SORKI
 POP BC
 DJNZ SKKI1
 RET
UJSORKI LD A,(KURZY)
 LD (VSOR0+1),A
SORKI LD IY,SORPUFF
 LD A,(MAXOSZ)
 LD B,A
SKI2 LD C,0
FELBCIM LD DE,0
 OR A
 SBC HL,DE
 ADD HL,DE
 JR NC,SKI22
ALBCIM LD DE,0
 OR A
 SBC HL,DE
 ADD HL,DE
 JR C,SKI22
 LD C,80H
SKI22 EOFE (HL)
 JR Z,SKI3
 CP CR
 INC HL
 JR Z,SKI3
SORAND AND #7F
 OR C
 LD (IY),A
 INC IY
 DJNZ SKI2
SKI3 LD A,(MAXOSZ)
 SUB B
 LD (KSZ+1),A
 LD A,B
 LD (USZ+1),A
 PUSH HL
 CALL VIDSOR
 DI
 LD A,-1
 OUT (#B3),A
 DEC A
 OUT (#B2),A
VSOR LD DE,0
 LD A,(VIDMOD)
 OR A
 JR Z,HARDSOR
 LD (SSP+1),SP
 LD SP,KAROK
 LD C,9
 POP IX
KSZ LD A,0
 OR A
 JR Z,USZ
 LD B,A
 LD HL,SORPUFF
VSKI2 LD A,(HL)
 INC HL
 LD (VSKI3+2),A
 RLCA
 AND 1
 LD (VSKI33+1),A
VSKI3 LD A,(IX)
 AND #7E
VSKI33 OR 00H
 LD (DE),A
 INC DE
 DJNZ VSKI2
USZ LD A,0
 OR A
 JR Z,VSKI5
 LD B,A
 XOR A
VSKI4 LD (DE),A
 INC DE
 DJNZ VSKI4
VSKI5 POP IX
 DEC C
 JR NZ,KSZ
SSP LD SP,0
 JR SORKESZ
HARDSOR LD HL,SORPUFF
 LD A,(KSZ+1)
 OR A
 JR Z,HARDS1
 LD C,A
 LD B,0
 LDIR
HARDS1 LD A,(USZ+1)
 OR A
 JR Z,SORKESZ
 LD B,A
 LD A,SPACE
HARDSC LD (DE),A
 INC DE
 DJNZ HARDSC
SORKESZ LD A,(VSOR0+1)
 INC A
 CP ELINE+1
 JR Z,LAP3
 LD (VSOR0+1),A
LAP3 LD A,0
 OUT (#B3),A
 LD A,(LAP2+1)
 OUT (#B2),A
 EI
 POP HL
 RET
UJWK LD (CHAR+1),A
 LD A,(PFM)
 OR A
 JR NZ,PUFFOG
 CALL HLES
 EOFE (HL)
 JR Z,PUFFOG
 CP CR
 JR Z,PUFFOG
 LD A,(MODE)
 OR A
 JR Z,NPUFFOG
PUFFOG CALL PUFOG
 LD A,(CHAR+1)
 CP CR
 CALL Z,URIT
 JR KIADAS
NPUFFOG LD A,(CHAR+1)
 LD (HL),A
 INC HL
 PUSH HL
 LD HL,KARNYOM
 LD (JELRUT+1),HL
 POP HL
KIADAS CALL KIJELEZ
 LD A,(CHAR+1)
 CP CR
 JP NZ,INCX
 LD A,1
 LD (KURZX),A
 JP INCY
KIURIT LD A,(PFM)
 OR A
 RET Z
 LD A,B
 LD HL,SPECTAB
 LD BC,SPTABHO
 CPIR
 RET Z
 CALL URIT
KIJELEZ LD A,(CHAR+1)
JELCIM LD HL,0
JELRUT JP 0
PUFINIC LD A,-1
 LD (PFM),A
 CALL SORKCIM
 LD (SORCIM),HL
 CALL KOVSOR
 LD A,(MAXOSZ)
 SUB B
 INC A
 LD (UJSORHO),A
 LD (SORHO),A
 LD HL,(SORCIM)
 LD DE,PUFTAR
 LD BC,160
 LDIR
 LD A,(KURZX)
 LD C,A
 DEC C
 LD HL,PUFTAR
 ADD HL,BC
 LD (SZURCIM),HL
 LD HL,PUFTAR
 LD (JELCIM+1),HL
 LD HL,UJSORKI
 LD (JELRUT+1),HL
 RET
PUFOG LD A,(PFM)
 OR A
 CALL Z,PUFINIC
 LD HL,UJSORHO
 INC (HL)
 LD HL,(SZURCIM)
 LD BC,81
 ADD HL,BC
 LD D,H
 LD E,L
 DEC HL
 LDDR
 LD HL,CHAR+1
 LDI
 LD (SZURCIM),DE
 LD A,(MAXOSZ)
 LD B,A
 LD A,(KURZX)
 CP B
 RET NZ
URIT LD A,(PFM)
 OR A
 RET Z
 LD A,(UJSORHO)
 LD E,A
 LD A,(SORHO)
 CP E
 PUSH AF
 CALL NC,DELURIT
 POP AF
 RET NC
NURIT LD HL,(SORCIM)
 PUSH HL
 CALL KOVSOR
 POP HL
 LD BC,(SORHO)
 LD B,0
 JR NC,NURIT0
 LD A,(UJSORHO)
 LD C,A
 EX DE,HL
 LD HL,PUFTAR
 LDIR
 DEC DE
 EX DE,HL
 LD (TEXTEND),HL
 JR URIT1
NURIT0 ADD HL,BC
 CALL MARADEK
 LD HL,(TEXTEND)
 LD A,(SORHO)
 LD E,A
 LD A,(UJSORHO)
 SUB E
 LD E,A
 LD D,0
 EX DE,HL
 ADD HL,DE
 LD (TEXTEND),HL
 EX DE,HL
 LDDR
 LD BC,(UJSORHO)
 LD B,0
 LD HL,PUFTAR-1
 ADD HL,BC
 LDDR
URIT1 LD A,B
 LD (PFM),A
URIT2 LD HL,(SORCIM)
 LD (JELCIM+1),HL
 LD HL,SROKKI
 LD (JELRUT+1),HL
 RET
DELURIT JR NZ,DELUR1
 LD C,A
 LD B,0
 LD HL,PUFTAR
 LD DE,(SORCIM)
 LDIR
 JR URIT1
DELUR1 XOR A
 LD (PFM),A
 LD B,A
 LD HL,PUFTAR
 LD DE,(SORCIM)
 LD A,(UJSORHO)
 OR A
 JR Z,UJDUR1
 LD C,A
 LDIR
 DEC DE
 EOFE (DE)
 EX DE,HL
 JR Z,UJDUR2
 EX DE,HL
 INC DE
UJDUR1 LD HL,(SORCIM)
 LD BC,(SORHO)
 LD B,0
 ADD HL,BC
 PUSH HL
 PUSH DE
 CALL MARADEK
 POP DE
 POP HL
 LDIR
 EX DE,HL
 DEC HL
UJDUR2 LD (TEXTEND),HL
 JR URIT2
DELJOB CALL HLES
 LD A,(PFM)
 OR A
 CALL Z,PUFINIC
 LD HL,(SZURCIM)
 EOFE (HL)
 JR Z,DJ1
 CP CR
 JR NZ,DJ2
DJ1 CALL URIT
 JP DRALL
DJ2 LD A,(UJSORHO)
 DEC A
 LD (UJSORHO),A
 LD D,H
 LD E,L
 INC HL
 LD BC,80
 LDIR
 JP KIJELEZ
DELBAL LD A,(PFM)
 OR A
 JR NZ,DLM
 CALL HLES
 CALL PUFINIC
DLM LD A,(KURZX)
 DEC A
 JR NZ,DLM1
 CALL URIT
 JP DLALL
DLM1 LD HL,(SZURCIM)
 LD DE,TEXTKEZD
 CALL CPHLDE
 JR Z,DELB2
 LD A,(UJSORHO)
 DEC A
 LD (UJSORHO),A
 LD BC,80
 LD HL,(SZURCIM)
 LD D,H
 LD E,L
 DEC DE
 LD (SZURCIM),DE
 LDIR
 LD A,(UJSORHO)
 OR A
 JR Z,DELB2
 LD A,(KURZX)
 DEC A
DELB2 CALL Z,URIT
 CALL KIJELEZ
 CALL DECX
 RET
USERKUR CALL HELYKER
 LD A,D
 OR E
 RET Z
 JP CURPOSU
CFIND CALL USERKUR
 EOFE (HL)
 JP Z,FRISSIT
 INC HL
 JR FINDC1
FIND CALL WHAT
 JP C FRISSIT
 CALL USERKUR
FINDC1 EOFE (HL)
 JP Z,FRISSIT
 PUSH HL
 LD DE,FINDTAR
 LD A,(DE)
 LD B,A
 INC DE
FINDC2 LD A,(DE)
 CP (HL)
 JR NZ,FIND1
 INC HL
 INC DE
 DJNZ FINDC2
 POP HL
 CALL HLRE
 LD (KURZY),BC
 JP FRISSIT
FIND1 POP HL
 INC HL
 JR FINDC1
WHAT LD HL,FINDWHAT
 LD DE,FINDTAR
 JR NEVET1
NEVBE LD HL,NEVKERES
 LD DE,UJNEV
NEVET1 LD (IDEKELL+1),DE
 LD DE,NEVPUFF
 LD BC,13
 LDIR
 LD HL,(KURZY)
 PUSH HL
 LD HL,(BFSM)
 PUSH HL
 LD HL,(TEXTEND)
 PUSH HL
 LD HL,NEVPUFF+40
 LD (TEXTEND),HL
 LD HL,NEVPUFF
 LD (BFSM),HL
 LD HL,0D01H
 LD (KURZY),HL
 LD HL,NEVHO
 LD (HL),0
 LD HL,NEVPUFF+12
 LD (NEVCIM),HL
 LD B,28
NEVBE1 PUSH BC
 LD HL,NEVPUFF
 CALL UJSORKI
NEVBE2 CALL VILI
 CP ESC
 JR NZ,NKIUG
 POP BC
 POP HL
 LD (TEXTEND),HL
 POP HL
 LD (BFSM),HL
 POP HL
 LD (KURZY),HL
 SCF
 RET
NKIUG LD A,B
 CP CR
 JR Z,NEVBEVEG
 CP SPACE
 JR C,NEVBE2
 CP #A4
 JR NZ,NTOROL
 LD HL,NEVHO
 LD A,(HL)
 OR A
 JR Z,NEVBE2
 DEC (HL)
 LD HL,(NEVCIM)
 DEC HL
 LD (NEVCIM),HL
 LD (HL),CR
 CALL DECX
 POP BC
 INC B
 JR NEVBE1
NTOROL CP -1
 JR NC,NEVBE2
 LD HL,(NEVCIM)
 LD (HL),A
 INC HL
 LD (HL),CR
 LD (NEVCIM),HL
 LD HL,NEVHO
 INC (HL)
 CALL INCX
 POP BC
 DJNZ NEVBE1
 PUSH BC
NEVBEVEG POP BC
 LD HL,NEVHO
 LD C,(HL)
IDEKELL LD DE,UJNEV
 LDI
 INC C
 INC C
 LD B,0
 LD HL,NEVPUFF+12
 LDIR
 POP HL
 LD (TEXTEND),HL
 POP HL
 LD (BFSM),HL
 POP HL
 LD (KURZY),HL
 OR A
 RET
FINDTAR DEFS 80
NEVPUFF DEFS 80
FINDWHAT DEFM "Find what ? "
 DEFB CR
NEVKERES DEFM "File name ? "
 DEFB CR
NEVHO DEFB 0
NEVCIM DEFW 0
UJNEV DEFS 41
FOMDAT DEFB 5,"F"
 DEFW FILEKEZ
 DEFB "E"
 DEFW EDITKEZ
 DEFB "O"
 DEFW OPTKEZ
 DEFB "X"
 DEFW STOP
 DEFB 0
 DEFW ESCAPE
FIMDAT DEFB 5,"L"
 DEFW LOAD
 DEFB "N"
 DEFW NEW
 DEFB "S"
 DEFW SAVE
 DEFB "A"
 DEFW SAVEAS
 DEFB 0
 DEFW FILEKEZ
EDITDAT DEFB 7,"S"
 DEFW SBLOKK
 DEFB "E"
 DEFW EBLOKK
 DEFB "C"
 DEFW CUT
 DEFB "P"
 DEFW PASTE
 DEFB "Y"
 DEFW COPY
 DEFB "F"
 DEFW FIND
 DEFB "N"
 DEFW CFIND
OPTADAT DEFB 3,"F"
 DEFW ESCAPE
 DEFB "I"
 DEFW OFKEZ
 DEFB "E"
 DEFW ESCAPE
OFADAT DEFB 4,"A"
 DEFW ASCVALT
 DEFB "M"
 DEFW MONVALT
 DEFB "S"
 DEFW ASMVALT
OFMENU DEFB "A"+128
 DEFM "SCII "
 DEFB "M"+128
 DEFM "on-gen A"
 DEFB "s"+128
 DEFM "mon-fenas"
 DEFB CR
OPTMENU DEFB "F"+128
 DEFM "keys F"
 DEFB "i"+128
 DEFM "les "
 DEFB "E"+128
 DEFM "diting "
 DEFB CR
EDMENU DEFB "S"+128
 DEFM "tart-"
 DEFB "E"+128
 DEFM "nd block "
 DEFB "C"+128
 DEFM "ut "
 DEFB "P"+128
 DEFM "aste Cop"
 DEFB "y"+128,SPACE
 DEFB "F"+128
 DEFM "ind "
 DEFB "N"+128
 DEFM "ext "
 DEFB CR
FILMENU DEFB "N"+128
 DEFM "ew "
 DEFB "L"+128
 DEFM "oad "
 DEFB "S"+128
 DEFM "ave Save "
 DEFB "A"+128,"s"
 DEFB CR
FOMENU DEFB "F"+128
 DEFM "ile "
 DEFB "E"+128
 DEFM "dit "
 DEFB "O"+128
 DEFM "ptions E"
 DEFB "x"+128
 DEFM "it"
 DEFB CR
UJFILE DEFB 3
 DEFM "TNT"
FILENEV DEFB 3
 DEFM "TXT"
UJSORHO DEFB 0
KAROK DEFW #F480,#F500,#F580,#F600,#F680,#F700,#F780,#F800,#F880
CTRTAB DEFW ESCAPE
 DEFW LW
 DEFW MODKAP
 DEFW PGDWN
 DEFW INCX
 DEFW CURF
 DEFW RW
 DEFW DELBAL
 DEFW DELJOB
 DEFW TABOL
 DEFW ESCAPE,ESCAPE,ESCAPE
 DEFW ENTER
 DEFW ILINE,CFIND
 DEFW ESCAPE,STOP
 DEFW PGUP
 DEFW DECX
 DEFW ESCAPE
 DEFW ESCAPE
 DEFW INSKAP
 DEFW ESCAPE
 DEFW CURL
 DEFW KLINE
 DEFW ESCAPE;KTEXT
 DEFW ESCAPE
 DEFW ESCAPE,ESCAPE,ESCAPE
DELTAB DEFW DELJOB,DLE,KLINE,KLINE
 DEFW DELBAL,STOP,STOP,STOP
 DEFW INSERT,ILINE,INSKAP,INSKAP
JOYTAB DEFW CURF,PGDWN,THOME,THOME
 DEFW CURL,PGUP,TEND,TEND
 DEFW DECX,CURSK,LW,LW
 DEFW INCX,CURSV,RW,RW
COLORS DEFB ESC,"C"
PAPIR DEFB #A0,#23,#A0,#5B,#23,#A0,#59,#A0
KURZY DEFB 1
KURZX DEFB 1
EXDOS DEFB 5
 DEFM "EXDOS"
VIDEO DEFB 6
 DEFM "VIDEO:"
KEYBOARD DEFB 9
 DEFM "KEYBOARD:"
VIDDATA DEFB 22
VIDMOD DEFB 2
 DEFB 23,0,24
 DEFB VIDX,25,VIDY
KEYSPAR DEFB 10,1,11,16,EOF
MAXOSZ DEFB 40
MODE DEFB 0
TABSZ DEFB 8
TEXTEND DEFW 0
BFSM DEFW 0
SPECTAB DEFB 7,8,9,#A8,#A4,#A0
SPTABHO EQU $-SPECTAB
PFM DEFB 0
SORHO DEFB 0
SZURCIM DEFW 0
SORCIM DEFW 0
VILLID DEFB #55,0
RAMTOP DEFW 8000H
PUFTAR EQU $
SORPUFF EQU PUFTAR+161
FPUF EQU SORPUFF+82
TEXTKEZD EQU FPUF+FPUFHO
