> UxFiler/src 1.32 8 05-Oct-2007 v0.10 Initial version based on SJFiler $ 08-Feb-2008 v0.11 IMPORT added (8 22-Aug-2008 v0.12 Reads UFSv7 images, EXPORT works 2U 21-Jan-2012 v0.13 EXPORT doesn't match EX, save doesn't create empty *.bbc file &7C00:&83:>&4000:&80 <&FFFF:=fx(132,0) init:hdr:: err: :X%=ctrl%:Y%=X%256: :  8:wdt%=+1: )drv$="":(D%+48)">"; "["drv$"]"; "csd%=home%:" "A$:do(s(A$))  : 'init:ver$="1.32":bsz%=1024:fsv%=6  ctrl% 127,name% 255,zp% 7,data% bsz%-1,data2% bsz%-1,ientry% 63,dir% bsz%+4,object% 63,thisdir% 63,diskrec% 255 (os%=6) ZX%=ctrl%:Y%=X%256:res%=0:D%=0:dmk%=&FFFF:drv$="":path$="/":title$="":home%=-1:csd%=-1 @fs%=fs:d$=".":s$="/":os%-24:d$="/":s$=".":os%-32:d$="\" Ucmd$=":MOUNT:DIR:CD:CAT:EX:LS:INFO:TYPE:DUMP:IMPORT:EXPORT:FREE:BLOCK:HELP:QUIT:" "hlp$=":|:|&:|&::::(): [CTRLS]: [7BIT]: (): ():::::" , 6-hdr:"UxFiler v"ver$" by J.G.Harston": @: Jݤerr:"FX229": : T!:fs<>fs%:"FX143,18,"+fs% ^ECloseAll:A%=<>17 <>28:" at line "+Þ,<128 A%):=-1 A% h-CloseAll:in%=in%:in%:A%=in%:in%=0:#A% r'out%=out%:out%:A%=out%:out%=0:#A% |'dsk%=dsk%:dsk%:A%=dsk%:dsk%=0:#A%  : 6do(A$):A$="?":A$="HELP" A$="EXIT":A$="QUIT"  A$,1)=";" A$="":  A$,1)="*":A$,2): ! A$,1)=".":A$="CAT "+A$,2) 6A%=A$+" "," "):B$=uc(A$,A%-1)):A$=s(A$,A%+1)) ) B$="COPY":"Use EXPORT or IMPORT": 3 B$=1 "0123",B$):drv$="":D%=B$:home%=-1: 0A%=cmd$,":"+B$+":"): A%=0:"Bad command": A%=("FN_"+B$+"(A$)"): : 1ݤsyn(S$): A$="": "Syntax: "B$" "S$:= = :  Commands  ======== &W; _INFO, _QUIT, _FREE, _DIR, _MOUNT, _LS, _EXPORT, _CD : Prevent crunching 0<; _HELP, _TYPE, _DUMP, _CAT, _BLOCK, _EX, _IMPORT :: Dݤ_QUIT(A$):"Quit" N X os%>5:*QUIT b l: v ݤ_HELP(A$):hdr:p%=2:q%=2: 1A%=cmd$,":",p%): 2cmd$,p%,A%-p%);:p%=A%+1 1A%=hlp$,":",q%): 9)hlp$,q%,A%-q%):q%=A%+1  p%>cmd$:=0 : ?ݤ_MOUNT(A$):home%=-1: A$<2:do(A$):=0 drv$=A$:D%=-1:=0 ݤ_CAT(A$):LstDir(0):=0 ݤ_EX(A$):LstDir(1):=0 : ݤ_LS(A$)=_EX(A$) ݤ_CD(A$)=_DIR(A$) " DEFFN_COPY(A$)=FN_EXPORT(A$) : 3ݤ_DIR(A$):curr%=-1: syn("|&"):= E A$,1)="&":A%=Mount:home%=(uc(A$)):path$="&"+h0(home%,6):=0  / A$="/":A%=Mount:home%=root%:path$="/":=0  look:=  5(mode% 16384)=0:"'"src$"' not a directory":= *%path$=path$+fname$+"/":home%=ptr% 4_ path$,3)="../":path$=path$,path$-4)::path$=path$,path$-1):path$,1)="/" path$="" >+ path$,2)="./":path$=path$,path$-2) H=0 R: \(ݤ_BLOCK(A$): syn(""):= fVA%=Mount:blk%=("&"+uc(A$)):RdBlocks(data%,blk%,D%,1):O%=data%:ln%=512:dump() p=0 z: "ݤ_DUMP(A$): syn(""):=  look:=  dump() =0 : )dump(F%):cols%=16: wdt%<80:cols%=8  P%=0 ln%-1 cols%:B$="" A h0(P%,6)" ";: F%: (P%(bsz%-1))=0:ReadData(P%):O%=data%  Q%=P% P%+cols%-1 , Q%=" " A$<="~" B$=B$+A$ B$=B$+"." O%=O%+1:: B$:: : "ݤ_TYPE(A$): syn(""):= @msk%=A$," [")<>0:msk%=(msk%&80)&7F:A$=A$,A$+" "," ")-1)  look:= $Blast%=0: P%=0 ln%-1:(P%(bsz%-1))=0:ReadData(P%):O%=data% .:Q%=?O%msk%:msk%=255:Q% Q%=10 Q%=13 Q%>31 Q% 8'(Q%=10 Q%=13) Q%<>last%:23-Q% BQ%=9:(8-( 8)); Llast%=?O%:O%=O%+1:: : V=0 `: jݤ_FREE(A$):A%=Mount t6:fsize%=swap32(dir%!2):nfree%=dir%!6 &FFFF:ptr%=swap32(dir%!8) free%=nfree%: G ptr%:RdBlocks(data%,ptr%,D%,1): data%?1=0:free%=free%+data%?0-1 ( ptr%: fsv%=6:ptr%=data%!2 &FFFF ) ptr%: fsv%>6:ptr%=swap32(data%!2) -ptr%<2 ptr%>=fsize%:used%=fsize%-free% \"Disk free: &"h0(free%,8)" blocks, &"h0(free%*bsz%,8)" bytes, ";free%(1024/bsz%);"K" \"Disk used: &"h0(used%,8)" blocks, &"h0(used%*bsz%,8)" bytes, ";used%(1024/bsz%);"K" _"Disk size: &"h0(fsize%,8)" blocks, &"h0(fsize%*bsz%,8)" bytes, ";fsize%(1024/bsz%);"K" =0 : ݤ_INFO(A$)  A$=""A$="$":PrSBlock:=0   look:= !inode%=ptr%:x%=0:ListFile(1) H p%=all0% almx%-1 alsz%:h0(blk(ientry%!p%),alsz%*2);" ";:: (=0 2:  (inf:) (onfirm)"):= F copy * path P copy * inf:path Z5A%=A$+" "," "):src$=A$,A%-1):dst$=s(A$,A%+1)) d:cnf%=uc(dst$,2))=" C": cnf%:dst$=s(dst$,dst$-2)) n1inf%=uc(dst$,4))="INF:":inf%:dst$=dst$,5) x!dst$="":" missing":= @os%<6:dst$,"::")dst$,1)="-":"FS prefix unsupported":= 1A$=src$: A$<>"/":A%=look:cblk%=ptr%: A%:= , A$="/":A%=Mount:cblk%=root%: A%<0:= FileInfo(cblk%) ](mode%24576)<>16384:fptr%=ientry%:leaf$=src$:CopyOneFile(src$,dst$):=0: Copy one file : ) src=directory, copy all recursively 6A%=file(dst$,8):dst$=dst$+d$:CopyDirectory(dst$) "MetaInfo(thisdir%):AcornInfo ;SetInfo(dst$,dst$-1)): Set top directory's metadata =0 : 8ݤ_IMPORT(A$): syn(" "):= +A%=A$," "):src$=A$,A%-1):A$=A$,A%+1) +A%=A$," "):dst$=A$,A%-1):A$=A$,A%+1) 5ptr%=find(dst$):ptr%=0:"'"dst$"' not found":= "!FileInfo(ptr%): ln%=length% ,7in%=f_openin(src$):in%=0:"'"src$"' not found":= 6Iln%=#in%:ln%>length%:#in%:in%=0:"Source file longer than dest":= @G IF ln%>16383:CLOSE#in%:in%=0:PRINT"Can't do long files yet":=TRUE J; ln%>1024*1024-1:#in%:in%=0:"Can't 1M+ files yet":= T""Copying "src$;" to "dst$;4; ^A P%=0 ln%-1:B%=0: B% doesn't seem to be used for anything h`(P%(bsz%-1))=0:f_gbpb(3,in%,data%,bsz%,P%):WriteData(P%):3,8)d(100*P%length%,2)"%"; r:#in%:in%=0:3,127) |=0 : :  File copying code  ================= 1 Fails to continue if more than 32*4 entries : MCopyDirectory(dst$): entry%,bit%,inode%,fptr%,fname$,blk%,dptr%,alloc% & cblk%=inode number of source dir & ientry contains source dir infor - fptr% points to current object's ientry , A%=0 63 4:thisdir%!A%=ientry%!A%: alloc%=all0%  0blk%=blk(thisdir%!alloc%): blk%:CopyBlock alloc%=alloc%+alsz% ) IF alloc%almx%-1 0 :: D- This is almost the same as PROCLstBlock NCopyBlock X(RdBlocks(dir%,blk%,D%,1):dptr%=dir% b linode%=!dptr% &FFFF v=dir%+bsz%  : ?CopyObject: ptr%,bit%,old_cblk%,thisdir$,bitmap$,object$  fname$="." fname$="..": ;cnf%:"Copy "fname$;:cnf%=yna(cnf%):cnf%>0:: 13 NFileInfo(inode%):leaf$=fname$:fname$=fn_undos(fname$),10):fptr%=ientry% ;(mode%24576)<>16384:CopyOneFile(leaf$,dst$+fname$): :  Descend into directory :old_cblk%=cblk% : Save current directory inode number  M A%=0 63:thisdir$=thisdir$+thisdir%?A%: : Save current object info M A%=0 63:object$ =object$ +fptr%?A% : : Save current object info  Hcblk%=inode% : Current inode is this directory *MA%=file(dst$+fname$,8) : Create matching destination directory 4=CopyDirectory(dst$+fname$+d$) : Copy directory at cblk% >E A%=0 63:object%?A%=object$,A%+1): : Restore object info HMetaInfo(object%) RPAcornInfo:SetInfo(dst$+fname$) : Set directory's metadata \: f- Restore into current (parent) directory pM A%=0 63:thisdir%?A%=thisdir$,A%+1): : Restore current object info zZcblk%=old_cblk%:RdBlocks(dir%,blk%,D%,1) : Restore current directory block  : $CopyOneFile(src$,dst$): cblk% +"Copying "src$;(15-src$)"to "dst$4; ) A%=0 63 4:object%!A%=fptr%!A%: @MetaInfo(object%):file(dst$,5):X%?14=&33:A%=file(dst$,4) KAcornInfo:X%!2=load%:X%!6=exec%:X%!10=0:X%!14=length%:A%=file(dst$,7) 6length%:CopyData : Copy if length<>0 SetInfo(dst$):3,127): : CopyData 9out%=f_openout(dst$):P%=0::ReadData(P%): =0:4; 1(P%1023)=0: 3,8)d(100*P%length%,2)"%"; .num%=bsz%:P%+num%>length%:num%=length%-P% 8f_gbpb(2,out%,data%,num%,0):P%=P%+num%:P%>=length% #out%:out%=0: $: .TSetInfo(dst$):X%!2=load%:X%!6=exec%:X%!10=length%:X%!14=attr%:A%=file(dst$,1) 8|A$=leaf$+15-leaf$," ")+h0(load%,8)+" "+h0(exec%,8)+" "+h0(length%,8)+13+10: +" "+FNh0(attr%,2)+" "+CHR$13+CHR$10 BOinf%:out%=(dst$+s$+"inf"): p%=1 A$:#out%,A$,p%,1)::#out%:out%=0 L fs%<>5: V@ A%=FNNetFS_Op(19,CHR$4+CHR$access%+dst$) :REM Write access `@X%!8=cdate%:A%=NetFS_OpN(19,5,10,dst$) : Write create date jE NetFS_Op(18,64+dst$): : create&mod date&time don't exist t6X%!8=cdate%:X%!10=ctime%:X%!13=mdate%:X%!15=mtime% ~IA%=NetFS_OpN(19,64,18,dst$) : Write create&mod date&time >A%=NetFS_Op(0,"ACCOUNT "+dst$+" "+~acc%+" ("+~aux%+")")  : :  Object display routines  ======================= : 6LstDir(cflg%):x%=0: Mount:"Not a UNIX disk": ! cflg%=0 - CAT, cflg%=1 - EX 3RdInode(csd%): IFcsd%=-1:csd%=root%:path$="/" M(ientry%?1 (64+32))<>64 "inode "h0(csd%,4)" is not a directory":  "Path: "path$ V(cflg%1): "inode filename"12"mode"6"nd uid gid len ctime"4"mtime"4"atime" alloc%=all0%  .blk%=blk(ientry%!alloc%):blk%:ListBlock (alloc%=alloc%+alsz% 2! alloc%almx%-1 F(cflg%1)=0:(x%3): P Z: d. This is almost the same as PROCCopyBlock nListBlock x(RdBlocks(dir%,blk%,D%,1):dptr%=dir%  inode%=!dptr% &FFFF =dir%+bsz%  : ListFile(cflg%) "(cflg%1): h0(inode%,4)" "; ,FileInfo(inode%):fname$;(15-fname$); F(cflg%1)=0:x%=x%+1: x%6:fbk%=8:stp%=4:ino%=&D0:in1%=&199 ^ n%=fbk% ino%-1 stp%: fsv%=6: h0(dir%!n%,4); fsv%>6: h0(swap32(dir%!n%),8);  (n% 31)=4:8 " "; : . "in-core free inodes: &"h0(dir%!ino%,4) P n%=ino%+2 in1% 2: h0(dir%!n%,4);: ((n%-ino%-2) 31)=30:8 " "; : 8 "flock: free list lock:"7h0(dir%?(in1%+1),2);8; 5 "ilock: inode table lock: "h0(dir%?(in1%+2),2) = "fmod: superblock modified: "h0(dir%?(in1%+3),2);8; 4 "dlock: disk read only:"3h0(dir%?(in1%+4),2) &? "time: disk last update:"5date(swap32(dir%!(in1%+5))) 0P n%=in1%+9 &1FF 2: h0(dir%!n%,4);: ((n%-in1%-9) 31)=30:8 " "; : : : D N: Xݤattr(A%):A$="" b!(A%1) A$="x" A$="-" l'(A%2) A$="w"+A$ A$="-"+A$ v'(A%4) A$="r"+A$ A$="-"+A$ '(A%8) A$="x"+A$ A$="-"+A$ '(A%16) A$="w"+A$ A$="-"+A$ '(A%32) A$="r"+A$ A$="-"+A$ '(A%64) A$="x"+A$ A$="-"+A$ '(A%128) A$="w"+A$ A$="-"+A$ '(A%256) A$="r"+A$ A$="-"+A$ '(A%512) A$="s"+A$ A$="-"+A$ '(A%1024) A$="g"+A$ A$="-"+A$ '(A%2048) A$="u"+A$ A$="-"+A$ '(A%4096) A$="l"+A$ A$="-"+A$ '(A%8192) A$="c"+A$ A$="-"+A$ '(A%16384) A$="d"+A$ A$="-"+A$ '(A%32768) A$="a"+A$ A$="-"+A$ =A$ : 1ݤdate(A%): seconds since 1970, &33:6E996A00 - day%,month%,year%,hour%,minute%,second% *4X%!1=A%/2.56:X%!1=X%!1+&336E996A:Date_ToOrd(X%) 43=d0(day%,2)+"/"+d0(month%,2)+"/"+d0(year%,2) >: H1ݤtime(A%): seconds since 1970, &33:6E996A00 R- day%,month%,year%,hour%,minute%,second% \4X%!1=A%/2.56:X%!1=X%!1+&336E996A:Date_ToOrd(X%) f$=d0(hour%,2)+":"+d0(minute%,2) p: z1980:date%=f_date(day%,month%,year%) (time%=f_time(hour%,minute%,second%)  : AcornInfo 6attr%=(mode%256)256+(mode%128)64+(mode%64)16 mattr%=attr%+(((mode%32)/2)((mode%4)*4))+(((mode%16)*2)((mode%2)*16))+(((mode%8)*8)((mode%1)*64)) H cdate%>mdate%:cdate%=mdate%: If Change>Modify, make Create=Modify ; PROCUnixDateToAcorn(adate%):adate%=date%:atime%=time% 6UnixDateToAcorn(cdate%):cdate%=date%:ctime%=time% 6UnixDateToAcorn(mdate%):mdate%=date%:mtime%=time% ?Date_FromOrd(X%,day%,month%,year%,hour%,minute%,second%,0) *X%!5=&FFFFFF:(mode%&49):X%!5=&FFFFE6 Cload%=X%!4:exec%=!X%:attr%=attr%+256*mdate%:acc%=uid%:aux%=gid%  $: .# Catalog manipulation routines 8# ============================= B: LHݤlook:src$=A$:ptr%=find(src$):ptr%:FileInfo(ptr%):ln%=length%:= V"'"src$"' not found":= `: j1ݤfind(A$):match$=A$,14):match%=0:Mount:=0 t&RdInode(csd%):csd%=-1:csd%=root% ~alloc%=all0%:match%=0  .blk%=blk(ientry%!alloc%):blk%:FileBlock alloc%=alloc%+alsz% , match%: alloc%almx%-1 match%  match%:=inode% =0 : = This is almost the same as PROCListBlock, PROCCopyBlock FileBlock (RdBlocks(dir%,blk%,D%,1):dptr%=dir%  inode%=!dptr% &FFFF =dir%+bsz% match% 2 <: F4FileInfo(f%):RdInode(f%):MetaInfo(ientry%): P: ZMetaInfo(i%) d8 P.:FOR A%=0 TO 63:P.FNh0(ientry%?A%,2)" ";:NEXT:P. nmode% =i%!0 &FFFF xnlink% =i%!2 imk%  uid% =i%!(2+usz%/2) imk% $gid% =i%!(2+2*(usz%/2)) imk% "isz%=32:length%=swap24(i%!5) "isz%>32:length%=swap32(i%!8) Pisz%=32:adate%=swap32(i%!tm%) :mdate%=swap32(i%!(tm%+4)):cdate%=mdate% Yisz%>32:adate%=swap32(i%!(tm%+8)):mdate%=swap32(i%!(tm%+4)):cdate%=swap32(i%!tm%)  : ' DEFPROCRdDir:IFcurr%=csd%:ENDPROC  Read directory  curr%=csd%:ENDPROC : :  Disk access routines  ==================== : "RdInode(i%) , PROCRdBlocks(data%,2,D%,1) 66RdBlocks(data%,(bsz%*2+i%*isz%-isz%)(bsz%),D%,1) @%i%=(bsz%*2+i%*isz%-isz%)(bsz%-1) J2 A%=0 isz%-1 4:ientry%!A%=data%!(A%+i%): T ^: hݤMount:csd%<>-1:=0 rDbsz%=512:fdcInit(diskrec%,9,9,2,2,80,1):RdBlocks(data%,2,D%,1) |5err%=-2: "Disk error: Image file not found":=-2 \::::::::::::::fsv%=6:isz%=32:root%=1:all0%=08:alsz%=2:naddr%=08:tm%=&18:usz%=2:bsz%=0512 [data%!8=0:::fsv%=7:isz%=64:root%=2:all0%=12:alsz%=3:naddr%=13:tm%=&34:usz%=4:bsz%=0512 [data%?1<&80:fsv%=9:isz%=64:root%=2:all0%=12:alsz%=3:naddr%=07:tm%=&34:usz%=4:bsz%=1024 - REM Check root starts with '..' and '.' ? PROCRdInode(root%):PROCRdBlocks(data%,ientry%!all0%,D%,1) D IF data%!0<>root%+&2E2E0000 OR data%!16<>root%+&002E0000:=TRUE Malmx%=all0%+alsz%*naddr%:dmk%=("&"+alsz%,"FF")):imk%=("&"+usz%,"FF")) #csd%=root%:home%=csd%:path$="/" =0 :  ݤblk(b%) alsz%=2:=b%&FFFF alsz%=3:=swap24(b%) =swap32(b%) : !ReadData(ptr%):TxData(): &"WriteData(ptr%):TxData(): 0: :TxData(write%): p% D alsz%=2:Tx16 Tx24 N8 p%=0: write%: A%=0 bsz%-1 4:data%!A%=0:: X( p%:TxBlocks(data%,p%,D%,1,write%) b l: v Tx24 Fp%=ptr%bsz%: p%1:p%=0:: Unsupported O p%=1:RdBlocks(data2%,data2%!((ptr%(bsz%/4))*4),D%,1):ptr%=ptr%(bsz%/4) p%=swap32(data2%!(ptr%*4))  :  Tx16 ; (mode%4096)=0:p%=all0%+2*(ptr%bsz%):p%=ientry%!p%:  p%=all0%+2*(ptr%(128*1024)) %RdBlocks(data2%,ientry%!p%,D%,1) 'p%=(ptr%bsz%)&FF:p%=data2%!(p%*2)   :  6RdBlocks(a%,b%,d%,n%):TxBlocks(a%,b%,d%,n%,): *6WrBlocks(a%,b%,d%,n%):TxBlocks(a%,b%,d%,n%,): 4: >7TxBlocks(addr%,block%,drive%,number%,write%): q% Herr%=0:block%=block% dmk% RV q%=0 number%-1:fdcAct(2+(write%=0),addr%+q%*bsz%,block%+res%+q%,drive%,1,0): \ f: p: z FDC routines  ============ : 6fdcInit(dskrec%,bps%,spt%,hds%,den%,trks%,sec0%)  i%:os%<>6: Sdskrec%?0=bps%:dskrec%?1=spt%:dskrec%?2=hds%:dskrec%?3=den%:den%=1:dskrec%?2=1 L i%=4 59 4:dskrec%!i%=0::dskrec%!60=&20000000:dskrec%!64=&20000000 7dskrec%?8=sec0%:dskrec%!16=trks%*spt%*(2^bps%)*hds%  : %fdcAct(op%,ad%,sc%,dv%,nm%,dn%) H op%=1: A%=0 bsz%-1 4:ad%!A%=0::drv%=drv%-5:drv%>7:err%=-1: F drv$=""::fdcOp(op%):ad%=ad%+bsz%:sc%=sc%+1:nm%=nm%-1: nm%<1: 3 op%=2:dsk%=f_openup(drv$): dsk%=0:err%=-2: 3 op%=1:dsk%=f_openin(drv$): dsk%=0:err%=-2: V op%=1: sc%*bsz%>#dsk%:#dsk%:dsk%=0:err%=-3:"Disk error: Past end of image": =f_gbpb(5-op%*2,dsk%,ad%,nm%*bsz%,sc%*bsz%):#dsk%:dsk%=0 $ .: 8fdcOp(op%) B os%>6:err%=-1 LV os%=6:ș"XADFS_DiscOp",,op%+(diskrec%<<6),sc%*bsz%+((dv%3)<<29),ad%,bsz% err% V^ os%<6:trk%=sc%9:trk%=trk%2+80*(trk%1):err%=scsi(ad%,6+op%*2,dv%4,trk%*16+sc%9+1,1) ` csd%=0: j err%: : t err%=-1:"Unsupported": ~< err%:"Disk error &"h0(err%,2)" at ";dv%":"h0(sc%,6)  : 3ݤswap24(A%):zp%!0=A%:zp%!3=A%:=zp%!1 &FFFFFF )ݤswap32(A%):zp%!0=A%:zp%!4=A%:=zp%!2 /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ ݤuc(A$):A$="":="" EA%=1A$:A$,A%,1)>"_":A$=A$,A%-1)+(A$,A%,1)&5F)+A$,A%+1)  :=A$ 6ݤfx(A%,X%): Y%:Y%=X%256:=(&FFF4 &FFFF00)256 : - Translate leafname if not saving to DOS  - ======================================= , . # $ ^ & @ % ~ become / ? < > + = ; \ %ݤfn_undos(A$):B%:(os%-32):=A$ (TA%=1A$:B%=".#$^&@%~",A$,A%,1)):B%:A$=A$,A%-1)+"/?<>+=;\",B%,1)+A$,A%+1) 2 :=A$ <: Fݤyna(A%):A%=0:=0 P+"? (Y/N/A)";::A%="YAN",(&DF)):A% Z+7,127);"YesAllNo ",A%*3-2,3);:=A%-2 d: n > BLib.Number x ============= %ݤh0(A%,N%):="00000000"+~A%,N%) $ݤd0(A%,N%):="00000000"+A%,N%) $ݤd(A%,N%):=" "+A%,N%) :  > BLib.DiskIO  ============= 7ݤdisk(addr%,cmd%,drv%,trk%,sec%,num%,den%):fs%,n% fs%=fs:fs%<>4:*FX143,18,4 $:n%=num%:sec%+n%>10:n%=10-sec% D:X%?0=drv%+den%*24+8+2*(trk%80):X%!1=addr%:X%?5=3-7*(cmd%>127) @X%?6=cmd%:X%?7=trk%80:X%?8=sec%:X%!9=n%&1E20:A%=127:&FFF1 YA%=X%?(7+X%?5):A%<>&10:addr%=addr%+n%*256:num%=num%-n%:sec%=(sec%+n%)10:trk%=trk%+1 +A%<>0num%<1:fs%<>4:"FX143,18,"+fs% =A% : +ݤscsi(addr%,cmd%,drv%,sect%,num%):fs% "fs%=fs:fs%<>8:*FADFS ,DX%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%&1F0000)65536) 69X%?7=((sect%&FF00)256):X%?8=sect%:X%!9=num%:X%!11=0 @2A%=&72:&FFF1:A%=?X%:fs%<>8:"FX143,18,"+fs% J=A% T: ^+ݤlvfs(addr%,cmd%,drv%,sect%,num%):fs% h!fs%=fs:fs%<>10:*FX143,18,10 rDX%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%&1F0000)65536) |9X%?7=((sect%&FF00)256):X%?8=sect%:X%!9=num%:X%!11=0 3A%=&62:&FFF1:A%=?X%:fs%<>10:"FX143,18,"+fs% =A% : ݤscsi_err(A%,S%) LA%:"Disk error "h0(A%,2)" (""fddhdd",(A%64)/64+1,3)") at "h0(S%,6) =A% : ݤdisk_err(A%,S%) .A%:"Disk error "h0(A%,2)" at "h0(S%,4) =A% :  > BLib.Generic.FileIO  ===================== .ݤfs:(os%-32)=0: A%,Y%,E%:=(&FFDA)&FF =29 : &%f_gbpb(A%,chn%,addr%,num%,ptr%) 0>?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:<&FFFFF:&FFD1: :A%=1A%=3:#?X%=X%!9 D5:A%=1A%=2:#?X%,?X%!1 A%=3A%=4:?X%!1=#?X% N5X%!1=X%!1+1:X%!5=X%!5-1:(#?X% A%>2) X%!5<1: X: bRݤfile(A$,A%):A%-8:<&FFFFF:$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF lTA$=f_name(A$):A%=255 A%=5:X%!14=(A$):X%!14:X%!10=#X%!14:#X%!14:X%!14=&33 v1A%=255:X%?6=0:"LOAD """+A$+""" "+~X%!2:=1 A%=5:X%!14:=1 A%=5:=0 FA%=0:"SAVE """+A$+""" "+~X%!10+" "+~X%!14:X%!10=X%!14-X%!10:=1 BA%=7:"SAVE """+A$+""" "+~+"+"+~X%!10:X%!10=X%!14-X%!10:=1  A%-8:=0 -(os%-24):A$="mkdir "+A$ A$="cdir "+A$ >&FFFF: : :=0  A$:=2 : !ݤf_openin(A$)=(f_name(A$)) "ݤf_openout(A$)=(f_name(A$)) !ݤf_openup(A$)=(f_name(A$)) Wݤf_name(A$):os%-32:A%,B%:B%=A%:A%=A$,"\",A%+1):A%=0:A$,".",B%)=0:A$=A$+"." =A$ :   > BLib.Generic.NetFS  ====================  +ݤNetFS_Op(A%,A$)=NetFS_OpN(A%,0,7,A$) *QݤNetFS_OpN(A%,T%,O%,A$): N%:!X%=0:X%?1=O%+1+A$:X%!3=A%:X%?7=T%:$(X%+O%)=A$ 4X>&FFFF:N%=4X%?1:X%?N%=X%?(N%+3)::ș&60048,A%,X%+4,O%+A$,120A%:A%=0:X%?3=0:=0 >;>&FFFF:A%>&FFFF:X%?3=?A%:ș&2002B,A%+4$(X%+4):=X%?3 HA%=&14:&FFF1:=X%?3 R: \ > BLib.Date f =========== p;Date_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%=y%400 zqd%=y%*365.25+m%*30+d%+"120112234455",m%,1)+((y%4)=0)-((y%-1)100)-(m%>2((y%4)=0(y%100)<>0y%=0))+36493 d%>146066:d%=d%-146097 =d%=d%*&41EB:mem%!1=d%+d%:d%=((hr%*60+mn%)*60+sc%)*100+cs% #?mem%=d%:mem%!1=mem%!1+d%256: : $Date_ToOrd(mem%): A%,B%,C%,D% @year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centi%=0 -mem%!1<0:: Problems with negatives ATM FD%=mem%!1&83D6+2447065:C%=mem%?0+256*(mem%!1&83D6):centi%=C%100 >C%=C%100:second%=C%60:C%=C%60:minute%=C%60:hour%=C%60 8B%=((D%*4+3)146097-4)+3:C%=B%14614*5+2:D%=D%*4+3 .A%=C%153+2:day%=C%1535+1:month%=A%12+1 *year%=D%146097*100+B%1461+A%12-4800  :  > BLib.FDate  ============ $Dݤf_date(d%,m%,y%):y%=y%-1981:=d%+m%*256+(y%15)*4096+(y%16)*32 .*ݤf_time(h%,m%,s%):=h%+m%*256+s%*65536 80f_date(d%):day%=d%31:month%=(d%&F00)256 B+year%=(d%&F000)4096+(d%&E0)/2+1981: L4f_time(t%):hour%=t%255:minute%=(t%&FF00)256 V second%=(t%&FF0000)65536: `: