                ORG 100H
                LD SP,100H
                LD A,0FBH
                OUT (0B3H),A
                DEC A
                OUT (0B2H),A
                LD A,0FDH
                OUT (0B1H),A
                LD A,1
                LD DE,FILE
                EXOS 1
                LD HL,TOMO
                LD DE,3000H
                LD BC,1000H
                LDIR
                LD DE,100H
                JP 3000H
FILE            DEFB 7,"PRG.TOM"
TOMO EQU $
                .PHASE 3000H
        push de ;celcim
                LD A,1
                EXOS 5
                LD L,B
                LD A,1
                EXOS 5
                LD C,L
                POP DE
                PUSH BC
                PUSH DE
        ld hl,0
        and a
        sbc hl,bc
        ex de,hl
        push de
        ld a,1
        exos 6
        pop hl
        ld a,(hl)
        inc hl    ;forras
        EX AF,AF'
 ;      ld hl,forras
        pop de
 ;      ld de,cel
        pop bc
        dec bc
 ;      ld bc,hossz
cik     EX AF,AF'
        cp (hl)
        jr nz,sima
                EX AF,AF'
        inc hl
        push bc
        ld b,(hl)
        inc hl
        ld a,(hl)
rak     ld (de),a
        inc de
        djnz rak
        pop bc
        dec bc
        dec bc
        jr tov
SIMA    EX AF,AF'
        ld a,(hl)
        ld (de),a
        inc de
tov     inc hl
        dec bc
        ld a,b
        or c
        jr nz,cik
        JP 100H
        .DEPHASE
VEGE            NOP