> InsertFile * Insert file into BSD2.11 disk images : (disk$="2.11BSD_rq.dsk" 2disk$="bsd2-11.dsk" <: Fwr%=2:rd%=4:blsz%=512 P5 ctrl% 31,mem% blsz%-1,chk% 7:X%=ctrl%:Y%=X%256 Z ::CloseAll:: d "File to import: "in$ n%in%=(in$): in%=0:in%=(in$+".") x' in%=0:"File '"in$"' not found": Fup%=(disk$): up%=0:"Disk image '"disk$"' not found":CloseAll: : $chk%="FILE" ptr%=0:ext%=#up% (done%=0:size%=(#in%+blsz%-1)-blsz%  $gbpb(rd%-1,up%,mem%,blsz%,ptr%)  !mem%=!chk%:sector ptr%=ptr%+blsz%  done%>=size% ptr%>=ext%  CloseAll  0,25);"Press a key";: Ș :  sector ";fail%=mem%?4<>32: A%=8 blsz%-1: mem%?A%<>32:fail%= , A%: fail%: 6/ A%=5 7: mem%?A%>95:mem%?A%=mem%?A%&DF @%:mem%?8=13:sec%=("&"+$(mem%+5)) J$40*(sec% 24),1+(sec% 24)); T"Offset: &";$(mem%+5); ^ sec%*blsz%>size%:: h*gbpb(rd%-1,in%,mem%,blsz%,sec%*blsz%) r$gbpb(wr%-1,up%,mem%,blsz%,ptr%) done%=done%+blsz% " ";done%;" of ";size%  : : CloseAll "up%=up%:up%:A%=up%:up%=0:#A% "in%=in%:in%:A%=in%:in%=0:#A%  : #gbpb(A%,chn%,addr%,num%,ptr%) >?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:<&FFFFF:&FFD1: A%=1A%=3:#?X%=X%!9 5:A%=1A%=2:#?X%,?X%!1 A%=3A%=4:?X%!1=#?X% 5X%!1=X%!1+1:X%!5=X%!5-1:(#?X% A%>2) X%!5<1: