EXOS MACRO @P
 RST 30H
 DEFB @P
 ENDM
SZEGTAR EQU 20H
 ENT $
BETOLTO PUSH DE
 LD A,1
 LD DE,TFILEH
 LD BC,11
 EXOS 6
 AND A
 JP NZ,HIBA
 LD A,1
 LD DE,TAB
 LD BC,(RENDH)
 LD A,C
 AND A
 LD A,1
 JR NZ,TABTOLT
 LD B,A
TABTOLT EXOS 6
 CALL TABOFFS
 EXX
 LD D,1
 LD L,0
 CALL BEOLVAS
 CALL UJAT
 EXX
 LD BC,(FILEH)
 POP HL
 DI
ROBBANT PUSH HL
 PUSH BC
 CALL BYTEBE
 LD E,1
 LD D,A
COMPARE LD A,(JEL)
 CP D
 JR NZ,ROBB1
 CALL BYTEBE
 LD E,A
 CALL BYTEBE
 LD D,A
ROBB1 POP BC
 POP HL
ROBB2 CALL SZEGLAP
 INC HL
 DEC BC
 LD A,B
 OR C
 RET Z
 DEC E
 JR NZ,ROBB2
 JR ROBBANT
SZEGLAP PUSH HL
 LD A,H
 LD HL,SZEGTAR
SZEGET SUB 40H
 JR C,SZEGKESZ
 INC HL
 JR SZEGET
SZEGKESZ LD A,(HL)
 OUT (0B1H),A
 POP HL
 PUSH HL
 LD A,H
 AND 03FH
 OR 40H
 LD H,A
 LD A,D
 LD (HL),D
 OUT (81H),A
 LD A,(SZEGTAR+1)
 OUT (0B1H),A
 POP HL
HIBA RET
TABOFFS LD IX,RENDSZER
 LD B,(IX)
 LD H,1
TABOFF1 RLC H
 DJNZ TABOFF1
 LD L,B
 LD (OFF1),HL
 LD B,(IX+1)
 LD A,1
TABOFF2 RLCA
 DJNZ TABOFF2
 ADD A,H
 LD L,A
 LD B,(IX+2)
 LD A,1
TABOFF3 RLCA
 DJNZ TABOFF3
 ADD A,L
 LD H,A
 LD (OFF1+2),HL
 RET
BYTEBE EXX
 LD BC,200H
BEVBIT RL E
 RL C
 RLC D
 CALL C,UJAT
 DJNZ BEVBIT
 PUSH BC
 EXX
 POP BC
 LD HL,OFF1
 ADD HL,BC
 LD C,(HL)
 LD HL,TAB
 ADD HL,BC
 PUSH HL
 EXX
 PUSH BC
 EXX
 POP BC
 LD HL,RENDSZER
 ADD HL,BC
 LD A,(HL)
 EXX
 LD B,A
 LD C,0
DATBIT RL E
 RL C
 RLC D
 CALL C,UJAT
 DJNZ DATBIT
 PUSH BC
 EXX
 POP BC
 POP HL
 ADD HL,BC
 LD A,(HL)
 LD C,A
 RET
UJAT LD E,(IX)
 INC IX
 DEC L
 RET NZ
BEOLVAS PUSH BC
 PUSH DE
 LD DE,PUFFER
 PUSH DE
 LD BC,(TFILEH)
 LD A,B
 AND A
 JR Z,BEOLV1
 DEC A
 LD (TFILEH+1),A
 LD BC,100H
BEOLV1 LD A,1
 EXOS 6
 POP IX
 POP DE
 POP BC
 DI
 RET
TFILEH DEFS 2
FILEH DEFS 2
JEL DEFS 1
RENDSZER DEFS 4
RENDH DEFS 2
OFF1 DEFS 4
TAB DEFS 100H
PUFFER DEFS 100H
 DEFM "ATTUS"
