10
11
12
13
20 :
30 src$="ROM"
40 dest$="DISK"
50 IF PAGE<&E00 OR HIMEM>&8000:PRINT"Must run in I/O processor":END
60 max%=HIMEM-LOMEM-400:DIM mem% max%:last$=""
70 REPEAT:OSCLI src$
80 REPEAT
90 in%=OPENIN(""):PROCfn
100 IF last$<>"":CLOSE#in%
110 UNTIL last$="" OR fn$=last$
120 in%=OPENIN(""):PROCfn
130 len%=0:ld%=!&3BE:ex%=!&3C2
140 PRINT fn$,~ld%,~ex%;
150 REPEAT IF NOT EOF#in%:mem%?len%=BGET#in%:len%=len%+1
160 UNTIL EOF#in% OR len%>max%:CLOSE#in%:PRINT~len%;:OSCLI dest$
170 A%=MID$(fn$,2,1)=".":fn$=LEFT$(fn$,7-2*A%)
180 IF len%<max%:OSCLI"SAVE "+fn$+" "+STR$~mem%+"+"+STR$~len%+" "+STR$~ex%+" "+STR$~ld% ELSE PRINT'"File too long for buffer";
190 PRINT:UNTIL FALSE
200 DEFPROCfn:?&3BE=13:fn$=$&3B2+CHR$0:fn$=LEFT$(fn$,INSTR(fn$,CHR$0)-1):ENDPROC