KAROM1 equ 27h
KAROM2 equ 22h
SAVEAS CALL NEVBE
SAVE LD DE,UJNEV
 LD A,(DE)
 OR A
 JR Z,SAVEAS
 LD A,FILECSAT
 EXOS 2
 LD HL,TEXTKEZD
 LD DE,FPUF
 LD BC,FPUFHO
SAVMOD CALL ASCMENT
 LD HL,FPUFHO
 OR A
 SBC HL,BC
 JR Z,SAVE1
 LD B,H
 LD C,L
 LD DE FPUF
 LD A,FILECSAT
 EXOS 8
SAVE1 EXCLOSE FILECSAT
 JP FRISSIT
PUFFBA LD (DE),A
 INC DE
 DEC BC
 LD A,B
 OR C
 RET NZ
 BLOUT FILECSAT FPUF FPUFHO
 LD DE,FPUF
 LD BC,FPUFHO
 RET
MONMENT XOR A
 LD (IDJEL+1),A
MONMC LD A,(HL)
 CP EOF
 RET Z
 CALL PUFFBA
 LD A,(HL)
 CP CR
 JR NZ,MONSAV0
 LD A,LF
 CALL PUFFBA
 INC HL
 JR MONMC
MONSAV0 CP KAROM1
 JR Z,IDJELV
 CP KAROM2
 JR NZ,IDJEL
IDJELV LD A,(IDJEL+1)
 CPL
 LD (IDJEL+1),A
IDJEL LD A,0
 OR A
 LD A,(HL)
 INC HL
 JR NZ,MONMC
MONSAV1 CP SPACE
 JR NZ,MONMC
MONSAV2 CP (HL)
 JR NZ,MONMC
 INC HL
 JR MONSAV2
ASCMENT LD A,(HL)
 CP EOF
 RET Z
 CALL PUFFBA
 LD A,(HL)
 CP CR
 INC HL
 JR NZ,ASCMENT
 LD A,LF
 CALL PUFFBA
 JR ASCMENT
ASMMENT LD A,(HL)
 CP EOF
 RET Z
 CP SPACE
 JR NZ,ASMM1
 PUSH BC
 LD B,7FH
ASMM0 INC HL
 INC B
 CP (HL)
 JR Z,ASMM0
 LD A,B
 POP BC
 CALL PUFFBA
 JR ASMMENT
ASMM1 CALL PUFFBA
 LD A,(HL)
 CP CR
 INC HL
 JR NZ,ASMMENT
 LD A,LF
 CALL PUFFBA
 JR ASMMENT
