>BACKUP v1.20 01-Dec-1998 P4&87:A$=OS_GetEnv:quit$=cl(" -q",1):::end ZRcl("-?",0):"Syntax: "run$" ( ( ) (-t )":end d:init:"BACKUP PROGRAM 1.20. Buffer size: &";~maxlen%' n:Close:end x fs%=fs:params:backup:end  ?init:OSWORD=&FFF1:OSGBPB=&FFD1:maxlen%=(--3000)&FFFF00 8ctrl%30,data%maxlen%:X%=ctrl%:Y%=X%256:name%=data%  'Close:fs%<>fs:"FX143,18,"+fs% "ch%=ch%:ch%:A%=ch%:ch%=0:#A%  ,Drd(Ad%,Dv%,Sc%,Nm%):dsk(&53,sdrv$): ,Dwr(Ad%,Dv%,Sc%,Nm%):dsk(&4B,ddrv$): *dsk(Cmd%,fn$):Derr%=0:Dv%=-1:gpb: #"FX143,18,4":Nm0%=Nm%:A%=&7F: 3Num%=Nm%256:Num%+(Sc%10)>10:Num%=10-(Sc%10) try%=tries%: "=?X%=Dv%:X%!1=Ad%:X%?5=3:X%?6=Cmd%:X%?7=Sc%10:X%?8=Sc%10 ,0X%!9=Num%32:X%?7>79:X%?7=X%?7-80:?X%=?X%2 6%13:Cmd%=&53:"Read ";"Write"; @I" "h0(Dv%,1)":"h0(Sc%,6)"+"h0(Nm%256,2)" "h0(tries%-try%,1)" "; J3OSWORD:Derr%=X%?10:try%=try%-1:Derr%=0try%=0 T,Derr%:err(Derr%);(39-);:Nm%=&100: ^gCmd%=&53Derr%=0:;read%+Nm0%-Nm%;" bytes read";Cmd%=&4BDerr%=0;write%-Nm0%+Nm%;" bytes left"; h<(39-);:Ad%=Ad%+Num%*256:Sc%=Sc%+Num%:Nm%=Nm%-Num%*256 r$Nm%<1Derr%:"FX143,18,"+fs%: 0ݤerr(A%):A%<&08A%>&18:="Error "+h0(A%,2) ="Clock errorID CRC errorData CRC errorNot readyWrite protectedTrack 0 not foundSector not found","010012243847620079",A%-7,2),"110012140915170016",A%-7,2)) Cgpb:Sc%=Sc%*256:A%=fn$,":",2):A%:fn$,A%-1):fn$=fn$,A%+1) ?Cmd%=&53:A%=3:ch%=(fn$)A%=1:Sc%=0:ch%=(fn$)ch%=(fn$) V?X%=ch%:X%!1=Ad%:X%!5=Nm%:X%!9=Sc%:OSGBPB:#ch%:ch%=0:fs<>fs%:"FX143,18,"+fs%   params 9spt%=cl("-s",1):tries%=cl("-t",1):sdrv$=cl("",1) 5ddrv$=cl("",1):trk%=cl("",1):sides%=cl("",1) Bsdrv$="":trk%=-1:"Source drive: "sdrv$:"Dest. drive: "ddrv$ 5sdrv$=fsn(sdrv$):sdrv%=-1:sdrv$=1:sdrv%=sdrv$ 5ddrv$=fsn(ddrv$):ddrv%=-1:ddrv$=1:ddrv%=ddrv$ &-1:same%:"Using same drive." 0trk%=-1:"Number of tracks (80) "trk%:"Number of sides (2) "sides%:"Number of tries (10) "tries%:"Press a key to backup from "sdrv$" to "ddrv$;:祄1' :spt%=0:spt%=10 Dtrk%=0:trk%=80 Nsides%=0:sides%=2 Xtries%=0:tries%=10 b v backup 8read%=0:write%=2560*trk%*sides%:s%=0(sides%-1)*22 Gsect%=0:length%=trk%*2560::num%=maxlen%:num%>length%:num%=length% Isame%:13"Insert source disk and press a key";:祄1:13;(39);13; KDrd(data%,(sdrv%+s%)(sdrv%<0),sect%-(spt%*trk%)*(s%=2sdrv%<0),num%)  Derr%:num%=(num%&FFFE00)2 +Derr%=0num%<&100:num%<&100:num%=&100 'Derr%=0num%=&100:read%=read%+num% Hsame%:13"Insert dest. disk and press a key";:祄1:13;(39);13; KDwr(data%,(ddrv%+s%)(ddrv%<0),sect%-(spt%*trk%)*(s%=2ddrv%<0),num%)  Derr%:num%=(num%&FFFE00)2 5Derr%=0Derr%=&12num%<&100:num%<&100:num%=&100 )Derr%=0num%=&100:write%=write%-num%  CDerr%=&12:'"Destination disk write protected":length%=0:s%=99 -sect%=sect%+num%256:length%=length%-num%  'length%<1Derr%=&12:s%:13;(39) *ddrv%>-1: 4:Close:end >9A%=ddrv$,":",2):A%:ddrv$,A%-1):ddrv$=ddrv$,A%+1) H4X%!2=&FFFB2200:A%=file(ddrv$,2):"Stamp "+ddrv$ R Close: f`ݤfsn(A$):A$,1)="-":A%=A$,"-",2):A%:B%=A$,"."):B%=0B%>A%:A$=A$,2,A%-2)+":"+A$,A%+1) p=A$ z#ݤh0(A%,N%)="0000000"+~A%,N%) #ݤfs:A%,X%,Y%,E%:=(&FFDA)&FF Bݤfile(A$,A%):$name%=A$:?X%=data%:X%?1=data%256:=(&FFDD)&FF lݤOS_GetEnv:>&FFFF:run$=$&8100:ș16A$,,A%:ș72,"",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ 0A$=0:?(P-3):A$=$&600A$=0:A$=$(-&300) *Y%=-10:A$=" "+A$:A$=A$,2):A$<>32 4Y%:A$=34:A%=A$,"""",2)+1Y%:A%=A$+" "," ") CY%:run$=A$,1-(A$=34),A%-1+2*(A$=34)):run$<>"":A$=A$,A%+1)  :=A$ cݤcl(l$,n%):l$="":A$=s(A$):A$=34:A%=A$+" "" ",""" ",2):l$=A$,2,A%-2):A$=s(A$,A%+1)):=l$ "":A%=A$,l$):A%:A$=s(A$,A%-1)+A$,A$," ",A%)+1))+" ":= n%=0:l$<>"":= %A%=" ",l$=32)+A$,l$):A%=0:="" 'A$=A$,A%-1)+s(A$,A$," ",A%)+1)) Cl$=32:l$=A$,A%):A$=A$,A%-1):=l$,1-(l$=34),l$+2*(l$=34)) PA$,A%,1)<>34:l$=A$,A%,A$+" "," ",A%)-A%):A$=A$,A%-1)+A$,A%+l$+1):=l$ $Jl$=A$,A%+1,A$+""" ",""" ",A%+1)-A%-1):A$=A$,A%-1)+A$,A%+l$+3):=l$ ./ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " 8+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " B=A$ L&os(A$):A$=""A$=42:A$:A$: V.end:quit$<>"":A$=quit$:quit$="":os(A$) `A$=13::   ?{   "  X{L{LQ%=PA.:CH."* BASIC s{l{t{R{R{`m{`` X{,z0ȱ4i{` ee  { {4i{{꩏ `