HADFS D!Boot ? )@  DZL00 L L  ii3籨)_ @  00@X M5 N ,z0l  `ISK   G0S襨8 i m  8  H h )؍m8Ш0` X  LHADFSROM  Press BREAKNo SRAM Not a system disksExtras GDemoAgs N?YfDemoGPb N? x]jExamie M?@ M qFredDsk/sD?|JimDik/sH?SHNFSFrnt F?pbДNFSTeterK?pu|pYPrInf N?PUhRSImgile F?RSLin/s H?`JZ RSRAMisk F?`SideDsk/sF?` %.`Stats ? pSuppot/sM?0G6{Updats O?` 0998)a`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGH D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O1.00 u H h)i0   C   C L u  : . ' `ߎ Ҡ L `  `"LTitle: Option: Dir. Lib. Owner Public Support/s ct  LDA sect+1:ADC #LL4$HADFS5.50 (15 May 2007)H(C)J.G.Harston UH 09h L %#*HHH hhhHh`H hl Dhʂp݂4GJMH B 0 )ϝ H)0 h JJJJ) hı) H h `x( 8 H ނ B7)M 5 7( @ ~hȦ` )@`@ =  `H hH h`H)@M)@Mh`H h 77`-77`Hz 0IT@-y @)! qPress CTRL-BREAKLh`xԠ hH _ q No date h? =`BOOT H ݃h)H ݃`h `HZY7Q 0"@EH h   )h` q6: QLȂ Lh`L%ZLu` t ~ ч ` чѰ Ѱ`L) %`HADFS  RH h &`'`(`` _ q 5.50 ` qHarston ADFS`H < h ` ݃ h.H(` N Ɠ 7`7` L) ɓ0 ) LH.47@I 7 .h7`Ƚ6`Ա)[ A .Ƚ78h 6`7``HADFsFUTILs(STATUsCONFIGUReSHUtCLOSeHADFsSETDATeTIMeوACCESsޓACCOUNtBYe݊CDIrˊDELETeDIrENABLeEExFREeVINFoINSTALlI Am@LIb̋MApYMOUNtRENAMeTITLe(dd/mm/yy (( ($)) () (( ) hi(\   $G ( @+. L t`HADFS D!Boot ? )@  DZL00 L L  ii3籨)_ @  00@X M5 N ,z0l  `ISK   G0S襨8 i m  8  H h )؍m8Ш0` X  LHADFSROM  Press BREAKNo SRAM Not a system disks`_NullKeyboard0.12 (01 Aug 1998)O`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGH ! > BLib.Close 1.00 09Aug1998 :  Close Handling ( ~~~~~~~~~~~~~~ 2: <Close_All:*EXEC F"in%=in%:in%:A%=in%:in%=0:#A% P'out%=out%:out%:A%=out%:out%=0:#A% Z CmdLine H sW) # > BLib.CmdLine 1.00 09Aug1998 :  CSystemDisk (C)JGH @B$ GHADFSom O?5x>@!Boot N?Ы^IJtr Уbry Xnu vil УK8Ш0` X  LHADFSROM  Press BREAKNo SRAM Not a system disk`_NullKeyboard0.12 (01 Aug 1998)a`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGH D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O *Basic CHAIN"!Boot"  *Exec ( *** 2* First three lines MUST NOT be edited < 8BS Menu, S.Flintham. F> Modified by J.Ripley, C.J.Richardson, J.G.Harston, v2.20 P+&87:23;8202;0;0;0;23;2,53;0;0;0:*FX15 Z[3:7::" at line ";:"FX21":"KEY0"+" LIST "+()+"|M",>127):"FX138,0,128":d: d b:a:e$=f:e$<>27:g(e$) n*e$=27:7:d:Dir$="$": "$.!Boot" x : a:*FX4,1 *FX225,128 *FX229,1 *FX12  d:*FX4 *FX225,1 *FX229  : ݤS:P->&2000:"Too long?" ="!Boot220" 5b:run$=$&600:A%=run$+" "," "):run$=run$,A%-1) >:run$=run$,run$-1):".:",run$,1)):run$=run$,run$-1) -h%256,data%31,l%(14):X%=h%:Y%=X%256:fs "cv$="MODE3TEXT MODE7TTXT ARCHIARCHICHAINBASICLOAD LOAD LIST LIST CALL CALL LDPICLDPICSCRLOSCRLO" ,Jd%=2:i%=2:p%=4:q%=5:r%=6:s%=6:t%=2:u%=3:v%=3:w%=4:x%=3:y%=5:z%=7:aa%=7 6.: h$,n$,m$:26,12:5,2)""h$'5)""h$ @o(V%),5)="985"+n$:f%=((V%),6,2)):e%=((V%),8,2)) f%=1:e%=1:"Exec "+l$+".pc8s":"FX138,0,13":""A$ J28,2,22,37,5 T ^: h+fs:n%:fs%=fs:run$<>"":"Dir "+run$ rBfs%=4:Dir$=":"+gbpbN(5)+"."+Dir$=gbpbN(6) Dir$=Path_Name |$l$=Dir$+".Library":fs%=4:l$="%" =Dir$,1)="$":"Lib "+l$:fs%>4:A%=("%"):A%:#A%:l$="%" bt3$=l$+".7to3":t7$=l$+".3to7":sc$=l$+".Scroll":ar$=l$+".Archive":bo$=" -quit "+Dir$+".!Boot":  ݤfs:A%,Y%,E%:=(&FFDA)&FF LݤgbpbN(A%):X%!1=data%:&FFD1:A%=data%+((1+?data%)(A%>5)):A%?(1+?A%)=13 "=$(A%+1),$(A%+1)+" "," ")-1) ݤPath_Name:A%=6 ݤPath_Full:A%=&106 c n$,p$::X%!1=data%: &FFD1:?(data%+2+?data%+?(data%+?data%+1))=13:n$=$(data%+2+?data%):*DIR ^ On$=n$,n$+" "," ")-1):p$=n$+"."+p$:n$="$"n$="&":p$=p$,p$-1):"DIR "+p$ VA%=6:X%!1=data%: &FFD1:?(data%+1+?data%)=13:n$=$(data%+1):n$<>"":=":"+n$+"."+p$ >X%!1=data%:A%=5: &FFD1:?(data%+1+?data%)=13:n$=$(data%+1) )n$=n$,n$+" "," ")-1):=":"+n$+"."+p$ )os(c$):c$=42 c$="":c$: c$: : ;ݤf:t$,n%,m$,s$,g%,m%::la(f%):t$,n0%:n0%>14:n0%=14 .0,0);(128+s%);1+(17.5-((t$)/2)),0);t$ &n%=0:m%=n0%:m$,s$,s$,s$ 09s$>99:s$100=fs%:s$=s$,2) s$>99:s$="0":m$="" :-o%=s$:o%=0s$<>42:o%=-1-v$,s$,5))10 Des$<>"0":n%=n%+1:l%(n%)=o%:0,1+n%)" "(128+t%)(64+n%)(128+u%)m$,32);: TAB(35,1+m%)CHR$156; N+m%=m%-1:m%<1:0,1+e%);(128+w%);157; XL0,15);(v%+128)"RETURN to select"(128+d%);2,17);(v%+128)time,15); b :*FX21 l20,15);:l%(e%)>0:"Another menu "; "Runs Code 80 Column Text40 Column TextArchive Basic Program Loads Basic Lists Basic Calls Basic LDPIC Picture ScrLoad Pictr ",-14*l%(e%)+1,14); v*g%=get(20,17):(g%&E0)=&60:g%=g%-32 F128+138+139+13+"48OPRSX",g%)(g%>64 g%<=64+n%)(g%=27-1) 0,1+e%);" "; g%=138:e%=e%n%+1 g%=139:e%=e%-1:e%=0:e%=n% g%>64g%<=64+n%:e%=g%-64 0,1+e%);(128+w%);157; $V%=985000000+n$*10000+f%*100+e% 0"48OPRSX"+128+27+13,g%):4,1+e%);">"; =(g%)+(e%) : g(e$):e$=128: "n%,x$,d$,f$,s$:la(f%):d$,n% n%=1(e$,2)) Hx$,d$,f$,s$:s$>99:s$100=fs%:s$=s$,2) s$>99:s$="0":n%=n%-1  :o%=s$:o%>0:f%=o%:e%=1: o%=0 s$="0":  26,31,0,21:e$=e$:d *d$,1)="%":d$=l$+d$,2) 4f$,1)="%":f$=l$+f$,2) >d$<>"":"Dir "+d$ Ho%=-1:u: Ro%=-2:v: \%o%=-3:os(ar$+bo$+"|M -e "+f$): f9 IFo%>-7 ANDo%<-2 ANDe$<>CHR$13:o%=INSTR("XSR",e$)-7 po%=-4:os(f$+bo$): z#o%=-5:Key("*Load "+f$+"|F|M") 0o%=-6:Key("LOAD """+f$+"""|MLIST|F|N|M|O") o%=-7:os(f$+bo$): $o%=-8:Key("*LdPic "+f$+"|F|M") &o%=-9:Key("*ScrLoad "+f$+"|F|M") *:I%=s$+"//","//"):s$,I%-1)="RUN": &os(s$,I%-1)):s$=s$,I%+2):s$=""  : #u:e$="4":os(t7$+" "+f$+bo$) / PROCos(sc$+" -lp *lp -4 "+t7$+" "+f$+bo$) os(sc$+" -lp *lp "+f$+bo$)  (v:e$="8":Z%=0:os(t3$+" "+f$+bo$) $e$="P":Z%=1:os(t3$+" "+f$+bo$) e$<>"O":d:"Run "+f$:  $;Key(A$):"KEY0 "+A$:"FX21":"FX138,0,192":22,7::: .ݤya:A%,B%:A%=&7A 87:B%=255-((&FFF4)&FF00)256:B% B%<>182B%<>?&80 B=B% L'la(f%):m$,n%::m$,m$,m$:f%<2: V m$,n%: `.m$,m$,m$,m$:n%=n%-1:n%<1:f%=f%-1:f%<2: j: t' Disk name,Issue number,Issue Date ~, Harston ADFS System Disk,06,01/09/2006 :  HADFS System Main Menu ,7 1 Read Latest Updates file,,Extras.Updates,-1 ! Read HADFS Manual files,,,2  Library Programs,,,4  Utility Programs,,,3  Disk Initialisation,,,5 0 Alter Time & Date,,Utils.SetDate -force,-7 * -- Exit To Basic --,,,*Mount//*Basic :  HADFS Manual Files,10 & Introduction,,Manual.Chapter1,-1 + The Filing System,,Manual.Chapter2,-1  0 Filing System Commands,,Manual.Chapter3,-1 5 Low Level File Entry Points,,Manual.Chapter4,-1 5 The Filing System Utilities,,Manual.Chapter5,-1 (( Error Messages,,Manual.Chapter6,-1 24 HADFS Programming Examples,,Manual.Chapter7,-1 <5 HADFS Technical Information,,Manual.Chapter8,-1 F5 HADFS As Econet Environment,,Manual.Chapter9,-1 P& Bibliography;;Manual.ChapterA;-1 Z# -- Return To Main Menu --,,,1 d: n Utility Programs,9 x2 DMap - Display Disk Map,,Utils.DMap,-7 9 HDInit - Initialise Hard Drive,,Utils.HDInit,-7 5 HEdit - Disk Sector Editor,,Utils.HEdit,-7 5 HUtils - Utilities Program,,Utils.HUtils,-7 5 MCat - Multiple Cataloguer,,Utils.MCat,-7 / Rescue - File Rescue,,Utils.RESCUE,-7 8 Intern/s - Make Internal Disk,,Utils.Intern/s,-4 9 VisCompact - Visual Compaction,,Utils.VisCompact,-7 ) ----- Return To Main Menu -----,,,1 :  Library Programs,9  BACKUP a Disk,,%.BACKUP,-4 " COMPACT a Disk,,%.COMPACT,-4 % ETree Disk Examiner,,%.ETree,-4 + MakeLP Printer Generator,,%.MakeLP,-4 ( Scroll Text File Reader,,"""""",-1 ) TreeCopy File Copier,,%.TreeCopy,-7 "$ Filer File Manager,,%.Filer,-7 ,, Read Library Info,,Extras.Library/t,-1 6# -- Return To Main Menu --,,,1 @: J Disk Initialisation,7 T3 Format Drive 0 as 400K disk,,,*FORM160 0//RUN ^3 Format Drive 1 as 400K disk,,,*FORM160 1//RUN h, Initialise Hard Drive,,Utils.HDInit,-7 r% [ ],,,1 |1 Install System on Drive 0,,,*INSTALL 0//RUN 1 Install System on Drive 1,,,*INSTALL 1//RUN % --- Return To Main Menu ---,,,1 : (ݤtime:?X%=0:A%=14:&FFF1:?X%=0:="" X%?24=13:X%?15=13:A%=$X%,5,2)>31:$(X%+11)=($(X%+11)-16*A%-100*($(X%+11)<1981)):A%:X%?6=13:$(X%+4)="0"+($(X%+4)-32),2):X%?6=32 X%?15=46:=$X% Xݤget(x%,y%):p%,v%,A$:p%=:v%=:x%,y%);time,17);p%,v%);:A$=(100):A$<>"":=A$  getdate $"Enter the date (DD/MM/YY): "d$ -d$," ")=0 d$<>"":d$=d$+" 0"+äday(d$) "SETDATE "+d$ ""Enter the time (HH:MM): "t$ &t$<>"":=(60*t$+t$,2))*60*100  Lݤday(d$):dy%=d$:m%=d$,d$,"/")+1):y%=1900+d$,2):y%<1980:y%=y%+100 y%=y%400:=(y%*365.25+m%*30+dy%+"120112234455",m%,1)+((y%4)=0)-((y%-1)100)-(m%>2 ((y%4)=0 (y%100)<>0 y%=0))+3)7+1 Extras :DemoArgs NYW5  > DemoArgs 1.03 ) Demo of calling OsArgs, HADFS 5.32+ : (:"OsArgs &FD Demo"' 2 Y%=0 15: A$ <""Y%=";hex(Y%,2)  > DemoArgs 1.03 ) Demo of calling OsArgs, HADFS 5.32+ : (:"OsArgs &FD Demo"' 2 Y%=0 15: A$ <""Y%=";hex(Y%,2);", ";A$;":"; FL IFY%=0 OR Y%>3:data%=FNargs(&FD,Y%,0):PRINTSPC(31-POS);FNhex(data%,8); P1data%=args(&FD,Y%,0):(31-);hex(data%,8); Z :: d: n' OSARGS call ignoring X, returns A x:ݤargs0(A%,Y%): E%,X%,!&70:E%=Y%:X%=&70:=(&FFDA)&FF : 7 OSARGS call with data. Returns any returned data 4ݤargs(A%,Y%,!&70): X%,E%:?(P-3)=0:E%=Y%:Y%=0 X%=&70: &FFDA:=!X% : # Hexadecimal padded with zeros $ݤhex(A%,N%)="0000000"+~A%,N%) :  Decimal padded with zeros $ݤdec(A%,N%)="00000000"+A%,N%) : Decimal padded with spaces %ݤDec(A%,N%)=" "+A%,N%) : + Version and flags,(TAPE),(TAPE),(ROM)  **/**/**/** " ENABLE/IAM/PRIV/USER , CURR,**/**/**/** 6! CSD,LIB,URD,**/**/OPTFLG/** @0 **/**/DRVEXT/DRVINT,,(TELESOFT),(TELESOFT) DemoGbPb N x]W<  > DemoGbPb 1.02 ! Check can read various info  wit  > DemoGbPb 1.02 ! Check can read various info  with OSGBPB (: 2*OSGBPB=&FFD1::chn%=0: :Close:: < ctrl% 20,data% 80 F go: P: Z%Close:chn%:A%=chn%:chn%=0:#A% d n: xݤgbpb(A%) X%,Y% X%=ctrl%:Y%=X%256 X%!1=data% =( OSGBPB) &FF : pr(ad%)  l% "Len=";?ad%;" """; , ?ad%>0 l%=ad%+1 ad%+?ad%:v(?l%): """";: : 4v(A%): A%<31 A%>126 """(";~A%;")"""; A% "ݤh(A%,N%)="0000000"+~A%,N%)  :  ݤdrv(A%) " A%<10:=A% =(A%+55) ,: 6 dir @"Drive: ";:pr(data%) J&'6"Dir: ";:pr(data%+1+?data%) T^o%=?(data%+2+?data%+?(data%+1+?data%)):'6"Owner: ";~o%;" ";:o%=00 "Owner" "Public" ^ h: rgo |"A%=5, Read disk title:" A%=gbpb(5) "A%=";A%;" ";:pr(data%) F'6)"Opt: ";?(data%+1+?data%);" Drive: ";drv(?(data%+2+?data%)) : "'"A%=6, Read directory name:" A%=gbpb(6) "A%=";A%;" ";:dir :  '"A%=7, Read library name:" A%=gbpb(7) "A%=";A%;" ";:dir : %'"A%=8, Read directory entries:" 11"Num: 3 Index: 0"  ctrl%!5=3:ctrl%!9=0:!data%=0 BA%=gbpb(8):"A%=";A%;11);"Num: ";ctrl%!5;" Index: ";ctrl%!9 &9d%=data%:z%=ctrl%!5 2:6;:pr(d%)::d%=d%+1+?d%: 0: :"'"Checking OSGBPB extensions" D(chn%="%":chn%=0:"Can't open '%'." N@ B%=9*2 255*2:ctrl%!5=3:ctrl%!9=0:?ctrl%=chn%((B%1)<>0) X%!data%=0:data%!8=0:A%=gbpb(B%2) b!data% data%!8:"A%=";B%2;"/";chn%((B%1)<>0);11)"Num: 3 Index: 0"'"A%=";A%;11)"Num: ";ctrl%!5;" Index: ";ctrl%!9:dump l v #chn%  : #dump:d%=data% data%+40 4 h(!d%,8);" ";::'""""; d%=data% data%+40 v(?d%)::'  Examine M@ M W6  >Examine 2.13  Examine files in directory  (C) J.G.Harston (<  >Examine 2.13  Examine files in directory  (C) J.G.Harston (< 25-May-98 V2.05 JGH: Access displayed as --WR--wr etc. 24 23-Jun-98 V2.10 JGH: Update date read from net 0  : file: f$,type% .?(data%+?data%+1)=13:f$=strip($(data%+1)) ;X%!2=0:X%!6=0:X%!10=0:X%!14=0:X%!18=0:type%=file(f$,5) R fs%=5:$(data%+8)=f$:osw(&14,&12002000,&40000000): data%?3=0:X%!15=data%!10 Atotal%=total%+X%!10: X%?10<>0:total%=(total% &FFFF00)+&100 E f$;(11- f$);h0(X%!2,8);" ";h0(X%!6,8);" ";h0(X%!10,8);" "; .raw%: h0(X%!14,8);" ";h0(X%!18,8);" "; "Eraw%: acc(X%?14,type%);" ";date(X%!15);" ";h0(X%?17,2);" "; ,M type%=1:"File" type%=2:"Dir." type%=&FF:"Run " "&";~type% 6LongDateToShort @t 9;d0(day%,2)"/"d0(month%,2)"/"d0(year%,4)" "d0(hour%,2)":"d0(minute%,2)":"d0(second%,2)"."d0(centi%,2) J T: ^ݤacc(a%,b%): a$ h b%=2 a$="D" a$="-" r$(a%128) a$=a$+"P" a$=a$+"-" |$(a%8) a$=a$+"L" a$=a$+"-" $(a%2) a$=a$+"W" a$=a$+"-" $(a%1) a$=a$+"R" a$=a$+"-" $(a%4) a$=a$+"E" a$=a$+"-"  a$=a$+"/" $(a%32) a$=a$+"W" a$=a$+"-" $(a%16) a$=a$+"R" a$=a$+"-" $(a%64) a$=a$+"E" a$=a$+"-" =a$+" ",10) : 5ݤdate(a%):a%=a%&FFFF: IF(a%AND&FF)=0:="Unset " J=d0(a%31,2)+"/"+d0((a%256)15,2)+"/"+(1981+(a%&1000)+(a%&E0)/2) #ݤh0(A%,N%)="0000000"+~A%,N%) #ݤd0(A%,N%)="0000000"+ A%,N%) !ݤfs: A%,Y%,E%:=(&FFDA)&FF Bݤfile(f$,A%):$data%=f$:?X%=data%:X%?1=data%256:=(&FFDD)&FF 6ݤstrip(f$): f$,1)=" "::f$=f$,2): f$,1)<>" " &f$=f$,f$+" "," ")-1):=f$ 0Fosw(A%,D%,E%): X%,Y%:X%=data%:Y%=X%256:!X%=D%:X%!4=E%:&FFF1: :: DLongDateToShort N8ld%=X%!2:ex%=X%!6:!X%=ex%:X%!4=ld%:Date_ToOrd(X%): X: b$Date_ToOrd(mem%): A%,B%,C%,D% l@year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centi%=0 v-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  FredDisk/s DW  > FredDisk/s 1.02  Provides cut-down ramdisk " in byte-wide ramcard in FRED (: 2WORDV=&20C <mcode%=&FFFF0A40 F addr=&A8:sect=addr+4  > FredDisk/s 1.02  Provides cut-down ramdisk " in byte-wide ramcard in FRED (: 2WORDV=&20C <mcode%=&FFFF0A40 F addr=&A8:sect=addr+4:ptr=&AE P P=0 1 Z P%=mcode% d [OPT P*3 n.Intercept xCMP #90:BEQ NewWord .OldWord JMP 0 .NewWord STX ptr:STY ptr+1 \ Check &0600 id marker: LDY #0:LDA (ptr),Y:BNE NotMe $INY:LDA (ptr),Y:CMP #6:BNE NotMe \ Bit7 commands go to HADFS: !LDY #11:LDA (ptr),Y:BMI NotMe \ Only RD & WR supported: BEQ NotMe:CMP #3:BCS NotMe \ Get number of sectors: PHA:DEY:LDA (ptr),Y:TAX "\ Check drive number (27='R'): %DEY:LDA (ptr),Y:CMP #27:BEQ ForMe  .NotMe1 "PLA:.NotMe ,LDX ptr:LDY ptr+1:LDA #90 6BNE OldWord @: J .ForMe T\ 2..5=addr ^\ 6..8=sec h\ 9=drv checked r\10=num in X |$\11=type 1=write, 2=read, pushed \ Ignore top byte of sector DEY  \ Get copy of sector & addr:  .AddrLp  DEY:LDA (ptr),Y:STA addr-2,Y CPY #2:BNE AddrLp \ No Tube support: BIT &27A:BPL IOMem LDA addr+2: addr+3 CMP #&FF:BNE NotMe1  .IOMem  LDY #0  .Loop "LDA sect+1:STA &FC02:\ hi byte "LDA sect+0:STA &FC01:\ lo byte ,LDA #0:STA &FC00:\ offset into 256 bytes &PLA:PHA:LSR A:BCC Read 0 .Write :$STY &FC00:LDA (addr),Y:STA &FC03 DINY:BNE Write:BEQ Next N .Read X$STY &FC00:LDA &FC03:STA (addr),Y bINY:BNE Read l .Next v\ Point to next sector:  LDA sect:CLC:ADC #1:STA sect  LDA sect+1:ADC #0:STA sect+1 \ Point to next addr: INC addr+1  \ Loop back for each sector: DEX:BNE Loop PLA:LDA #0 LDY #11:STA (ptr),Y RTS :  .start% LDA WORDV:STA OldWord+1 LDA WORDV+1:STA OldWord+2 "LDA #Intercept 255:STA WORDV  )LDA #Intercept 256 &FF:STA WORDV+1 RTS  ] *<"*SAVE FredDisk ";~mcode%;" ";~P%;" ";~start%&FFFF0000 JimDisk/s :C$=$(H%+1):P%=H%+2+C$:V%=!P%:W%=P%!4:F%=P%!8:J%=P%!12:P%=P%+16:A%=3:T:H%=P%: ,A%=2:R:H%=P%: 6'H:E$;C$;:I$="":d$=E$+C$d$=I$+C$ @C"SAVE "+d$+" "+~P%+"+"+~F%+" "+~W%+" "+~V%:D:H%=P%+F%:: TD:N%<4: UK%=4:J%=(J%1  > JimDisk/s 1.02  Provides cut-down ramdisk & in page-wide ramcard in FRED+JIM (: 2WORDV=&20C <mcode%=&FFFF0A40 F addr=&A8:sect=addr+4:ptr=&AE P P=0 1 Z P%=mcode% d [OPT P*3 n.Intercept xCMP #90:BEQ NewWord .OldWord JMP 0 .NewWord STX ptr:STY ptr+1 \ Check &0600 id marker: LDY #0:LDA (ptr),Y:BNE NotMe $INY:LDA (ptr),Y:CMP #6:BNE NotMe \ Bit7 commands go to HADFS: !LDY #11:LDA (ptr),Y:BMI NotMe \ Only RD & WR supported: BEQ NotMe:CMP #3:BCS NotMe \ Get number of sectors: PHA:DEY:LDA (ptr),Y:TAX "\ Check drive number (27='R'): %DEY:LDA (ptr),Y:CMP #27:BEQ ForMe  .NotMe1 "PLA:.NotMe ,LDX ptr:LDY ptr+1:LDA #90 6BNE OldWord @: J .ForMe T\ 2..5=addr ^\ 6..8=sec h\ 9=drv checked r\10=num in X |$\11=type 1=write, 2=read, pushed \ Ignore top byte of sector DEY  \ Get copy of sector & addr:  .AddrLp  DEY:LDA (ptr),Y:STA addr-2,Y CPY #2:BNE AddrLp \ No Tube support: BIT &27A:BPL IOMem LDA addr+2: addr+3 CMP #&FF:BNE NotMe1  .IOMem  LDY #0  .Loop "LDA sect+1:STA &FCFE:\ hi byte "LDA sect+0:STA &FCFF:\ lo byte PLA:PHA:LSR A:BCC Read & .Write 0 LDA (addr),Y:STA &FD00,Y:INY :BNE Write:BEQ Next D .Read N LDA &FD00,Y:STA (addr),Y:INY X BNE Read b .Next l\ Point to next sector: v LDA sect:CLC:ADC #1:STA sect  LDA sect+1:ADC #0:STA sect+1 \ Point to next addr: INC addr+1  \ Loop back for each sector: DEX:BNE Loop PLA:LDA #0 LDY #11:STA (ptr),Y RTS :  .start% LDA WORDV:STA OldWord+1 LDA WORDV+1:STA OldWord+2 "LDA #Intercept 255:STA WORDV )LDA #Intercept 256 &FF:STA WORDV+1  RTS ]  ;"*SAVE JimDisk ";~mcode%;" ";~P%;" ";~start%&FFFF0000 NFSFront FpbДWL:LI%NFS Front End for L:LI%NFS Front End for HADFS0.03(C)1992 J.G.Harston LH 0 hH dh`LHZ1 L ) @h` 0з +16: ΀L]Z h`hLz` +NFS Front for HADFS `. )N h` L ΀h ` ΀`HJJJJ h) ii0LhhHH歱 L9hhlhhȱL`% HHHHÁJ hhhhȑ`l bnnnnoppqt`hhh` HHH ii0:  бhhhHHH hHHHHG ނii hhh ނhhhi `L* ȱ$ 1 $ ƨ`ThisUser Supervisor xSTAFF.FRANK *-System-*  ````L (򈈩 ` ``NFSTester Kpu|W.Y  > NFSTester ! Tests various Osw14/0 calls : () ctrl% 100: dname$(3  > NFSTester ! Tests various Osw14/0 calls : () ctrl% 100: dname$(31):OSWORD=&FFF1 2X%=ctrl%:Y%=X%256:A%=&14 <: F P do14 Z do15 d do16 n do21 x do24 do25 do26  : osw14(f%) %!X%=&4000:X%!3=f%:A%=&14: OSWORD  : #ݤd(A%,N%):=" "+A%,N%) ݤd0(A%):="0"+A%,2) ݤn(A%):="00"+A%,3) #ݤh(A%,N%):="0000000"+~A%,N%) ݤs(A%,N%): A$ 6?A%<32 ?A%>126 A$=A$+"("+?A%+")" A$=A$+?A% A%=A%+1:N%=N%-1:N%=0:=A$ : " do14 ,$"Function 14 - Read disk names" 6 u%=0 31 @X%?7=u%:X%?8=1:osw14(14) J& X%?4<>0 pr14:dname$(u%)=$(X%+6) T u% ^: h pr14 r#":";(48+X%?5-7*(X%?5>9));" "; |X%?22=13:$(X%+6)  :  do15 )"Function 15 - Read logged on users" #"Station User name"11"Status"  u%=0: X%?7=u%:X%?8=1:osw14(15)  X%?4<>0 pr15 u%=u%+1: X%?4=0 :  pr15 n(X%?6);".";n(X%?5);" "; $(X%+7);(20-$(X%+7)); * ?(X%+8+$(X%+7)) "Syst" "Normal"  : & do16 0'"Function 16 - Read date and time" :osw14(16) DW"Date: ";d0(X%?4 31);"/";d0(X%?5 15);"/";1981+X%?5 16+(X%?4 &E0) 2;5; N3"Time: ";d0(X%?6);":";d0(X%?7);":";d0(X%?8) X: b: l do21 v*"Function 21 - Read user environment" $X%=50," ") osw14(21) 0"Disk name: """;s(X%+5,16);""" Len: ";X%?4 &"Directory: """;s(X%+21,10);"""" &"Library: """;s(X%+31,10);"""" : :  do24 #"Function 24 - Read user info" : : :  do25 ("Function 25 - Read server version"  osw14(25)  $(X%+4)  : *: 4 do26 >$"Function 26 - Read free space" H u%=0 31:rd26: R \ rd26 fdname$(u%)="": p d0(u%);" ";dname$(u%);" "; z:$(X%+7)=dname$(u%),dname$(u%)+" "," ")-1):osw14(26) =X%?3=0:"&"h(X%!3,8);" (";d(X%!3 1024,7);"K) free "; ?X%?6=0:"&"h(X%!6,8);" (";d(X%!6 1024,7);"K) disk size"  PrInfo NPUW-  > PrInfo 1.02 " Prints info on current HADFS X%=&70:Y%=0:A%=0:A%=&FD (!&70=0:ver%=(&FFDA)&FF  > PrInfo 1.02 " Prints info on current HADFS X%=&70:Y%=0:A%=0:A%=&FD (!&70=0:ver%=(&FFDA)&FF 2"HADFS Information"  > RSImgFile ' RS232-Link disk to partition file : (: buffer% 256:init 2 15:*FX15 < *FX7,7 F *FX8,7 P err end: Z:listen:0 d: nݤerr:*fx3 x:" at line ";:*FX2,2 =-1 : listen *FX2,1 A%=:A%=1 A%=2 num%=:drv%= sect%=*65536+*256+ # A%=1 write:: Sending to me A%=2 read:: Me send out  : read  num%=number of sectors  sect%=start sector "Reading";:disp  l%=0 num%-1 "0rd(sect%+l%): Get 256 bytes from somewhere , *FX3,7 60: All ok @* m%=0 255:buffer%?m%:: send data J*FX3 T l%: Do next sector ^: h: r write |"Writing";:disp  l%=0 num%-1 + m%=0 255:buffer%?m%=:: read data wr(sect%+l%)  *FX3,7 0: All ok *FX3  :  disp ": &";~sect%;" + ";~num%;  sect%=&46 " - FSM";  sect%=&47 " - root";  :  Specific routines: : & init 0ch%=("") :*"Using HADFS partition " D N: X end b ch%<>0 A%=ch%:ch%=0:#A% l v:  rd(s%)  l%,d%:#ch%=256*s% )ș "OS_GBPB",3,ch%,buffer%,256,256*s%  :  wr(s%)  l%,d%:#ch%=256*s% )ș "OS_GBPB",1,ch%,buffer%,256,256*s%  RSLink/s H`JZ W7  > RSLink/s  > RSLink/s 1.04 $ Provide 'drive' via RS232 link : (3 No Tube support, pure datastream, no checking 2C 05-Nov-98 v1.01 JGH: Sets baud, enables serial, Tube check ok <1 07-Nov-98 v1.02 JGH: Allows multiple drives F- 07-Nov-98 v1.03 JGH: Runnable transient P. 23-Nov-98 v1.04 JGH: Test direct writing Z: d *RSLink n' eg: *RSLink L4 - links L M N O x baud%=8 : (WORDV=&20C:OSBYTE=&FFF4:OSARGS=&FFDA mcode%=&FFFF0BAC addr=&A8:sect=addr+4:ptr=&AE P=0 1 P%=mcode% [OPT P*3 \ Syntax- *RSLink .start% %LDA #1:LDX #ptr:LDY #0:JSR OSARGS )LDA (ptr),Y:CMP #"0":BCC LinkDefault -CMP #"A":BCC LinkDigit:SBC #6:.LinkDigit  #31:STA DriveLo+1:INY *LDA (ptr),Y:CMP #"1":BCC LinkOneDrive  #7:TAY:.LinkOneDrive 'TYA:CLC:ADC DriveLo+1:STA DriveHi+1 ".LinkDefault ,: 6LDA WORDV:STA OldWord+1 @LDA WORDV+1:STA OldWord+2 J"LDA #Intercept 255:STA WORDV T)LDA #Intercept 256 &FF:STA WORDV+1 ^LDA #2:TAX:JSR OSBYTE hLDA #7:JSR SetBaud:LDA #8 r .SetBaud |LDX #baud%:JMP OSBYTE : :\ Resident code in page &C : .Intercept CMP #90:BEQ NewWord  .OldWord  JMP 0  .NewWord STX ptr:STY ptr+1 \ Check &0600 id marker:  LDY #0:LDA (ptr),Y:BNE NotMe $INY:LDA (ptr),Y:CMP #6:BNE NotMe  \ Bit7 commands go to HADFS: !LDY #11:LDA (ptr),Y:BMI NotMe \ Only RD & WR supported: BEQ NotMe:CMP #3:BCS NotMe &\ Get number of sectors: 0PHA:DEY:LDA (ptr),Y:TAX :\ Check drive number DDEY:LDA (ptr),Y N .DriveLo X'CMP #21:BCC NotMe1:\ Default 21="L" b .DriveHi l/CMP #22:BCC ForMe:\ Default only one drive v .NotMe1 PLA:.NotMe LDX ptr:LDY ptr+1:LDA #90 BNE OldWord :  .ForMe \ 2..5=addr \ 6..8=sec \ 9=drv checked \10=num in X $\11=type 1=write, 2=read, pushed BIT &27A:BPL NoTube $LDY #5:LDA (ptr),Y:DEY: (ptr),Y CMP #&FF:BNE NotMe1 \ Send parameter block:  .NoTube  LDY #11  .SendBlockLp *LDA (ptr),Y:JSR WriteByte 4DEY:CPY #5:BNE SendBlockLp >\ Get addr: H"DEY:DEY:LDA (ptr),Y:STA addr+1 RDEY:LDA (ptr),Y:STA addr \LDY #0:PLA:LSR A:BCS Write f.ReadSectors pJSR ReadByte:BNE Error z .Read *JSR ReadByte:STA (addr),Y:INY:BNE Read "INC addr+1:DEX:BNE ReadSectors BEQ FinishSectors :  .Write ,LDA (addr),Y:JSR WriteByte:INY:BNE Write JSR ReadByte:BNE Error INC addr+1:DEX:BNE Write : .FinishSectors LDA #0:\ ok  .Error .ExitRoutine %LDY #11:STA (ptr),Y:\ result byte LDX ptr:LDY ptr:LDA #90:RTS : $ .ReadByte .TXA:PHA:TYA:PHA 8.ReadAgain B!LDY #&FE:BIT &FF:BMI ReadQuit LLDA #145:LDX #1:JSR OSBYTE VBCS ReadAgain ` .ReadQuit jSTY addr+2:PLA:TAY:PLA:TAX tLDA addr+2:RTS ~: .WriteByte PHA:LDA #2 .WriteByteLp BIT &FF:BMI WriteByteQuit BIT &FE08:BEQ WriteByte PLA:STA &FE09:PHA .WriteByteQuit  PLA:RTS : \.WriteByte (\STA addr+2:\PHA:\TXA:\PHA:\TYA:\PHA \.WriteAgain \BIT &FF:\BMI WriteQuit  -\LDA #138:\LDX #2:\LDY addr+2:\JSR OSBYTE \BCS WriteAgain \.WriteQuit (!\PLA:\TAY:\PLA:\TAX:\PLA:\RTS 2: <] F:"*SAVE RSLink ";~mcode%;" ";~P%;" ";~start%&FFFF0000 RSRAMDisk F`W  > RSRAMDisk  RS232-Link disk to memory : (: buffer% 256:init 2 15:*FX15 < *FX7,8 F *FX8,8 P err Z:liste  > RSRAMDisk  RS232-Link disk to memory : (: buffer% 256:init 2 15:*FX15 < *FX7,8 F *FX8,8 P err Z:listen:0 d: nݤerr:*fx3 x:" at line ";:*FX2,2 =-1 : listen *FX2,1 A%=:A%=1 A%=2 num%=:drv%= sect%=*65536+*256+ # A%=1 write:: Sending to me A%=2 read:: Me send out  : read  num%=number of sectors  sect%=start sector "Reading";:disp  l%=0 num%-1 "0rd(sect%+l%): Get 256 bytes from somewhere , *FX3,7 60: All ok @* m%=0 255:buffer%?m%:: send data J*FX3 T l%: Do next sector ^: h: r write |"Writing";:disp  l%=0 num%-1 + m%=0 255:buffer%?m%=:: read data wr(sect%+l%)  *FX3,7 0: All ok *FX3  :  disp ": &";~sect%;" + ";~num%;  sect%=&46 " - FSM";  sect%=&47 " - root";  :  Specific routines: :  init max%=((-P-5000)&FFFC00)  mem% max% 6"Using ram-disk size: &";~max%;", ";max%1024;"K" o$buffer%=0+"(C)JGH"+0: mem%!&4610<>!buffer% mem%!&4614<>buffer%!4 "Installing fresh disk":new_disk & 0: :new_disk D$$(mem%+&4600)="LinkDisk " N,mem%!&4610=!buffer%:mem%!&4614=buffer%!4 X$mem%!&4618=0:mem%!&461C=max%256 bmem%?&461E=1: Data disk cX%=buffer%:Y%=X%256:A%=14 d!!X%=1: &FFF1: Get time/date emem%?&461A=8*(~buffer%?2) f6mem%?&461B=(~buffer%?1)+16*((~buffer%?0)-1981) lmem%!&4620=&00440002 v,mem%!&4624=&4A:mem%!&4626=(max%256)-&4A mem%!&4628=0 $(mem%+&4700)="$ G" , a%=mem%+&470B mem%+&4720 4:!a%=0:  :  rd(s%)  l%,d% d%=mem%+256*s% & l%=0 255 4:buffer%!l%=d%!l%:  :  wr(s%)  l%,d% d%=mem%+256*s%  & l%=0 255 4:d%!l%=buffer%!l%:  SideDisk/s F` %.W  > SideDisk/s 1.00 $ Provide drives in sideways ram : (WORDV=&20C 2mcode%=&FFFF0A38 < addr=&A8:sect=addr+4:ptr=&AE F P=0 1 P P%=mcode% Z [OPT P*3 d.Intercept nCMP #90:BEQ NewWord x .OldWord JM  > SideDisk/s 1.00 $ Provide drives in sideways ram : (WORDV=&20C 2mcode%=&FFFF0A38 < addr=&A8:sect=addr+4:ptr=&AE F P=0 1 P P%=mcode% Z [OPT P*3 d.Intercept nCMP #90:BEQ NewWord x .OldWord JMP 0 .NewWord STX ptr:STY ptr+1 \ Check &0600 id marker: LDY #0:LDA (ptr),Y:BNE NotMe $INY:LDA (ptr),Y:CMP #6:BNE NotMe \ Bit7 commands go to HADFS: !LDY #11:LDA (ptr),Y:BMI NotMe \ Only RD & WR supported: BEQ NotMe:CMP #3:BCS NotMe \ Get number of sectors: PHA:DEY:LDA (ptr),Y:TAX \ Check drive number: %DEY:LDA (ptr),Y:CMP #8:BCC NotMe1 CMP #24:BCS NotMe1  #15:CMP &DC2:BEQ ForMe " .NotMe1 ,PLA:.NotMe 6LDX ptr:LDY ptr+1:LDA #90 @BNE OldWord J: T .ForMe ^\ 2..5=addr h\ 6..8=sec r\ 9=drv in A |\10=num in X $\11=type 1=write, 2=read, pushed  \ Ignore top byte of sector:  DEY:PHA  \ Get copy of sector & addr:  .AddrLp  DEY:LDA (ptr),Y:STA addr-2,Y CPY #2:BNE AddrLp \ Get drive back:  PLA:TAY \ No Tube support: BIT &27A:BPL IOMem LDA addr+2: addr+3 CMP #&FF:BNE NotMe1  .IOMem PLA:LSR A:BCC Read  \ Swap src & dest for write: &/LDA addr:PHA:LDA sect:STA addr:PLA:STA sect 07LDA addr+1:PHA:LDA sect+1:STA addr+1:PLA:STA sect+1 : .Read D \ X=num, Y=bank (drive 15) N\ Select rom/ram bank: XLDA &FE30:PHA bSTY &FE30:LDY #0 l .Loop v!LDA (sect),Y:STA (addr),Y:INY  BNE Loop  LDA sect:CLC:ADC #1:STA sect  LDA sect+1:ADC #0:STA sect+1 $LDA addr+1:CLC:ADC #1:STA addr+1  LDA addr+2:ADC #0:STA addr+2 DEX:BNE Loop PLA:STA &FE30 LDA #0:LDY #11:STA (ptr),Y RTS :  .start% LDA WORDV:STA OldWord+1 LDA WORDV+1:STA OldWord+2 "LDA #Intercept 255:STA WORDV  )LDA #Intercept 256 &FF:STA WORDV+1 RTS  ] *<"*SAVE SideDisk ";~mcode%;" ";~P%;" ";~start%&FFFF0000 Stats  W.1.00 u H h)i0   C   C L u  : . ' `ߎ Ҡ L `  `"LTitle: Option: Dir.  > Support/s v1.14 # Extra drive support for HADFS , 18-Jul-91 v1.00: 'L' serial link drive (" 12-Jan-92 v1.10: 'R' ramdisk 2, 22-Jan-04 v1.11: Add partition support .Osb90Claim HB #31:STA &F0 :\ Default to this drive R: \.ServClaimY f PLA:TAY p.ServClaim zPLA:LDA #0:RTS : : 5.Serv08 :\ OSWORD PHA:TYA:PHA CMP #"4"-&30:BNE P%+5:JMP HardDisk :\ '4' -> Hard drive 2>CMP #"5"-&30:BNE P%+5:JMP HardDisk :\ '5' -> Hard drive <;CMP #"M"-&37:BNE P%+5:JMP MMCDisk :\ 'M' -> MMCDisk F8CMP #"L"-&37:BNE P%+5:JMP SerialDrive:\ 'L' -> Link P;CMP #"R"-&37:BNE P%+5:JMP RAMDisk :\ 'R' -> RAMDisk Z .DiskNull dDTYA:LDX #&FF:RTS :\ No drive, don't claim n.RAMDiskPartFound xJLDA &FC00:CLC:ADC #1:STA &FC00:LDA &FC03:CLC:ADC sect+0:STA sect+0:PHP JLDA &FC00:CLC:ADC #1:STA &FC00:LDA &FC03:PLP:ADC sect+1:STA sect+1:PHP FLDA &FC00:CLC:ADC #1:STA &FC00:LDA &FC03:PLP:ADC sect+2:STA sect+2 \ Fall through into RAMDisk : \ ------------------------ \ RAM CARD ACCESS ROUTINES \ ------------------------ )\ Y=&00, &01, &02 - null, write, read \ X=sector count :  .RAMDisk .RAMDiskLoop ?LDA sect+0:STA &FC01:LDA sect+1:STA &FC02:\ RAMCard address BIT &27A:BPL RAMDiskIO .LDA addr+2: addr+3:CMP #&FF:BNE RAMDiskIO >TXA:PHA:TYA:PHA :\ Save registers "CCLC:ADC #5: #1:JSR TubeClaim :\ 1->7 write, 2->6 read ,APLA:TAX:PLA:TAX :\ Restore registers 6DEY:BEQ RAMWriteTube:DEY @.RAMReadTube J!STY &FC00:LDA &FC03:STA &FEE5 T'NOP:NOP:NOP:NOP:INY:BNE RAMReadTube ^LDY #2:BNE RAMTubeAddress h.RAMWriteTube r!STY &FC00:LDA &FEE5:STA &FC03 |(NOP:NOP:NOP:NOP:INY:BNE RAMWriteTube INY .RAMTubeAddress >TXA:PHA:TYA:PHA :\ Save registers .IDEAbsent HETYA:RTS :\ Return A=Y, no device R: \ .HardDisk f\ ------------------ p\ IDE DRIVE ROUTINES z\ ------------------ )\ Y=&00, &01, &02 - null, write, read \ X=sector count : DLDA IDEstatus:CMP #&FF:BEQ IDEAbsent :\ Quit if no interface DLDA #64:STA IDEcount:STA IDEsector :\ 64 sectors per track >LDA #3:STA IDEhead:LDA #&91:STA IDEcommand :\ Set geometry  .IDELoop "LDA &FF:BPL P%+5:JMP IDEEscape BLDA IDEstatus:BMI IDELoop :\ Wait for IDE ready DCLC:LDA #1:STA IDEcount :\ One sector at a time GLDA sect+0: #63:ADC #1:STA IDEsector :\ Pass 3-byte sector to IDE CLDA sect+1:ADC #0:STA IDEcylinder+0 :\ Start at cylinder 0 JLDA sect+2:ADC #0:STA IDEcylinder+1 :\ HADFS can't access b24-b27 FLDA drive:ROR A:PHP :\ Pass drive 4/5 into Cy BLDA sect+0:ROR A:ROR A:PLP:ROR A: :\ Join drive to head AROR A:ROR A:ROR A: #&13:STA IDEhead :\ Set device and head $>DEY:BEQ IDEWrite:DEY :\ Jump for write .: 88LDA #&20 :STA IDEcommand :\ &20=Read B .IDERdLp1 L>LDA &FF:BMI IDEEscape :\ Escape pressed VLLDA IDEstatus:BMI IDERdLp1 :\ Wait for command to complete `;LDA IDEstatus: #1:BNE IDEError :\ Error occured j@.IDERdLp2 :\ Fetch one sector t-LDA IDEdata:STA (addr),Y:INY:BNE IDERdLp2 ~LLDY #2:BNE IDEAddress :\ Y=2 - read, update addresses : .IDEWrite 9LDA #&30 :STA IDEcommand :\ &30=Write .IDEWrLp1 >LDA &FF:BMI IDEEscape :\ Escape pressed LLDA IDEstatus:BMI IDEWrLp1 :\ Wait for command to complete ;LDA IDEstatus: #1:BNE IDEError :\ Error occured ?.IDEWrLp2 :\ Send one sector -LDA (addr),Y:STA IDEdata:INY:BNE IDEWrLp2 ;INY :\ Y=1 - write : I.IDEAddress :\ Update addresses and loop ;LDA IDEstatus: #&21:BNE IDEError :\ Error occured JSR AddressUpdateOne GDEX:BEQ P%+5:JMP IDELoop:TXA:RTS :\ A=&00, X=&00, ok, claim : (.IDEEscape 2BLDA #&24 :\ Fake 'Abort' error < .IDEError FA IDEerror:PHA P8 #1:BNE IDENotPresent :\ 'No media' ZEQUS "HADFS:SerialLink":EQUB &00:EQUS "1.01 (18 Jul 1991)" .SerialLinkCopyright 4EQUB &00:EQUS "(C)J.G.Harston":EQUB &00:EQUB &00 .ModuleChainEnd : &: 0!\ --------------------------- :!\ SERIAL LINK ACCESS ROUTINES D!\ --------------------------- N)\ Y=&00, &01, &02 - null, write, read X\ X=sector count b: l.SerialDrive vLJSR SerInit:TYA:BCS SerReturn :\ Return A=Y, X<>0 if no driver :PHP:CLI :\ Enable IRQs APHA:JSR SerWrite:TXA:JSR SerWrite :\ Send Command,Count LDY #3 .SerCtrl :LDA sect,Y:JSR SerWrite:DEY:BPL SerCtrl :\ Send sector 0 LDY #0 <.SerReadBytes :\ Read a sector 1JSR SerRead:STA (addr),Y:INY:BNE SerReadBytes JSR AddressUpdateOne CDEX:BNE SerReadLoop :\ Loop for each sector BEQ SerDone : .SerWriteLoop * LDY #0 4=.SerWriteBytes :\ Write a sector >3LDA (addr),Y:JSR SerWrite:INY:BNE SerWriteBytes H?JSR SerRead:BNE SerResult :\ Return if ACK<>0 RJSR AddressUpdateOne \DEX:BNE SerWriteLoop f: p .SerDone z5LDA #&00 :\ &00=ok .SerResult GPLP:LDX #0 :\ Restore IRQs, claim call .SerReturn RTS : .SerRead 7PHA:TXA:PHA:TYA:PHA :\ Save all .SerRdLp GLDY #&FE:BIT &FF:BMI SerReadEsc :\ Abort with &FE if Escape ALDA #&91:LDX #&01:JSR OSBYTE :\ Check SERIN buffer FBCS SerRdLp :\ Loop until data present .SerReadEsc =TYA:TSX:STA &103,X :\ Store on stack :PLA:TAY:PLA:TAX:PLA :\ Restore all RTS : $ .SerWrite .7PHA:TXA:PHA:TYA:PHA :\ Save all 8 .SerWrLp B>BIT &FF:BMI SerWrEsc :\ Abort if Escape LBTSX:LDA &103,X:TAY :\ Get byte from stack V>LDX #&02:LDA #&8A:JSR OSBYTE :\ Write to SEROUT `ABCS SerWrLp :\ Loop until send ok j .SerWrEsc t:PLA:TAY:PLA:TAX:PLA :\ Restore all ~RTS :  .SerInit IPHA:TXA:PHA:TYA:PHA:LDX &F4:LDA &DF0,X :\ Save regs, get status byte =SEC: #7:BEQ SerInitExit:ADC #0 :\ Drive L disabled ;PHA:TAX:LDA #8:JSR OSBYTE :\ Set Rx speed ;PLA:TAX:LDA #7:JSR OSBYTE :\ Set Tx speed BLDA #&02:TAX:JSR OSBYTE:CLC :\ Enable serial input .SerInitExit ?PLA:TAY:PLA:TAX:PLA:RTS :\ Cy=1 if disabled :  EQUB 13 ?EQUS "&DF0,X b0-b2=(serial speed)-1 or 000 for OFF":EQUB 13 ,EQUS " b7 =ROM disabled":EQUB 13  BRK : : (]: 2="*Save SupportROM ";~mcode%;" ";~O%;" FFFF0000 FFFBBC00" Updates PLA:LDA #0 LDY #11:STA (ptr),Y RTS :  .start% LDA WORDV:STA OldWord+1 LDA WORDV+1:STA OldWord+2 "LDA #Intercept 255:STA WORDV  )LDA #Intercept 256 & HADFS Version 5.30 ================== There are some errors in the second edition printed manual. Refer to the text files in $.Manual for correct information. Page 27: *SETUSER is *ACCOUNT, and can also take a file as a parameter. When used with a file, the command is ignored for future compatability. The user number is now called the account number. Any additional parameters after the account are ignored, so the command *ACCOUNT FRED 002 (004) will be accepted, ignoring the auxillary account in parentheses. In general, 'account' is used interchangably with 'user number'. Page 29: Osfile &FD: returns account infomation in load address field. XY+2 and XY+3 contain the main account number, XY+4 and XY+5 contain the auxillary account number, currently set identically to the main account number. Do not depend on the exec address field containing any specific information at this stage. The only other infomation currently returned is the length and sector address. Osfile &FF: If the low byte of the execution address is Inoti zero, the file's own load address is used. Page 32: Function &FD, Y<>0; to read and write the CSD, LIB and URD use Y=&08/&88, &09/&89, &0A/&8A. Page 38: A year value of <&81 implies a century number of &20. A year value of >&80 implies a century number of &19. Page 80: In the definition of DEFFNgbpb8 is incorrect. It should be as follows: DEFFNgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL&FFD1 IFX%!5=1:="" name%?(1+?name%)=13:=$(name%+1) Page 82: DEFPROCConvDate is incorrect. It should be as follows: DEFPROCDate_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%=y%MOD400 d%=y%*365.25+m%*30+d%+VALMID$("120112234455",m%,1) d%=d%+((y%MOD4)=0)-((y%-1)DIV100) d%=d%-(m%>2AND((y%MOD4)=0AND(y%MOD100)<>0ORy%=0))+36493 IFd%>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%DIV256:ENDPROC Page 87: When preserving directory context, the following should be used: csd%=FNargs(&FD,8,0) /// csd%=FNargs(&FD,&88,csd%) Page 88: INY:CPY #10:BNE AddrLoop Ishould readi \ RAM-based code \ ROM-based code: INY:CPY #8:BNE AddrLoop:INY:INY INY:CPY #10:BNE AddrLoop  8W:P #&A0:BCS Osb90Claim :\ Should use b6/b5 as bitmap 44LDA &FC00:CLC:ADC #4:BNE OLibrary G?mBACKU ?i{Iib УBreak ? `CLoad ?h raCOMPAT Jo{ cCOPY ?!XpCrunc ? (sCSave ? itDISABE ?@ XvDisks ?* qwdisp ? 40$yETree i{10|Exploe ? bFileIfo ? p,Filer L{^/Files ? vXForm10 `?<`?xKillDS ?@ X qlpS ?;XxMakeL D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O  >BACKUP v1.20 01-Dec-1998  Backup program 4 v1.15 28-12-1997: More display, tidier program (7 v1.16 11-01-1998: Countdown counts down (not up!) 2/ v1.18 20-03-1998: Command line parameters <- v1.19 10-08-1998: Missed OR&20 replaced F+ v1.20 01-12-1998: Can use disk images 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 - ctrl%30,data%maxlen%:X%=ctrl%:Y%=X%256  : 'Close:fs%<>fs:"FX143,18,"+fs% "ch%=ch%:ch%:A%=ch%:ch%=0:#A%  #ݤh0(A%,N%)="0000000"+~A%,N%) #ݤfs:A%,X%,Y%,E%:=(&FFDA)&FF : ,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%: 6=?X%=Dv%:X%!1=Ad%:X%?5=3:X%?6=Cmd%:X%?7=Sc%10:X%?8=Sc%10 @;X%!9=Num%32:X%?7>79:X%?7=X%?7-80:?X%=?X% 2: Side 2 J'13:Cmd%=&53:"Read "; "Write"; TI" "h0(Dv%,1)":"h0(Sc%,6)"+"h0(Nm%256,2)" "h0(tries%-try%,1)" "; ^6 OSWORD:Derr%=X%?10:try%=try%-1:Derr%=0 try%=0 h,Derr%:err(Derr%);(39-);:Nm%=&100: rlCmd%=&53 Derr%=0:;read%+Nm0%-Nm%;" bytes read"; Cmd%=&4B Derr%=0 ;write%-Nm0%+Nm%;" bytes left"; |<(39-);:Ad%=Ad%+Num%*256:Sc%=Sc%+Num%:Nm%=Nm%-Num%*256 &Nm%<1 Derr%:"FX143,18,"+fs%: : 1ݤerr(A%):A%<&08 A%>&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)) : Dseek:?X%=Dv%:X%?5=1:X%?6=&69:X%?7=(Sc%10)(Sc%>10): OSWORD: : Agpb:Sc%=Sc%*256:A%=fn$,":"):A%:fn$,A%-1):fn$=fn$,A%+1) CCmd%=&53:A%=3:ch%=(fn$) A%=1:Sc%=0:ch%=(fn$) ch%=(fn$) W?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$ &#sdrv%=-1:sdrv$=1:sdrv%=sdrv$ 0#ddrv%=-1:ddrv$=1:ddrv%=ddrv$ :-1:same%:"Using same drive." Dtrk%=-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 ' Nspt%=0:spt%=10 Xtrk%=0:trk%=80 bsides%=0:sides%=2 ltries%=0:tries%=10 v :  backup 9read%=0:write%=2560*trk%*sides%:s%=0(sides%-1)*2 2 Gsect%=0:length%=trk%*2560::num%=maxlen%:num%>length%:num%=length% : Isame%:13"Insert source disk and press a key";:祄1:13;(39);13; MDrd(data%,(sdrv%+s%)(sdrv%<0),sect%-(spt%*trk%)*(s%=2 sdrv%<0),num%)  Derr%:num%=(num%&FFFE00)2 ,Derr%=0 num%<&100:num%<&100:num%=&100 (Derr%=0 num%=&100:read%=read%+num% : Hsame%:13"Insert dest. disk and press a key";:祄1:13;(39);13; MDwr(data%,(ddrv%+s%)(ddrv%<0),sect%-(spt%*trk%)*(s%=2 ddrv%<0),num%)  Derr%:num%=(num%&FFFE00)2  7Derr%=0 Derr%=&12 num%<&100:num%<&100:num%=&100 *Derr%=0 num%=&100:write%=write%-num%  CDerr%=&12:'"Destination disk write protected":length%=0:s%=99 *-sect%=sect%+num%256:length%=length%-num% 4(length%<1 Derr%=&12:s%:13;(39) >ddrv%>-1: H :Close:end R7A%=ddrv$,":"):A%:ddrv$,A%-1):ddrv$=ddrv$,A%+1) \4X%!2=&FFFB2200:A%=file(ddrv$,2):"Stamp "+ddrv$ f Close: p: zBݤfile(A$,A%):$data%=A$:?X%=data%:X%?1=data%256:=(&FFDD)&FF 6ݤOS_GetEnv:A$:A%=0:X%=1:os%=((&FFF4)&FF00)256 Aos%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ",1+A$," "))) os%=32:A$=$&100 /A$=0:?(P-3):A$=$&600 A$=0:A$=$&3800 -A%=A$+" "," "):run$=A$,A%-1):=A$,A%+1) : Hݤcl(l$,n%):l$="":I%=A$+" "," "):l$=A$,I%-1):A$=s(A$,I%+1)):=l$ l$=32 A$<>"":A$=" "+A$ bI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) qI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-2-(I%=1)) I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+l$)+1) "A$=s(A$):n%:=s(l$) =I%<>0 /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ : (os(A$):A$=""A$=42:A$: A$: $: .0end:quit$<>"":A$=quit$:quit$="":os(A$): 8: B(C) {H {h H {h * pq?risrpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC MBLib :BFont MW" # > BLib.BFont 1.00 23-Feb-1991 :  BiBLib BFont M?Close M?`ECmdLie H? sHDate N?@8dFileI O?&m?h,MOS I?.vh12Mouse N?"N4Numbe O?SVȬ7Pathnme O?v=ProgEv O?a1JjDStrin N?k:IStrinIO N?@VOئLTime ? @OTokense N?@=A>a\lKeyboard0.12 (01 Aug 1998)a`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGH D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O # > BLib.BFont 1.00 23-Feb-1991 :  Bitmap font routines ( ==================== 2( This version uses serial BGET/BPUT <: F: P# BFont_Load - Load bitmap font Z# ----------------------------- d: n-BFont_Load(A$): in%:in%=(A$):in%=0: x#in%:#in%:#in%: : : # BFont_Save - Save bitmap font # -----------------------------  A$ - filename to save to " S% - start character to save E% - end character to save : BBFont_Save(A$,S%,E%): out%,L%,X%,Y%,A%:out%=(A$):out%=0: @ X% -1:Y%=X%256:A%=10::?X%=S%: &FFF1:#out%,23:#out%,S% 5 L%=1 8:#out%,X%?L%::S%=S%+1:S%>E%:#out%: Close M`W< ! > BLib.Close 1.00 09Aug1998 :  Close Handling ( ~~~~~~~~~~~~~~ 2: <Cl # > BLib.CmdLine 1.00 09Aug1998 :  Command Line Parsing ( ~~~~~~~~~~~~~~~~~~~~ 2: "":A$=" "+A$ PbI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) ZqI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-2-(I%=1)) I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+l$)+1) d"A$=s(A$):n%:=s(l$) =I%<>0 n/ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " x+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ Date N@8dW" " > BLib.Date 1.03 13-Mar-2007 % Time and date support functions : (C)J.G.Harston, may be freely used and redistributed (K v1.00 12-Sep-1992 JGH: FromOrd(), DayOfWeek(), Day(), Mon() function " > BLib.Date 1.03 13-Mar-2007 % Time and date support functions : (C)J.G.Harston, may be freely used and redistributed (K v1.00 12-Sep-1992 JGH: FromOrd(), DayOfWeek(), Day(), Mon() functions 26 v1.01 18-Feb-1994 JGH: ToOrd() and Since() added <- v1.02 17-Sep-2005 JGH: ToOrd() debugged FC v1.03 13-Mar-2007 JGH: Added [To|From][Day|Month]() functions P: Z9 REQUIRE FNDate_FromDay() needs FNuc() from String d9 REQUIRE FNDate_FromMonth() needs FNuc() from String n: x: 6 FNDay(day%) - return 3-char day of week string 0 FNMon(month%) - return 3-char month string 6 ------------------------------------------------ : 4ݤDay(A%):="000SunMonTueWedThuFriSat",A%*3+1,3) LݤMon(A%):="000JanFebMarAprMayJunJulAugSepOctNovDecDDDEEEFFF",A%*3+1,3) : : B FNDate_FromDay(A$) - return day number for supplied string D FNDate_FromMonth(A$) - return month number for supplied string D -------------------------------------------------------------- : !ݤDate_FromDay(A$):A$=uc(A$) 'A%="SUNMONTUEWEDTHUFRISAT",A$,3)) (A%-1)3=0:=A%3+1 =0 : "#ݤDate_FromMonth(A$):A$=uc(A$) ,6A%="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",A$,3)) 6(A%-1)3=0:=A%3+1 =0 @: J: TD FNDate_ToDay(day%) - return full-length day of week string ^> FNDate_ToMonth(month%) - return full-length month string hD -------------------------------------------------------------- r: |ݤDate_ToDay(A%) Z="SunMonTueWednesThursFriSatur","01040710162124",A%*2-1,2),"3336535",A%,1))+"day" : ݤDate_ToMonth(A%) ="JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember","010816212629333743525967",A%*2-1,2),"785534469788",A%,1)) : : P FNDate_DayOfWeek(day%,month%,year%) - return day of week for supplied date @ 1=Sunday, 7=Saturday P -------------------------------------------------------------------------- : (ݤDate_DayOfWeek(d%,m%,y%):y%=y%400 q=(y%*365.25+m%*30+d%+"120112234455",m%,1)+((y%4)=0)-((y%-1)100)-(m%>2((y%4)=0(y%100)<>0y%=0))+3)7+1 : : K PROCDate_FromOrd - convert time and date to 5-byte centi-second count * On entry: mem%->five bytes of memory &, day, month, year of the date 0A hours, minutes, seconds, centiseconds of the time :I On exit: mem% to mem%+4 containes five-byte centisecond time since D' 00:00:00 on 1-Jan-1900. NK --------------------------------------------------------------------- X: b;Date_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%=y%400 lqd%=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 vd%>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: : : I PROCDate_ToOrd - convert 5-byte centi-second count to time and date K On entry: mem%->five bytes of memory containing five-byte centisecond 2 time since 00:00:00 on 1-Jan-1900. , On exit: day, month, year of the date A hours, minutes, seconds, centiseconds of the time K --------------------------------------------------------------------- : $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 4*year%=D%146097*100+B%1461+A%12-4800 > H: R: \> FNDate_Since - return number of days since a past date fI On entry: td%, tm% and ty% should be set to today's date, month and pI year and pd%, pm% and py% should be set to the past date, z month and year. ( Requires X%->5-byte control block I ------------------------------------------------------------------- : 1ݤDate_Since(td%,tm%,ty%,pd%,pm%,py%): past% 4Date_FromOrd(X%,pd%,pm%,py%,0,0,0,0):past%=X%!1 =Date_FromOrd(X%,td%,tm%,ty%,0,0,0,0):=(X%!1-past%)&83D6 : FileIO O&m?hW< " > BLib.FileIO 1.01 07Sep2006 < v1.01 07Sep2006 JGH: FNargs avoid zero page on RISC OS * v1.00 09Aug1988 JGH: Initial ver " > BLib.FileIO 1.01 07Sep2006 < v1.01 07Sep2006 JGH: FNargs avoid zero page on RISC OS * v1.00 09Aug1988 JGH: Initial version (: 2% General File Interface Routines <% =============================== F: P, Returns file type, file info in X%!... Z, -------------------------------------- dBݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF n: x General OSGBPB call  ------------------- Ugbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%: &FFD1: : @ Return current disk (5), directory (6) or library (7) name @ ---------------------------------------------------------- Bݤgbpb(A%):X%!1=name%:&FFD1:A%=name%+((1+?name%)((A%-2)=6)) A%?(1+?A%)=13:=$(A%+1) : B Returns entry in current directory, or null string if at end B ------------------------------------------------------------ Eݤgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:&FFD1:X%!5=1:="" #A%=name%:A%?(1+?A%)=13:=$(A%+1) : 7 OSARGS call with data. Returns any returned data 7 ------------------------------------------------- 4ݤargs(A%,Y%,ptr%): X%,E%:?(P-3)=0:E%=Y%:Y%=0 "/<&8000: !&70:X%=&70:!X%=ptr%:&FFDA:=!X% ,)ș"OS_Args",A%,Y%,ptr% ,,ptr%:=ptr% 6: @' OSARGS call ignoring X, returns A J' --------------------------------- T=ݤargsA(A%):<&8000: X%,Y%,E%,!&70:X%=&70:=(&FFDA)&FF ^ș"OS_Args",A% A%:=A% h: r& Get current filing system number |& -------------------------------- !ݤfs: A%,Y%,E%:=(&FFDA)&FF MOS I.v  > BLib.MOS 1.00 09Aug1998 : $ General MOS Interface Routines ($ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2: < Osbyte Calls F ~~~~~~~~~~~~ P: ZJ FNbyte returns the single byte in the X register for the named call. d1 FNfx returns the two-byte value held in XY. n)ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 x6ݤfx(A%,X%): Y%:Y%=X%256:=((&FFF4)&FFFF00)256 Mouse N"NW>  > Mouse 1.00 12-Sep-1992 :  Mouse & Pointer Routines (: 2Pointer_Init < F: PPointer_Dra  > Mouse 1.00 12-Sep-1992 :  Mouse & Pointer Routines (: 2Pointer_Init < F: PPointer_Draw Z!0,7:0,0,-12:2,0,12:2,12,0 d 0,-12,0:2,32,-32:0,-32,32 n x: Pointer_UntilAction   mx%,my%:Pointer_Draw Mouse_UntilAction Pointer_Draw: mx%,my% 0(obl%<>bl%)(obm%<>bm%)(obr%<>br%)((-1))  : Mouse_Init !mx%=0:my%=0:bl%=0:bm%=0:br%=0  : Mouse_UntilAction 0omx%=mx%:omy%=my%:obl%=bl%:obm%=bm%:obr%=br%  Mouse_Read "H(omx%<>mx%)(omy%<>my%)(obl%<>bl%)(obm%<>bm%)(obr%<>br%)((-1)) , 6: @Mouse_Read J0mx%=(7):my%=(8):bl%=-11:bm%=-12:br%=-13 T ^: Number OSVW9 " > BLib.Number 1.01 09Aug1988 ( v1.00 09Aug1988 JGH: First version 1 v " > BLib.Number 1.01 09Aug1988 ( v1.00 09Aug1988 JGH: First version 1 v1.01 xxxxxxxxx JGH: Added Octal and Binary (4 Bug: Octal and Binary don't work for &8xxxxxxx 2: < Number Output Routines F ~~~~~~~~~~~~~~~~~~~~~~ P Z# Hexadecimal padded with zeros d#ݤh0(A%,N%)="0000000"+~A%,N%) n: x$ Hexadecimal padded with spaces "ݤh(A%,N%)=" "+~A%,N%) :  Decimal padded with zeros #ݤd0(A%,N%)="00000000"+A%,N%) : Decimal padded with spaces #ݤd(A%,N%)=" "+A%,N%) :  Octal padded with zeros ?ݤo0(A%,N%): A$,B$:A%<0:B$="7":A%=A% &7FFFFFFF B$="0" 7 A$=(A% 7)+A$:A%=A% 8: A%=0:=N%,B$)+A$,N%) :  Octal padded with spaces >ݤo(A%,N%): A$,B$:A%<0:B$="7":A%=A% &7FFFFFFF B$=" " 7 A$=(A% 7)+A$:A%=A% 8: A%=0:=N%,B$)+A$,N%) : " Binary padded with zeros ,?ݤb0(A%,N%): A$,B$:A%<0:B$="1":A%=A% &7FFFFFFF B$="0" 66 A$=(A% 1)+A$:A%=A% 2:A%=0:=N%,B$)+A$,N%) @: J Binary padded with spaces T>ݤb(A%,N%): A$,B$:A%<0:B$="1":A%=A% &7FFFFFFF B$=" " ^6 A$=(A% 1)+A$:A%=A% 2:A%=0:=N%,B$)+A$,N%) h: r) Drive character for supplied number |ݤdrv(A%)=(48+A%-7*(A%>9)) : ) Drive number for supplied character "ݤDrv(A$)=A$-48+7*(A$>"9")31 Pathname ɘH heL䙩 ` əHȽ! Jh8ɝ`ȹ J0 L` u _)L.#  ! ıƽ ȑ00 . i 8` 豾)!  $ > BLib.Pathname 1.01 19Sep1992 * v1.00 19Sep1992 JGH: Initial version 1 v1.01 15Mar1995 JGH: Functions named Path_* (: 2" Directory Pathname Functions <" ============================ F: PJ FNPath_Name - Return pathname with drive number or name if no number Z7 FNPath_Full - Returns full pathname with diskname dI The returned pathname can be used to select the directory with *DIR nJ -------------------------------------------------------------------- x: ݤPath_Name:A%=6 ݤPath_Full:A%=&106 n$,p$::X%!1=name%: &FFD1 *?(name%+2+?name%+?(name%+?name%+1))=13 n$=$(name%+2+?name%):*DIR ^ n$=n$,n$+" "," ")-1) p$=n$+"."+p$:n$="$"n$="&" p$=p$,p$-1):"DIR "+p$ VA%=6:X%!1=name%: &FFD1:?(name%+1+?name%)=13:n$=$(name%+1):n$<>"":=":"+n$+"."+p$ X%!1=name%:A%=5: &FFD1 &?(name%+1+?name%)=13:n$=$(name%+1) )n$=n$,n$+" "," ")-1):=":"+n$+"."+p$ : : * FNPath_Lib - Return library pathname * ------------------------------------ ": ,ݤPath_Lib 6 a$,b$:a$=Path_Name:*DIR % @ b$=Path_Name:"DIR "+a$:=b$ J: T: ^3 FNPath_LibFull - Return full library pathname h3 --------------------------------------------- r: |ݤPath_LibFull  a$,b$:a$=Path_Name:*DIR %  b$=Path_Full:"DIR "+a$:=b$ : : & FNPath_URD - Return URD pathname & -------------------------------- : ݤPath_URD  a$,b$:a$=Path_Name:*DIR &  b$=Path_Name:"DIR "+a$:=b$ : : / FNPath_URDFull - Return full URD pathname / ----------------------------------------- : ݤPath_URDFull & a$,b$:a$=Path_Name:*DIR & 0 b$=Path_Full:"DIR "+a$:=b$ :: ProgEnv Oa1JjW! # > BLib.ProgEnv 1.04 09Jan2007 : # Program Environment Functions (# ============================= 2 # > BLib.ProgEnv 1.04 09Jan2007 : # Program Environment Functions (# ============================= 2: &FFFF:ș"GetModuleFileName",0,X%,255:A$=$$X%:run$=A$:=@cmd$ xos%=32:A$=$&100 {A$=0:>&7FFF:run$=$&8100:ș"OS_GetEnv"A$,,A%:ș"OS_WriteEnv","",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ 2A$=0:?(P-3):A$=$&600 A$=0:A$=$(-&300) 7A%=A$+" "," "):run$=A$,A%-1):run$<>"":=A$,A%+1) bY%=X%256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:&FFD1:A%=X%+16:!A%?A%+A%?2<>8:A%?(A%+1)=13:=$(A%+1) ="" : . Run a program, passing it a command line = If program is *Command, called with OSCLI, else CHAINed = ------------------------------------------------------- &os(A$):A$=42:A$ A$<>"":A$  : ( Exit program, setting return value ( ---------------------------------- @exit(A%):"FX1,"+A%:quit$=quit$:A$=quit$:quit$="":os(A$) os%=32:Ș A% "os%<6: *Quit , 6: String Nk:W" " > BLib.String 1.00 09Aug1998 : # String Manipulation Functions (# ============================= 2: <7 FNs() - strip spaces from start and end of string F7 ------------------------------------------------- P/ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " Z+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " d=A$ n: x+ FNuc() - convert string to upper case + ------------------------------------- ݤuc(A$): B$:A$="":="" 5B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ : + FNlc() - convert string to lower case + ------------------------------------- ݤlc(A$): B$:A$="":="" 5B$=B$+(A$((A$<"_")&20)):A$=A$,2):A$="":=B$ : StringIO N@VOW; $ > BLib.StringIO 1.00 15Feb2004 :  String I/O routines ( $ > BLib.StringIO 1.00 15Feb2004 :  String I/O routines ( =================== 2* v1.00 - uses slow serial file access <: F: PE rd(in%) - Read a , or terminated string from in% ZE --------------------------------------------------------------- d: nݤrd(i%):A$: x&A%=#i%:A%<>10 A%<>13:A$=A$+A% A%=10 A%=13 #i%:=A$ : : I wr(out%,A$) - Write A$ to out%. A$ must include required terminator I ------------------------------------------------------------------- : wr(o%,A$):A$="": !A%=1A$:#o%,A$,A%,1):: Time  W( " > BLib.Time 1.03 12-Aug-2006 ! RTC Time and date functions : (C)J.G.Harston, may be freely used and redistributed (: ------------------------ " > BLib.Time 1.03 12-Aug-2006 ! RTC Time and date functions : (C)J.G.Harston, may be freely used and redistributed (: ---------------------------------------------------- 2/ All functions assume global control block <0 pointed to by X%,Y% and set up as follows: F( DIM ctrl% 31:X%=ctrl%:Y%=X%DIV256 P: Z: d' Real-Time-Clock reading functions n' ================================= x: H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I FNtime - return RTC time&date or null string if none present L returned date is correct for years after 1996 and 1999 : (ݤtime:?X%=0:A%=14:&FFF1:?X%=0:="" X%?24=13:A%=$(X%+4):$(X%+4)="0"+(A%31),2):$(X%+11)=($(X%+11)+(A%&E0)2-100*($(X%+11)<1981)):X%?6=32:X%?15=46:=$X% : H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C FNTime - Return time&date or null string if none found A On-board RTC and fileserver RTC are checked 0 and day of week calculated : 6ݤTime:!X%=1:A%=14:&FFF1:A%=07:X%?A%=~X%?A%: time:year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0 A%=14:!X%=1:&FFF1:!X%=1: A%=07:X%?A%=~X%?A%: 2((y%4)=0(y%100)<>0y%=0))+3)7+1 : #ݤd0(A%,N%)="00000000"+A%,N%) Tokenise N@=A>aW< & > BLib.Tokenise 1.00 11-Jun-2006 :  Tokenise BASIC lines ( ==================== 2( Generalised cross-platform library <: F Authors: P$ Richard Russell for BBFW code Z# J.G.Harston for RISC OS code & > BLib.Tokenise 1.00 11-Jun-2006 :  Tokenise BASIC lines ( ==================== 2( Generalised cross-platform library <: F Authors: P$ Richard Russell for BBFW code Z# J.G.Harston for RISC OS code d J.G.Harston for 6502 code n: x FNTokenise_()  -------------  Tokenise a line of text  Returns: tokenised string  ------------------------- : &ݤTokenise_(A$):=Tokenise_ARM(A$) %ݤTokenise_(A$):=Tokenise_65(A$) &ݤTokenise_(A$):=Tokenise_Z80(A$) &ݤTokenise_(A$):=Tokenise_Win(A$) + Should select appropriate subfunction : : ݤTokenise_ARM(A$): A%,B% ,ș "XOS_GenerateError",0,255,"*") ,A% B%=("0:"+A$):=$(A%-14) : "ݤTokenise_Win(A$): A%,B% ,ȕA$,1)=" ":A$=A$,2): 6B%=("0:"+A$):=$(!332+2) @: JݤTokenise_65(A$): A% T(A%=("0:"+A$):=$((!4 &FFFF)-A$-1)  8W:Break  W3V1.02 `^~ ȥ򥩅8 j 0z   0L` LL V1.02 `^~ ȥ򥩅8 j 0z   0L` LL (`L (` `CLoad h rW3ȱ `ȱ! ` Syntax: CLoad (/X)  N N `0:ȱ `ȱ! ` Syntax: CLoad (/X)  N N `0: )GA)`     )X < Hr s r  hH| } }  hHw -v u hHr s @ Ar h+ 6 J  j r Lr L Not foundx y z u v `Hjs w t r h w `Vers1.03COMPACT Jo{ W2  > COMPACT 2.30 V&87:A$=OS_GetEnv:OSGBPB=&FFD1:OSFILE=&FFDD:"Disk Compacter Version 2.30":*HADFS $quit$=  > COMPACT 2.30 V&87:A$=OS_GetEnv:OSGBPB=&FFD1:OSFILE=&FFDD:"Disk Compacter Version 2.30":*HADFS $quit$=cl(" -q",1):::end() (Ecl("-?",0):'"Syntax: "run$" () (-quit )":end(0) 2'A$,1)=" ":A$=A$,2):A$,1)<>" " <+maxlength%=-P-2000: data% maxlength% F$"Buffer length: &";~maxlength%' P,drv$=A$:drv$="":"Drive: "drv$ A$="C" Zdrv$=drv$,1):"DIR :"+drv$ d(dv%=8-(ver>&4D):nm%=dv%+1:ct%=dv%+2 n> ctrl% 19,ctrl2% 19,FSM% 255,name% 19:total%=&200:flen%=0 xwrite%=:esc%=0:*FX229,1 *DIR$ <:saves%=0:C_DoDir("$",1):C_DoDir("$",2):A%=look(0,0) "A%<&28 saves%=0 esc%:*FX229 + A%<&27 "Maximum compaction achieved" end(0) : C_DoDir(path$,match%) ! A%,X%,Y%,index%,ret%,saved% index%=0:saved%=: X%=ctrl%:Y%=X%256:A%=8 *X%!1=name%:X%!5=1:X%!9=index%: OSGBPB *ret%=X%!5:index%=X%!9:(-1):esc%==27  ret%=0 C_DoFile(path$) #ret%<>0 esc%:saved% esc%: : C_DoFile(path$) "4 A%,X%,Y%,start%,exec%,length%,attr%,sec%,file$ ,)?(name%+?name%+1)=13:file$=$(name%+1) 6f!ctrl2%=name%+1:X%=ctrl2%:Y%=X%256:A%=&FD:A%=( OSFILE)&FF:sec%=(X%!14)&FFFFFF:drive%=ctrl2%?17 @J!ctrl%=name%+1:X%=ctrl%:Y%=X%256:A%=5:A%=( OSFILE)&FF:A%<>match%: J4start%=X%!2:exec%=X%!6:length%=X%!10:attr%=X%!14 T[ A%=2 "DIR "+file$:C_DoDir(path$+"."+file$,1):C_DoDir(path$+"."+file$,2):"DIR ^": ^/A%<>1:path$;".";file$;" is not a file.": hln2%=(length%+255)256 r+look(sec%,ln2%):path$;".";file$; |4length%>maxlength%:" - too long for buffer.": =" ";hex(start%,8);"+";hex(length%,4);" ";hex(exec%,8) > (attr% 8) (attr% 1)=0 A%=&FF "ACCESS "+file$+" R" 7"LOAD "+file$+" "+~data%:write%=:saves%=saves%+1 N"SAVE "+file$+" "+~data%+"+"+~length%+" "+~exec%+" "+~start%:saved%= (X%=ctrl%:Y%=X%256:A%=4: OSFILE:: #ݤlook(sec%,length%): X%,Y%,A% write%:loadFSM:write%= QDptr%=&1C::Dptr%=Dptr%+4:sect%=(FSM%!Dptr%)&FFFF:len%=!(FSM%+Dptr%+2)&FFFF ?sect%=0 (sect%=length%)) =sect%:"Found: start &";hex(sect%,4);", length=&";~len% sec%=0:=Dptr% =sect%<>0 *ݤhex(A%,N%):=N%-~A%,"0")+~A%,N%)  loadFSM cX%=ctrl2%:Y%=X%256:!X%=&600:X%!2=FSM%:X%!6=70:X%?dv%=drive%:X%?nm%=1:X%?ct%=&80:A%=90:&FFF1: :ݤver:A%,X%,E%,Y%:X%=&70:A%=&FD:&FFDA:=?&73+256*?&72 : &6ݤOS_GetEnv:A$:A%=0:X%=1:os%=((&FFF4)&FF00)256 0Aos%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ",1+A$," "))) :os%=32:A$=$&100 D2A$=0:?(P-3):A$=$&600 A$=0:A$=$(-&300) N-A%=A$+" "," "):run$=A$,A%-1):=A$,A%+1) X: b*ݤcl(l$,n%):l$=32 A$<>"":A$=" "+A$ lZI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$," ")-1) vkI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-1+(A$=32)) I%:A$=A$,I%-1)+A$,A$," ",A$," ",I%)+l$)+1) n%:=l$ =I%<>0 : (os(A$):A$=""A$=42:A$: A$: : end(A%): 5quit$<>"":A$=quit$:quit$="":"FX1"+A%:os(A$): : B(C) {H {h H {h * pqJros rpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC COPY !W+Not HADFSSyntax: COPY Not found ©Z  Not HADFSSyntax: COPY Not found ©Z   ȱ! ei У@     Ӡ    !  a q L L    ` LZ0)0OJ ) ?:)0I0-K($  8 I8e`0)0ﭫ ) ߭ک)0I0ͭKȩ 8 Ư(``L0.16Crunch  W3(Not in BasicK͌pqprqs   8   ȱpr p: ȩ rr м rs`pr`eppeqq`erress`1.01CSave iW! ȱ `ȱNot in BasicK͌pqprqs   8   ȱpr p: ȩ rr м rs`pr`eppeqq`erress`1.01CSave iW! ȱ `ȱ! ` (Syntax: CSave (X)`  ȱ `ȱ! ` (Syntax: CSave (X)`  U U `0: )GA)`Can't open_ ` a \ ] `H [ Y hL  C h C  )XʆHX f Y | h iZ ^ hHg gZ ^ h ůh ˩Y h,f Y Z [ X  ^ _ ` a L`Vers1.03DISABLE @ W+&    )ύ `L )  L?  H y LhL&    )ύ `L )  L?  H y LhLDisks * W6qV1.04Drv TitleFree Used `         i: V1.04Drv TitleFree Used `         i:      0 H FffFff K h8 W:LH A LH  L ` 8 B@ 8  8 ' 8  8 d 8 8  N 0 0`L8嬅孅宅eee` DIR :0 disp  4W&$J J/J `     `  `(L, J J/J `     `  `(L,  HH $ hh (` p\ 檮 L L  1 !&L   L )`M ` ) @ ` H)ߢ@B> I8S2W,Q(X$Y h     L h) 娅%I- E ` ) P f L( ) ) N N N N N N N , P  ,  )2  > (>  J~ (~      L Lv1.06ETree plied character "ݤDrv(A$)=A$-48+7*(A$>"9")31 Pathname ɘH heL䙩 ` əHȽ! Jh8ɝ`ȹ J0 L` u _)L.#  > ETree v1.17 29-Jul-2007 Ud%31,C%31,`%39:A$=E:X%=d%:Y%=X%256:A$="":"Path to show: "B$:B$," -"):A$=B$ (iA$="":"Show files? "S$:"Show info? "I$:"Printer chars? "P$:A$=B$+x("f",S$)+x("i",I$)+x("p",P$) 2,L%=0:k%=G:C$=B(" -q",1):::B(): <}B("-?",0):"Syntax: ETree [-apps] [-count] [-files] [-grain ] [-info] [-list] [-mask ] [-print] path":B(0) Fse%=B("-a",0):M%=B("-c",0):D%=B("-f",0):O%=B("-i",0):F%=B("-l",0):f%=B("-p",0):U%=B("-g",1):U%=0:U%=256 d%J%=0:S$=B("-m",1):S$<>"":J%=S$ n5E$="":A%=A$,":"):A%>1:E$=A$,A%-1):A$=A$,A%+1) x6B$=A$:E$:l%=(C("^",5)-2)=2:G<>16:J%=0:J%=&3B ?B$<>"":(C(B$,5)-2)<>2:B$;" is not a directory":B(190) -H(f%):F%:C("$",5)=2:X%!2<>0:*INFO $ -J%=(J%&FF)&300:i%=D:B$<>"":"Dir "+B$ %F%:"Disk: ";H(5)'"Dir: "H(6) Q?`%=32:B%=F(0,0,0):'"Total disk space used: ";B%" bytes";:M%:" - "k(B%); A(i%)::B(0): %B(E%):L%=L%:L%:A%=L%:L%=0:#A% "FX143,18,"+k%:D(E%): ݤF(P%,R%,Z%):Q%,B%,G%,K%,f$:G%=R%:B%=0:a%=0:K%=:G=142:ș"OS_GBPB",9,"@",C%,1,G%,32,0,,,Q%,G%:Q%=1-Q%:f$=s($C%,$C%,0)-1))f$=I(G%):G%=X%!9:Q%=X%?5 Q%=0R%<>0D%::= Q%=0:E(R%) "Q%<>0a%:R%<>0:=a% ,=B% 6kE(R%):H%:a%=:H%=C(f$,5):g%=X%!2:h%=X%!6:V%=X%!10:W%=X%?14:_%=X%!15:G=5:A(18,64+f$)=0:_%=X%!10 TfH%=2:b%<>6:G=5:L%=f$:L%:A%=A(12,(J(&80,L%,2^(L%-32))&FF)+2):V%=(X%!4)&FFFFFF:#L%:L%=0 ^@W%=W%+(H%-1)*256:B%=(B%+V%+U%-1)-U%:R%<>0(H%=2D%):a%=: r!Z%(D%F%H%=2):I(f$):K%= |>H%=2(f$,1)<>"!"e%=0):C(f$):B%=B%+F(P%+1,0,Z%):G(f$)   I(f$):S%:F%:FB$;"."; af$;:O%(F%(F%D%)):(34-+10*M%);K(g%,8);" ";K(h%,8);" ";K(V%,6);O%:(56-+10*M%); 1O%:" ";N(W%J%);" ";:F%(F%D%):L(_%); ]M%:((30-)O%-O%);:H%=2:S%=D%:D%=:C(f$):k(F(P%,0,));:D%=S%:G(f$)M%:k(V%); : /F:c%=F(P%,G%,0):c%:`%?P%=c%(3)`%?P%=32 0P%>1z%=0P%-2:`%?z%,32::`%?z%P%=1?`% K%P%>0c%(4)P%>032 "c%((c%1)((K%(P%=0))4)): %C(f$):B$=B$+"."+f$:"DIR "+f$: ,G(f$):B$=B$,B$-f$-1):l%:"DIR ^": 0"DIR "+B$: :iH(j%):c%(5):z%=05:c%(z%)=z%+166::j%c%(0)=&C4:c%(1)=&C2:c%(2)=&FE:c%(3)=&B3:c%(4)=&C0:c%(5)=&C3 X23,c%(0),0,0,0,255,0,0,0,0:23,c%(1),0,0,0,255,24,24,24,24:23,c%(3),24,24,24,24,24,24,24,24:23,c%(4),24,24,24,24+7,0,0,0,0:23,c%(5),24,24,24,24+7,24,24,24,24:  ݤN(A%):a$:(A%128):a$="P" (A%8):a$=a$+"L" ,(A%&100):a$="D"+a$+"/":=a$+7-a$," ") (A%6)=2:a$=a$+"W" (A%4):a$=a$+"E" (A%5)=1:a$=a$+"R" #a$=a$+"/":(A%96)=32:a$=a$+"W" (A%64):a$=a$+"E" (A%80)=16:a$=a$+"R" =a$+7-a$," ")  [ݤL(A%):=M(A%31,2)+"/"+M((A%&F00)256,2)+"/"+M(1981+(A%&F000)&1000+(A%&E0)2,4) Hݤk(A%):A%>4100:=" "+(A%1024),5)+"K"=" "+A%,5)+" bytes"  2ݤx(o$,v$):v$,1)="Y"v$,1)="y":=" -"+o$="" * ݤD:=0 4 A(A%): >rݤE:A$,A%:X%=1:b%=((&FFF4)&FF00)256:X%-1:b%=32:>&FFFF:ș"GetModuleFileName",0,X%,255:A$=$$X%:D$=A$:=F$ Rb%=32:A$=$&100 \wA$=0:>&7FFF:D$=$&8100:ș"OS_GetEnv"A$,,A%:ș"OS_WriteEnv","",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=D$ f0A$=0:?(P-3):A$=$&600A$=0:A$=$(-&300) p3A%=A$+" "," "):D$=A$,A%-1):D$<>"":=A$,A%+1) zbY%=X%256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:&FFD1:A%=X%+16:!A%?A%+A%?2<>8:A%?(A%+1)=13:=$(A%+1) ="" #J(A$):A$=42:A$A$<>"":A$  >D(A%):"FX1,"+A%:C$=C$:A$=C$:C$="":J(A$):b%<6:*Quit  GݤB(l$,n%):l$="":I%=A$+" "," "):l$=A$,I%-1):A$=s(A$,I%+1)):=l$ l$=32A$<>"":A$=" "+A$ bI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) oI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-2-(I%=1))I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+l$)+1)  A$=s(A$):n%:=s(l$)=I%<>0 /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ 6ݤC(A$,A%):$C%=A$:?X%=C%:X%?1=C%256:=(&FFDD)&FF MݤH(A%):X%!1=C%:&FFD1:A%=C%+((1+?C%)((A%-2)=6)):A%?(1+?A%)=13:=$(A%+1) .:ݤI(T%):X%!1=C%:X%!5=1:X%!9=T%:A%=8:&FFD1:X%!5=1:="" 8 A%=C%:A%?(1+?A%)=13:=$(A%+1) B.ݤJ(A%,Y%,T%):X%,E%:?(P-3)=0:E%=Y%:Y%=0 L,<&8000:!&70:X%=&70:!X%=T%:&FFDA:=!X% V!ș"OS_Args",A%,Y%,T%,,T%:=T% `ݤG:A%,Y%,E%:=(&FFDA)&FF j"ݤK(A%,N%)="0000000"+~A%,N%) t"ݤM(A%,N%)="00000000"+A%,N%) ~FݤA(A%,A$):!X%=0:X%?1=8+A$:X%!3=A%:$(X%+7)=A$:A%=&14:&FFF1:=X%?3 B(C) {H {h H {h * pqrisrpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC Explode bW3`L,z0  #ȱ)F% 11L  L  LO FileInfo  W.,Syntax: FileInfo (-|=) =-`L,z0  #ȱ)F% 11L  L  LO FileInfo  W.,Syntax: FileInfo (-|=) =-  H z H  !.Ȣ ! Syntax: FileInfo (-|=) =-  H z H  !.Ȣ !   L   ****(*H h(*H h(  )  )  JJJJ )JiQH dhdH h  hH hi   h=0     :  L  LH h L/LH hŨ iHihHJJJJ h) ii0LRWEPRWELRunNFndFileDir.1.03Filer  > Filer v0.43 dA=&8000:A%=fx(135,0)256:&80+A%+(A%=7):sz:wd%<40:&86:sz n[ctrl%30,data%80:X%=ctrl%:Y%=X%256:A$=OS_GetEnv:quit$=cl(" -q",1):in%=0:err:end xs0,0)c(1)(wd%2-19)"Textual Filer 0.43 (C)1998 J.G.Harston"(wd%-)c(0);:md$=cl("-m",1):debug%=cl("-d",0) ?cl("-?",0):"Syntax: "run$" () (-quit )":end ;Init:md$="":fx(130,0):fx(133,&80)>+&1000:md$="0" 'md$<>"":A$=md$:md$="":A$&80:sz nexit$="":run$<>"":exit$=" -quit "+run$+" -mode "+(fx(135,0)256):quit$<>"":exit$=exit$+" -quit "+quit$ ChkDate:err:end ,:X%=ctrl%:Y%=X%256:RdDir:Disp:menu :end: ;Init:y%=3:err%=:X%=ctrl%:Y%=X%256:max%=max%:max%: Hmax%=35:n$(max%),l%(max%),e%(max%),n%(max%),a%(max%),t%(max%):w$="" Kt$(19):t$(0)="Data":t$(1)="File":t$(2)="Directory":t$(3)="Application" It$(4)="Text":t$(5)="Exec":t$(6)="MCode":t$(7)="Utility":t$(8)="Basic" Gt$(9)="ROM":t$(10)="Teletext":t$(11)="Archive":t$(12)="Font":ptr%=0 Dt$(13)="Screen":dw%=1:fs%=fs:Drv:Path$=p:Sc$="":Ar$="":Tr$="" :z%=02:a$="$.%.",5-2*z%,2):d$=a$:d$="":d$=Path$+"." 3Sc$="":file(d$+"Scroll",5)=1:Sc$=d$+"Scroll" "5Ar$="":file(d$+"Archive",5)=1:Ar$=d$+"Archive" ,UTr$="":file(d$+"TreeCopy",10+3*(fs=4)),5)=1:Tr$=d$+"TreeCopy",10+3*(fs=4)) 6)A%=(Sc$<>""Ar$<>""Tr$<>""):A%:z%=3 @#A%z%=0:file("%",5)<>2:z%=1 J: ^on:23,1;0;0;0;0:*FX4,2 h*FX225,128 r |off:23,1,1;0;0;0;:*FX4  *FX225,1  =end:off:c(0);:quit$<>"":A$=quit$:quit$="":os(A$):  ݤS=$(+8) 1ݤerr:c(1);0,y%);(80);0,y%-1);::c(0); !CloseIn:A%=(50):=debug%-1 $CloseIn:in%:A%=in%:in%=0:#A%  FoswD(A%,D%,E%):X%,Y%:X%=data%:Y%=X%256:!X%=D%:X%!4=E%:&FFF1: )ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 5ݤfx(A%,X%):Y%:Y%=X%256:=((&FFF4)&FFFF00)256 Bݤfile(A$,A%):$data%=A$:?X%=data%:X%?1=data%256:=(&FFDD)&FF Uݤgbpb(A%):X%!1=data%:&FFD1:A%=data%+((A%<>5)(1+?data%)):A%?(1+?A%)=13:=$(A%+1)  ݤfs:A%,Y%,E%:=(&FFDA)&FF &6ݤtime:A%=14:?X%=0:&FFF1:?X%:X%?24=13:=$X% ="" 0ݤDofW(d$):=0 :"ݤh(A%,N%)="0000000"+~A%,N%) D!ݤd(A%,N%)="0000000"+A%,N%) NOݤu(A$):A%,B$:A%=1A$:B$=B$+(A$,A%,1)+32*(A$,A%,1)>"`"))::=B$,A$) Xݤp:fs=4:"DIR$":="$" bn$,p$:A%=6: lXX%!1=data%:&FFD1:?(data%+2+?data%+?(data%+?data%+1))=13:n$=$(data%+2+?data%):*DIR ^ v/n$=n$,n$+" "," ")-1):p$=n$+"."+p$:n$="$"  p$=p$,p$-1):"DIR "+p$:=p$ 6ݤOS_GetEnv:A$:A%=0:X%=1:os%=((&FFF4)&FF00)256 6os%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ")) os%=32:A$=$&100 /A$=0:?(P-3):A$=$&600 A$=0:A$=$&3800 AA%=0:A%=A%+1:A%=A$A$,A%)<32A$,A%)>126:A%<>A$:A$="" 7A%=A$+" "," "):run$=A$,A%-1):run$<>"":=A$,A%+1) uX%=ctrl%:Y%=X%256:A%=9:?X%=0:X%!1=data%:!data%=0:&FFD1:!data%?data%+data%?2<>8:data%?(1+data%)=13:=$(data%+1) ="" *ݤcl(l$,n%):l$=32 A$<>"":A$=" "+A$ bI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) qI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-2-(I%=1)) I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+l$)+1) "A$=s(A$):n%:=s(l$) =I%<>0 (os(A$):A$=""A$=42:A$: A$: )Key(A$):"Key0"+A$:"FX138,0,192":  /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " *+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " 4=A$ >Xݤget(P%,V%):p%,v%,A$:p%=:v%=:P%,V%);time,17);p%,v%);:A$=(100):A$<>"":=A$ HTsz:wd%=byte(160,10,0)-byte(160,8,0)+1:ht%=byte(160,9,0)-byte(160,11,0)+1: R*ݤc(A%):7(A%=0):128+(7(A%<>0)):="" fQChkDate:A$=time:A$<>"" A$,5,2)<>"00" A$<>"Fri,31 Dec 1999.23:59:59": pO" Enter the date (DD/MM/YY): "d$:d$," ")=0 d$<>"":d$=d$+" 0"+äday(d$) zfs=16:"HSETDATE "+d$ F" Enter the time (HH:MM): "t$:t$<>"":=(60*t$+t$,2))*60*100  Kݤday(d$):d%=d$:m%=d$,d$,"/")+1):y%=1900+d$,2):y%<1980:y%=y%+100 ~y%=y%400:=(y%*365.25+m%*30+d%+"120112234455",m%,1)+((y%4)=0)-((y%-1)100)-(m%>2 ((y%4)=0 (y%100)<>0 y%=0))+3)7+1 Drv:Dir$=s(gbpb(6)):data%?(1+?data%)=13:Drive$=s($(data%+1)):Disk$=s(gbpb(5)):A%=fs:I%=1+"00405060816",A%)2:FS$="DISKNETHADFS"+A%,"110105110908",I%*2-1,2),"543545",I%,1)): RdDir:err%: 'Hdr:err%=:fs<>fs%:Drv:Path$=p %a%=8:a%=10:in%=("@"):in%=0:a%=8 p%=0:n%=0:sel%=0:fs%=fs: ;?X%=in%:X%!1=data%:X%!5=1:X%!9=p%:!data%=0:A%=a%:&FFD1 1r%=X%!5:A%=10:r%=1-r%:X%!9=0r%=0:a%=8:r%=2 !p%=X%!9:r%=0:RdName:n%=n%+1 !r%=1n%>max%:err%=:CloseIn  .bRdName:A%=8:data%?(1+?data%)=13:f$=$(data%+1) data%?40=13:f$=$(data%+20):f$=f$,f$,0)-1) 8f$=s(f$):f$=46:n%=n%-1: Bn$(n%)=f$:A%<>8:t%(n%)=data%!16:A%=data% X%!14=0:t%(n%)=file(f$,5):A%=X%+2:fs%=5:$(data%+8)=f$:oswD(&14,&12002000,&40000000):X%!15=data%!10 LCl%(n%)=!A%:e%(n%)=A%!4:n%(n%)=A%!8:a%(n%)=A%!12(-129(fs%<>8)) V1t%(n%)=2:f$,1)="!":t%(n%)=3: t%(n%)=2: `3(!A%A%!4)=0(A%!1&FFFFFF)=&FFFFFD:t%(n%)=0: j9(!A%&FFFF)=&8000 (A%!1&FFFFFF)=&FFFBBC:t%(n%)=9: t'(A%!1&FFFFFF)=&FFFF7C:t%(n%)=10: ~'(A%!1&FFFFFF)=&FFFFF7:t%(n%)=12: A%!4=:t%(n%)=5: &(A%!1&FFFFFF)=&FFFFFF:t%(n%)=4: (A%!1&FFF)=&FFB((A%!2&FFFF)=(A%!6&FFFF)((?A%=0(A%?5&C0)=&80)(!A%&80 A%?1>&1F))):t%(n%)=8: "A%?1>&0F A%?1<&7C:t%(n%)=6: A(A%!2&FFFF)=(A%!6&FFFF)((A%?1&F8)=8A%?1=&DD):t%(n%)=7:  /ݤa(A%,T%):A%=A%&FF:A$:fs%<>16:A%=A%&7F A%1:A%=A%&FB A%16:A%=A%&BF A%&80:A$="P" 5A%=256*(A%15)A%:T%=2T%=3:A$=A$+"D":A%=A%&880  -T%=19:(A%&800):A$=A$+"LEWRewr",T%,1) T%=4:A$=A$+"/":A%=A%*2 A%=A%*2::=A$+" ",7) (4ݤdt(A%):A%=(A%&FFFF00)256:A%=0:="00/00/0000" 2U=d(A%31,2)+"/"+d((A%&F00)256,2)+"/"+d(1981+((A%&F000)&1000)+(A%&E0)2,4) <6ݤat(p%):(wd%x%)*(p%x%),1-(wd%<80)+p%x%);:="" F;ݤat2(p%):sz%+(wd%x%)*(p%x%),1-(wd%<80)+p%x%);:="" P;pr(z%):" "c(t%(z%)&10000);n$(z%)+" ",10); Z<(dw%4):" "h(l%(z%),8)" "h(e%(z%),8)" "h(n%(z%),6); d'(dw%1):" "a(a%(z%),t%(z%)&FF); n(dw%4):" "dt(a%(z%)); x0(dw%2):" "t$(t%(z%)&FF)+" ",9); Ac(0);((dw%2)+2+((dw%3)=1)-(dw%=2));:>(wd%-14)(dw%4)  Hdr:c(0);::c(1)" Drive "+Drive$,-80*(Drive$<>""))((78--wd%/2)-(FS$+Disk$+Path$,57+22*(wd%<80)))2)FS$+"::"+Disk$+"."+Path$,60+22*(wd%<80))(wd%-)c(0);: 3)wd%<80:dw%=dw%3:dw%=2:dw%=3 wd%=80 dw%=3:dw%=5 XHdr:err%:11:::n%=0n%=0:"Empty" z%=0:pr(z%):z%=z%+1:z%=n% =ht%-3:: y%=:ptr%>=n%:ptr%=n%-1 c(1)" Access, Copy, Delete, Full info, Goto,"((wd%<80)1)" cHange drive, Load, Move, New dir""ectory",-6*(wd%>40))","(1+((wd%<80)5))"OS Command, Quit, Rename, setType, Up,"(1-(wd%<80)); "^A=All, ^C=Clear, RETURN=Run, *"(wd%-)c(0);:sz%=11+8*(dw%1)+5*(dw%2)+9*(dw%4):x%=wd%(sz%+1):w$<>"" err%=0:err%=:"."+w$:err%=  Tݤmenu:err%=:on:B$="!!"::at(ptr%);:ptr%=ptr%+(>ht%-4):"at2(ptr%)"<"; :c(1);:A$=get(wd%-9,0):A$>"`" A$<"{":A$=(A$-32) "A$="^":A$="U" ,6n%=0 "ACDLMOPRST"+1+3+13,A$)<>0:A$="!" 6P"*ACDFGHLMNOPQRSTUWZ"+1+3+13,A$):B$=A$+B$,1):c(0);:n%=0:ptr%=0 @"",A$):at(ptr%)" "at2(ptr%)" ";:ptr%=ptr%+(A$="")-(A$="")+x%*(A$="")-x%*(A$=""):ptr%=ptr%(ptr%>0):ptr%>=n%:ptr%=n%-1 J("ACDMORTS",A$)sel%<1)(A$=13 ((t%(ptr%)&10000)=0)):t%(ptr%)=t%(ptr%)&10000:at(ptr%);:pr(ptr%):sel%=sel%+1:A$=13:A$="!":optr%=ptr% T`秽1+3,A$):z%=0n%-1:t%(z%)=(t%(z%)&FFFF)((A$=1)&10000)::sel%=n%(A$=1):Disp:A$="!" ^ A$=13 B$<>13+13:A$="!" hXA$="" (t%(ptr%)&10000):t%(ptr%)=t%(ptr%)&FFFF:at(ptr%);:pr(ptr%):sel%=sel%-1 r"LR",A$)sel%>1:A$="!" |2A$="Z":dw%="1235.7.0",dw%+1,1):Disp:A$="!" 4A$="W":w:"Output window: "w$:A$="!":Disp:on 4A$="F":dw%=(1(dw%>2))+(7(dw%<3)):Disp:A$="!" P"!",A$)=0:f$=n$(ptr%):sel%=1:f$=n$(optr%) sel%>1:f$="" &w:B$=13+13 sel%=1:Run(""):=0 A$=13:=0 A$="O":"*"A$:0,y%)" "A$" "f$;" ";:""a$:11(sel%>1):c(sel%>1);:do(A$):ChkEx:A%=((sel%<2 >y%+1)&7FFF):"**** Press SPACE ****",A%);:A%=(A%):=0 0A$="*":"*"A$:c(0);:A$:A$="":fs%=0:=0 I%="ACDGHLMNQRSTU",A$):"Set Access ofCopyDeleteGoto directoryChange to driveLoadMoveNew directoryQuitRenameStampSetType ofGo Up","*01141824385357617478848999",I%*2,2),"*13040614150404130406051005",I%*2,2));" "; 1"ACDLMRST",A$):f$;:"ACLMRT",A$):" to "; !a$="!":"QU",A$)=0:""a$:11  on:A$="A":do("Access"):=0 "CM",A$):Copy(A$="M"):=0 A$="D":do("Delete"):=0 A$="G":Goto(a$):=0 -A$="H":Goto(":"+a$,1-(a$,1)=":"))):=0 A$="L":Load:=0 & a$="":=0 0A$="N":"CDir "+a$:=0 :#A$="R":"Rename "+f$+" "+a$:=0 DA$="S":do("!Stamp"):=0 N+A$="T":a$=type(a$):do("!SetType"):=0 XA$="U":Up:=0 b =A$="Q" lCw:0,y%);c(1);(wd%)c(0)(80+(wd%80))1,y%);c(1);:off: fCall(N$,A$,B$):A$<>"":os(A$+" "+B$+exit$) 13;" '"N$"' not available"(wd%-);13;:A%=(50)  #ChkEx:byte(198,0,255): FRun(a$):0,y%)c(1)" Select "f$" "a$c(0);:T%=t%(ptr%)&FF:off T%=2T%=3:Dir(f$): $:T%=4:Call("Scroll",Sc$,f$): T%=5:"Exec "+f$: #(T%&FE)=6:"Run "+f$+" "+a$: 5T%=8 (l%(ptr%)&FFF00)=&FFB00:Call("",f$,a$): -T%=8 e%(ptr%)=&7B00:"Run "+f$+" "+a$: T%=8:f$: 7T%=9:Key("/SrLoad "+f$+" I|MCH."""+run$+"""|M"):  T%=10  $T%=11:Call("Archive",Ar$,f$): T%=12:"Exec "+f$:""f$:   4OLoad:0,y%)c(1)" Load "f$" to "a$;c(0);:T%=t%(ptr%)&FF:off:a$=u(a$) >a$="VIEW"a$="WORD":T%=4 Ha$="BASIC":T%=8 R2(T%&FE)=4 a$="":Key("LOAD "+f$+"|M"):*WORD \+(T%&FE)=4:Key("READ "+f$+"|M"):*WORD f)T%=1(T%&FE)=6:"Load "+f$+" "+a$: p*T%=8:Key("LOAD"""+f$+"""|F|M"):21: z 4Dir(f$):"DIR "+f$:f$=1 "$%&",f$):Path$="" 1:0,y%)c(1);" "A$,1-(A$,1)="!"))" "n$(z%)" "a$;(wd%--1)13; Ado%:A$,1)="!":A%=("FN"+A$,2))do%:A$+" "+n$(z%)+" "+a$ :sel%>1:(wd%--1)13; $ 8*ݤStamp:"Stamp +n$(z%):PROCSetDate:=0 B*ݤtype(a$):a$=u(a$):a$="TEXT":="FFF" La$="EXEC":="FFE" Va$="DATA":="FFD" `a$="BASIC":="FFB" ja$="FONT":="FF7" ta$="TELETEXT":="F7C" ~a$="ROM":="BBC" =a$ >ݤSetType:X%!2=&FFF00000+&100*("&"+a$):A%=file(n$(z%),2) JX%!6=e%(z%):X%!14=a%(z%):a$="FFE"a$="FF7":X%!6=-1:A%=file(n$(z%),3) SetDate:=0 -SetDate:(t%(z%)&FF)=2:X%!2=-1:X%!6=-1 #X%?5<>&FF (X%?4 &F0)<>&F0: 7(X%!2 &FFFFFF)>&FF0000 (X%!2 &FFFFFF)<&FF8000: (X%!2 &FFFF00)=&FFDD00: (X%!15 &FF1F)=0: Cdy%=X%?15 31:mn%=X%?16 15:yr%=1981+(X%?16 16)+(X%?15 &E0)/2 (ConvDate(data%,dy%,mn%,yr%,0,0,0,0) 1X%!6=!data%:X%?2=data%?4:A%=file(n$(z%),1): @ConvDate(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%<100:y%=y%+1900 y%=y%400 qd%=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%>146096:d%=d%-146097 (=d%=d%*&41EB:mem%!1=d%+d%:d%=((hr%*60+mn%)*60+sc%)*100+cs% 2#?mem%=d%:mem%!1=mem%!1+d%256: F3ݤRename:"Rename "+n$(z%)+" "+a$+"."+n$(z%):=0 ZTݤCopy:file(a$,5)=2:"Copy "+n$(z%)+" "+a$+"."+n$(z%) "Copy "+n$(z%)+" "+a$ dMv%:"Delete "+n$(z%) n=0 =Copy(Mv%):a$="":a$=w$:10+f$,y%)a$;:" "A$:A$<>"": $Mv%a$,":")=0:do("!Rename"): ,sel%>1(t%(ptr%)&FF)<>2:do("!Copy"): JCall("TreeCopy",Tr$,f$+" "+a$+"."+f$+" A~C"+"~",1+Mv%)+"DEF~PR~S"): B(C) {H {h H {h * pqrLs/rpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC Files vW+--INOTUPEDWROI*CLOSED*PTR=EXT=Dir:ID:Alloc=Start=  `i HJJJJ V h) ii0LȘHL ȘHL~ ȘH M M M --INOTUPEDWROI*CLOSED*PTR=EXT=Dir:ID:Alloc=Start=  `i HJJJJ V h) ii0LȘHL ȘHL~ ȘH M M M M h` LNeeds HADFS 5.40 or later ک 6ͩ녨)iH J  8 -**u **)  ..u   ȱ M : j Ȣ 9 r  9 r  9 j  9 c  9 j h8 k jKL `Form160 `<`?W/Format drive Formatting ` `HJJJJ /`h) ii0LH 04 Bad drive) h Format drive Formatting ` `HJJJJ /`h) ii0LH 04 Bad drive) h e) Β  ` /`? H h)Y`,  J  a$La ͕ ,  )  H  H Cah   h  .  . m  m   . 1b)b H )bH)b h)b h3b,Write errorDisk write protected` H  `h /`: &` $0ܽ4b      (֭ i  La? L` K! c*KillDFS @ W+&    )ύ `L )  L?  H y LhLlp 6q60 [ UW&    )ύ `L )  L?  H y LhLlp 6q60 [ UW_b!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-blp 60 ?[ U60A4 ?[ W60A4nq ?^ ]60nlq ?^ [66 ?[ U66A4 ?[ W66A4nq ?^ ]66nlq ?^ [70A4 ?[ W70A4nq ?^ ]Scrol/t H?༦UhETree i{10|Exploe ? bFileIfo ? p,Filer L{^/Files ? vXForm10 `?<`?xKillDS ?@ Xlp  D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O_b!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] < $0 `%ɣ! L @ &ʩ@ L} L3 0_ / L _ I_ ) ` / L ) L H  hL " ] B^ ] `,_ P " ] L ` i Hh) ` `  \ N+@  A_ Hȱ!   [   \ hee@ + / LL Syntax: 60 (+) ()Not found0)H e he楪`ȱ `V1.1360A4 [ WW_f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L} _f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] < $0 `%ɣ! L @ &ʩ@ L} L3 0_ / L _ I_ ) ` / L ) L H  hL " ] F^ ] `,_ P " ] L ` i Hh) ` `  \ N+@  A_ Hȱ!   [   \ hee@ - / LL Syntax: 60A4 (+) ()Not found0)H e he楪`ȱ `V1.1360A4nlq ^ ]W_f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^  _f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^   a L   L`  ` < $0 `%ɣ! L @ &ʩ@ L L6 0_ 2 L b Ib ) ` 2 L ) L H  hL % ` Fa ` `,b P % ` L c i Hh) c `  _ N+@ Ab Hȱ!   ^   _ hee@ 0 2 LO Syntax: 60A4nlq (+) ()Not found0)H e he楪`ȱ `V1.1360nlq  JJ 6(;l,0J.򩾅 P)H@A<ȱ 汱Ʊ辰H >hi(\  _b!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^   a L   L`  ` < $0 `%ɣ! L @ &ʩ@ L L6 0_ 2 L b Ib ) ` 2 L ) L H  hL % ` Ba ` `,b P % ` L c i Hh) c `  _ N+@ Ab Hȱ!  ^  _ hee@ . 2 LO Syntax: 60nlq (+) ()Not found0)H e he楪`ȱ `V1.1366 [ UW_b!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^_b!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] B $0 `%ɣ! L @ &ʩ@ L} L3 0_ / L _ I_ ) ` / L ) L H  hL " ] B^ ] `,_ P " ] L ` i Hh) ` `  \ N+@  A_ Hȱ!   [   \ hee@ + / LL Syntax: 66 (+) ()Not found0)H e he楪`ȱ `V1.1366A4 [ WW_f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L} _f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] B $0 `%ɣ! L @ &ʩ@ L} L3 0_ / L _ I_ ) ` / L ) L H  hL " ] F^ ] `,_ P " ] L ` i Hh) ` `  \ N+@  A_ Hȱ!   [   \ hee@ - / LL Syntax: 66A4 (+) ()Not found0)H e he楪`ȱ `V1.1366A4nlq ^ ]W_f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^  _f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^   a L   L`  ` B $0 `%ɣ! L @ &ʩ@ L L6 0_ 2 L b Ib ) ` 2 L ) L H  hL % ` Fa ` `,b P % ` L c i Hh) c `  _ N+@ Ab Hȱ!   ^   _ hee@ 0 2 LO Syntax: 66A4nlq (+) ()Not found0)H e he楪`ȱ `V1.1366nlq ^ [W_b!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^ _b!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^   a L   L`  ` B $0 `%ɣ! L @ &ʩ@ L L6 0_ 2 L b Ib ) ` 2 L ) L H  hL % ` Ba ` `,b P % ` L c i Hh) c `  _ N+@ Ab Hȱ!  ^  _ hee@ . 2 LO Syntax: 66nlq (+) ()Not found0)H e he楪`ȱ `V1.1370A4 [ WW_f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   _f!#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] F $0 `%ɣ! L @ &ʩ@ L} L3 0_ / L _ I_ ) ` / L ) L H  hL " ] F^ ] `,_ P " ] L ` i Hh) ` `  \ N+@  A_ Hȱ!   [   \ hee@ - / LL Syntax: 70A4 (+) ()Not found0)H e he楪`ȱ `V1.1370A4nlq ^ ]W_f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^  _f!@x#$%)w*2h4S8W9h:SAR#RCDEIwJRhTXWYhZa-b-^ `H  |  h ^   a L   L`  ` F $0 `%ɣ! L @ &ʩ@ L L6 0_ 2 L b Ib ) ` 2 L ) L H  hL % ` Fa ` `,b P % ` L c i Hh) c `  _ N+@ Ab Hȱ!   ^   _ hee@ 0 2 LO Syntax: 70A4nlq (+) ()Not found0)H e he楪`ȱ `V1.13Scroll/t H༦UW- Scroll 1.11 =========== J.G.Harston 70 Camm Street, Walkley, Sheffield, S6 3TR jgh@arcade.demon.co.uk BScrollb is Scroll 1.11 =========== J.G.Harston 70 Camm Street, Walkley, Sheffield, S6 3TR jgh@arcade.demon.co.uk BScrollb is a scrolling textfile reader. You can scroll upwards and downwards through text files of any length. Extended View highlight codes as used by B*lpb and B*lpSb are acted on to give Bboldb, Iitalicsi, Ssuperscripts, Wwidew, Ysubscripty and underline effects. These can be turned off to give plain View extensions of *bold* and underline. BScrollb will also run on the Archimedes. If there is enough memory, BScrollb uses shadow mode 0, otherwise mode 3 is used. Unless a command line file is given, BScrollb shows the current directory and asks for a filename. At this prompt you can also give B*bcommands to change directory, etc. Once a file is given, it is loaded and displayed. The keys are simple. Cursors move up and down. Pressing BShiftb will jump one screen at a time. Pressing BCtrlb will jump to the ends of the file. Pressing BCOPYb will flip between extended highlights and plain highlights. Pressing BEscapeb will leave. Pressing BPb and BRETURNb will let you print out the file. Before you press BRETURNb a prompt appears telling you the name of the printout command. You can change this here by deleting it and typing in another command, but BScrollb will usually have found a suitable one. The recommended command B*lpb is created with the BMakeLPb program. An example alternative printout command is to press '+' before pressing BRETURNb to double-space the printout, this is useful if your printer does not advance by itself with auto-linefeed. Pressing B4b will display the file in 40 column teletext mode, if BScrollb has been told what program to use. The bottom line of the screen shows the filename of the file being scrolled, a percentage figure showing how far through the file you are, and a reminder of the keys used. BScrollb will take the following command line arguments, which are displayed if B-?b is given as a parameter: B*Scroll (-lp ) (-4 ) |-chan + (-quit )b Bb is the file to display. Alternatively, B-chanb can be used to tell BScrollb to read from an open channel. The Bb is the channel number in decimal and the B+b gives the length of the section of file to use in decimal or hexadecimal preceeded with B&b. There must be no spaces in the B+b part, and the PTR of the open file should be set to the start of the section to read. This can be used to read through a file within an archive. The B-lpb option gives a command to use to print out the file. If this option is not given, then a default printout command is looked for as detailed below. The B-4b option gives a command to use to display the file in 40 column teletext mode. The B-quitb option gives a command to run on exit. If the Bb starts with a B*b, then it is called as a B*bCommand, otherwise it is BCHAINbed. The options must be in lower case, and only the first character is significant. So, for instance, to call BScrollb from another program, you could use the following: B CHAIN "Scroll -4 $.4to7 "+name$+" -quit Menu"b This would run BScrollb and display the file Bname$b, and CHAIN the program I$.3to7i to display in teletext mode. On exit, it would return to the program BMenub. On starting, if no B-lpb option is given, BScrollb looks for an B*lpb printout program. The order it looks for one is: Ilpi, I%.lpi, I%.lp.#i, I%.lp.*i, I$.lpi, I:0.$.lpi. The recommended place to put the B*lpb command is in the library in a subdirectory I%.lpi, with a file I1i being a default general purpose printer. With DFS, the best place would be in the I$i directory. BScrollb consists of the following files: IScrolli - The program Idispi - Controls screen output giving display effects IT/Scrolli - This text file. Version Notes: V1.11 15-Mar-98 Memory-based command line passing, key repeats set. V1.10 01-Feb-97 Long filenames displayed correctly, LFs converted to CR for display. When bottom of the screen is blank, moving back and then forward displays last few lines correctly. Status line stays longer. V1.09 30-Mar-96 Better use of memory V1.08 28-Mar-96 Relocates in very small memory systems V1.06 01-Mar-96 Added -chan option, tweeked command line parsing V1.03 16-Jun-95 Added -4 and -lp option V1.01 10-Jan-95 Added Archimedes capabilities V1.00 01-Jul-94 Initial version  8 W6qlpS Syntax -ȱ00 eeeei@ Not found$0 % 4 L# 檦LL Q | LhhL   @HK`H $0步ŬM= h В 4 )`I` H)BDIQSWXYh`@ h) 娅%I%E` ) Mf LE )) NNNNNNN$P $)2 >(> J~(~  L1.09MakeLP ec "+f$:""f$:   4OLoad:0,y%)c(1)" Load "f$" to "a$;c(0);:T%=t%(ptr%)&FF:off:a$=u(a$) >a$="VIEW"a$="WORD":T%=4 Ha$="BASIC":T%=8 R2(T%&FE)=4 a$="":Key("LOAD "+f$+"|  > MakeLP A&87:G(&D00):&84:G$="1.13":M:H%&300:J" at line ";: *FX4 ( G:*FX4 2 ""A$(l%)=A$(l%)A$(l%)="" F Pn CHR$27+"@",,CHR$27+"E",,CHR$27+"G",,,,,CHR$27+"4",,,,,,,,,,CHR$27+"S0",,,,CHR$27+"W1",,CHR$27+"S1",,,,,, Z CHR$27+"R"+CHR$3+"#"+CHR$27+"R"+CHR$0,,CHR$27+"F",,CHR$27+"H",,,,,CHR$27+"5",,,,,,,,,,CHR$27+"T",,,,CHR$27+"W0",,CHR$27+"T",,,,,, d+ CHR$27+"-0",CHR$27+"-1",,,,,,,,,,,,,, n x.ݤB(A$):l%,B$:B$="":A$="++":="Set bit 7" A$="--":="Clear bit 7" A$=""="" +l%=1A$:m$=A$,l%,1):l%<>1 B$=B$+"," Qm$<32m$>126 B$=B$+×m$(m$>="0"m$<="9")m$=","B$=B$+34+m$+34B$=B$+m$ :=B$ ݤG::4"Printer Driver Generator ";G$'4;29,"="):'9"(C)1992 J.G.Harston":''5"1 : General settings":'5"2 : Letter extensions":'5"3 : Save settings":'5"4 : Load settings":'5"5 : (Create View Driver)":'5"6 : Create lp Program" T''5"0 : Exit"'':5"Press a key: ";:A$=:"0123456*"+13+0,A$):A$<>"*"A$ "A$="*""*"A$:A$:A$="":":"; ^A$=0"Saving...";:"SAVE "+$(+4),$(+4),">")+1)+" "+~+" "+~P+" FFFF0000 FFFFFB00" A$="1"C A$="2"H A$="3"N A$="4"O  A$="5"I  A$="6"J A$<>"":=A$="0" "ݤJ:=17-1=0=0 ,A$::A$=:=-1 6C::10"General Parameters"':"Auto linefeed? "D(b%)''"Paper length: ";Q%''"Text page length: ";R%:'"FF at end of page? "D(_%)''"LF at end of page? "D(T%):'"FF after last page? "D(N%):'"Convert CHR$96 (`) to pound? "D(J%) @"Convert CHR$163 ("163") to pound? "D(L%):c$"pound: "B(A$(64)):'"Highlight 1:":c$"underline on: ";B(A$(97)):c$"underline off: ";B(A$(96)):'"Use extended highlights? ";D(I%)':I%' JKI%"Highlight 2:"'c$"bold on: ";B(A$(98))'c$"bold off: ";B(A$(99)) T'':40,"=")"Printer reset with code '@' (see page 2)Pound also defined with code '`'";:13,2);:b%=C(b%):18,4);x%:x(18,4):x%>10 Q%=x%:14,4);x%;" " ^422,6);x%:x(22,6):x%>10 R%=x%:18,6);x%;" " h-17,8);:_%=C(_%):_%T%=:19,10);"No " r_%17,10);:T%=C(T%) |.18,12);:_%+T%=0 N%=0:"? No "N%=C(N%) 27,14);:J%=C(J%):28,15);:L%=C(L%):0,17)"Code: ";:""x$:x(0,17):x$<>""A$(64)=A(x$):16,16)B(A$(64));:x(,):x$=" "A$(64)="" f0,21)c$"on: ";:""x$:x(0,21):x$<>""A$(97)=A(x$):24,19)B(A$(97));:x(,):x$=" "A$(97)="" g0,21)c$"off: ";:""x$:x(0,21):x$<>""A$(96)=A(x$):24,20)B(A$(96));:x(,):x$=" "A$(96)="" |23,22);:I%=C(I%)::I%x(,):x(0,+1):x(0,+1)"Highlight 2:"'c$"bold on: ";B(A$(98))'c$"bold off: ";B(A$(99)) jI%0,27)c$"on: ";:""x$:x(0,27):x$<>""A$(98)=A(x$):19,25)B(A$(98));:x(,):x$=" "A$(98)="" kI%0,27)c$"off: ";:""x$:x(0,27):x$<>""A$(99)=A(x$):19,26)B(A$(99));:x(,):x$=" "A$(99)="" (0,28)"Ok";:i%=C():x(0,28):i%: "x(X%,Y%):X%,Y%);(39-);: ݤD(F%):F%:="Yes"="No " ݤH(l%):l%=D%:="Set bit 7" &l%<>E%:=B(A$(l%))="Clear bit 7" bD(A%)::l%=031:0,l%);(l%+A%+32);" ";H(l%+A%);20,l%);(l%+A%+64);" ";H(l%+A%+32);:: H:t%=32:D(t%):*FX4,1 l%=0:1+20*((l%32)1),l%32);":";20,31);(l%+t%+32);" ";B(A$(l%+t%)),16);(38-);20,31);:K%=:m%=l%:K%=136 m%=l%-32 K%=137 m%=l%+32 K%=138 m%=l%+1 &K%=139 m%=l%-1 0K%=135 t%=t%32:D(t%) :m%<0m%>62 m%=l% D/m%<>l%1+20*((l%32)1),l%32);" ";:l%=m% NK%<127K%>31:T:0: X@T:22,31);16;22,31);:C$=A(E(K%,17)):C$,1)=" "C$="" bC$=""D%=l%D%= lC$=""E%=l%E%= vBC$="++"D%>((D%-t%)&FFC0)=02+20*((D%-t%)32),D%31);18; BC$="--"E%>((E%-t%)&FFC0)=02+20*((E%-t%)32),E%31);18; 'C$="++"C$="":D%=(l%+t%)(l%+t%<32) 'C$="--"C$="":E%=(l%+t%)(l%+t%<32) EA$(l%+t%)=C$:2+20*((l%32)1),l%32);H(l%+t%);(20-(20));:0 OݤA(A$):l%,B$:l%=1:m$=A$,l%,1):(m$<"0"m$>"9")m$<>34 B$=B$+m$:l%=l%+1 5m$=34A$,l%+2,1)=34 B$=B$+A$,l%+1,1):l%=l%+3 ?(m$>="0"m$<="9")B$=B$+A$,l%):l%=l%+A$,l%)+",",",")-1 A$,l%,1)=","l%=l%+1 l%>A$:=B$ HݤE(A$,`%):B%,l%:$H%=A$:l%=A$:A$;:B%=:B%=127l%<>0127:l%=l%-1 +B%>31B%<127l%<`%B%:H%?l%=B%:l%=l%+1 B%=13:H%?l%=13:=$H% 1I:"Filename to save by: "F$:F$=""F$="drv" '"Assembling View Printer Driver";:P=01:C%=P*3+4:P%=&400:O%=H%:O%=H%:[OPTC%:JMPv:JMPQA:JMPIA:RTS:.RA:BRK:.`A:BRK:RTS:]:B(C%):[OPTC%:.QA:LDA#2:JMP&FFEE:.IA:LDA#3:JMP&FFEE:.v:]:I%[OPTC%:BITRA:BMIw:]  J[OPTC%:CMP#&81:BEQx:CMP#&80:BEQy:CMP#13:BEQj:]:J%[OPTC%:CMP#96:BEQq:] L%[OPTC%:CMP#163:BEQr:]  `[OPTC%:JMP&FFEE:.w:.q:.r:.y:.x:.j:RTS:]:"*SAVE "+F$+" "+~H%+" "+~O%+" 400 400":"...": * 4MݤF:G%=0:M%=:l%=0:A$(l%)<>""m%=1A$(l%):G%=G%(A$(l%),m%,1)>127): >l%=l%+1:l%=102G%:G%:=I H*l%=0:A$(l%)<>""A$(l%),1)<>27 M%=0 Rl%=l%+1:l%=102M%=0:=0 \EݤI:M%=0:f%=0:l%=0:A$(l%)<>""m%=1A$(l%):Q(A$(l%),m%,1)): fVl%=l%+1:l%=102(M%f%):M%f%"Can't build table with both 0 and 255";:f%=:==0 pQ(A%):A%=0 M%=: zA%=&FF f%=  B(C%):U%=(M%128)+(b%64)+(_%32)+(T%16)+(I%8)+(J%4)+(L%2)+(N%1):W%=(G%128)+(e%64):[OPTC%:EQUBU%:EQUB(Q%31)+(((E%-32)*4)&E0):EQUB(R%31)+(((E%-32)*32)&E0):EQUBW%+((D%-32)(D%>0E%>0)):.F:]:l%=0101:A$(l%)<>""U :[OPTC%:EQUB255:]: =U:[OPTC%:EQUBl%+1:]:G%[OPTC%:EQUSA$(l%):EQUBM%&FF:]: >M%[OPTC%:EQUSA$(l%),2,A$(l%)-2):EQUB128+A$(l%),1):]: 9[OPTC%:EQUSA$(l%),A$(l%)-1):EQUB128+A$(l%),1):]: #J:"Create 'lp' program":F ,"Filename to save by: "F$:F$=""F$="lp" 2D$=F$:D$,".")D$=D$,D$,".")+1):D$,".")=0 R"Assembling ";F$:Z%=&FFFF0900:B=0:O%=H%:P%=Z%:z=B:A(4):B>&B00 Z%=&FFFF08C0 B=z:O%=H%:P%=Z%:A(6):"Saving ";F$'"Start: &";~Z%&FFFF;" End: &";~B:"SAVE "+F$+" "+~H%+" "+~O%+" "+~(d%&FFFF0000)+" "+~Z%: 7A(C%):B(C%):K(C%):E(C%):L(C%):F(C%):P(C%): uK(C%):[OPTC%:.O:LDA#1:STAQ:RTS:.AA:TYA:PHA:JSRO:LDA#124:JSR&FFF4:LDA#15:JSR&FFF4:PLA:TAY:.OA:]:N%[OPTC%:JSRn:] [OPTC%:DECQ:BEQBA:LDA#0:STA&A8:STA&A9:STA&AA:STA&AB:LDX#&A8:LDA#1:JSR&FFDA:._:JSR`:STAo:JMPD:.BA:LDA#3:JSRM:LDA#0:]:B<&B00 [OPTC%:JMPN:] RB>&AFF [OPTC%:JSRN:LDA#0:LDX#1:JSR&FFF4:CPX#3:BCSSA:LDA#18:JMP&FFF4:.SA:RTS:]  $>E(C%):[OPTC%:.R:JSRJA:LDAL:CMP#R%:BCCD:JSRn:.D:LDX#1:]: .1L(C%):[OPTC%:.E:BIT&FF:BMIAA:JSRb:BCSOA:]: 80 [OPTC%:Abit7:] BJ%[OPTC%:CMP#96:BEQS:] LL%[OPTC%:CMP#163:BEQS:] V[OPTC%:.PA:INX:JSRC:JMPE:.TA:CMP#13:BEQR:CMP#10:BEQR:CMP#9:BEQZA:CMP#12:BEQCA:CMP#28:BEQc:CMP#29:]:I%[OPTC%:BEQf:][OPTC%:BEQUA:] `/[OPTC%:BNEE:]:J%L%[OPTC%:.S:LDA#64:BNEI:] jV[OPTC%:.CA:JSRn:JMPD:]:I%[OPTC%:.VA:JMPOA:.f:JSRb:BCSVA:SBC#31:BMIE:CMP#95:BCSE:] tW(E%D%)>0:[OPTC%:CMP#D%:BEQWA:CMP#E%:BNEI:LDA#0:.KA:STAXA:JMPE:.WA:LDA#128:BMIKA:] ~v[OPTC%:.I:JSRG:JMPE:.c:LDAH:#1:STAH:#1:A#96:.DA:JSRG:JMPE:]:I%[OPTC%:.UA:LDAH:#2:STAH:LSRA:#1:A#98:BNEDA:] [OPTC%:.ZA:TXA:#7:TAX:.EA:LDA#32:JSRC:INX:TXA:CMP#8:BNEEA:JMPE:.LA:LDA#27:BNEU:.C:.U:PHA:LDA#1:JSRk:PLA:.k:JMPM:]:_%[OPTC%:.n:LDA#12:JSRU:] -T%[OPTC%:.FA:JSRa:.n:LDAL:CMP#Q%:BCCFA:] Q[OPTC%:INCo:.`:LDA#0:STAL:RTS:.JA:BITH:BVCa:JSRa:.a:]:b%[OPTC%:LDA#10:JSRC:] p[OPTC%:INCL:LDA#13:JMPC:.G:STXJ:CLC:ADC#1:LDX#0:.GA:CMPF,X:BEQl:BCCK:PHA:.T:INX:LDAF,X:]:G%=0 [OPTC%:BPLT:] G%M%[OPTC%:CMP#&FF:] G%[OPTC%:BNET:] 4[OPTC%:PLA:INX:BNEGA:.l:]:G%=0M%[OPTC%:JSRLA:] 1[OPTC%:.V:INX:LDAF,X:]:G%M%[OPTC%:CMP#&FF:] G%[OPTC%:BEQK:] G%=0 [OPTC%:#127:] :[OPTC%:JSRC:]:G%=0 [OPTC%:LDAF,X:BPLV:][OPTC%:JMPV:] [OPTC%:.K:LDXJ:RTS:]: bP(C%):o%=O%:p%=P%:[OPTC%:.Q:BRK:.W:BRK:.L:BRK:.o:BRK:.H:BRK:.J:]:(E%D%)>0:[OPTC%:.XA:BRK:]  O%=o%:P%=p%:[OPTC%:.d%:LDX#&A8:LDY#0:JSRO:STYW:JSR&FFDA:LDA(&A8),Y:CMP#13:BEQp:LDX#0:CMP#"+":BNEs:LDX#&40:JSRZ:BEQp:.s:STXH:TYA:PHA:.MA:INY:LDA(&A8),Y:CMP#"!":BCSMA:JSRg:BEQh:JSRi:STAQ:JSRg:BEQh:JSRi:STAW:.h:PLA:CLC:ADC&A8:TAX LDA#0:ADC&A9:TAY:LDA#&40:JSRN:TAY:BEQm:LDA#2:JSRM:LDA#32:JSRG:JMP_:.p:._A:BRK:EQUB220:EQUS"Syntax: "+D$+" (+) ()":.m:BRK:EQUB214:EQUS"Not found":BRK:.i:LDA#0:.NA:STA&AA:LDA(&A8),Y:CMP#"0":BCCHA:#15:PHA LDA&AA:ASLA:ASLA:ADC&AA:ASLA:STA&AA:PLA:ADC&AA:INY:BNENA:.HA:LDA&AA:RTS:.Z:INY:.g:LDA(&A8),Y:CMP#" ":BEQZ:CMP#13:RTS:EQUS"V"+G$:BRK:.B:]: ( N:F 2X'"Save settings":"Filename: "F$:P%=H%:B(0):"SAVE "+F$+" "+~H%+" "+~P%+" 0 0": 0:b%=(U%64)<>0:_%=(U%32)<>0:T%=(U%16)<>0:I%=(U%8)<>0:J%=(U%4)<>0:L%=(U%2)<>0:N%=(U%1)<>0:G%=(W%128)<>0:e%=(W%64)<>0:M%E$=27E$="" Z a%=0R: d#a%>80"Unknown format";:a%=: nx%=1:a%=1 x%=-31 xm%=V%+4:G%S: fl%=0101:A$(l%)="":?m%=l%+x%:m%=m%+1:A$(l%)=A$(l%)+(?m%127):?m%>127:m%=m%+1:A$(l%)=E$+A$(l%) : qS:l%=0101:A$(l%)="":?m%=l%+1:m%=m%+1:A$(l%)=A$(l%)+?m%:?m%=(M%&FF):m%=m%+1:A$(l%)=A$(l%),A%(l%)-1) : |R:m%=V%+84:l%=473:`%=?(V%+l%+1)-V%?l%:`%>0 A$(l%+28)=E$:n%=1`%:A$(l%+28)=A$(l%+28)+K(?m%):m%=m%+1:A$(l%+28)="" :E%=:D%=: *ݤK(c%):G%c%>127:=27+(c%127)=c% >ݤC(F%):K%:"? (";(78-F%*11);")";:K%=:K%>95 K%=K%&DF ,K%=13K%=89K%=78:K%=13 K%=F%K%=K%=89 3,127);:K%"Yes""No " =K% S% =B%=(+(A%-P-S%))&FF00:"Relocating to &";~B%:*K.0 RUN|M  *FX225,1 *FX138,0,128 &A%=0P-+44:B%!A%=A%!::=B%: MCode ) >S/MCODE 1.31 7200 0780 07-Dec-1999 @ 07-12-99 V1.31 JGH: Claims RD/WR vectors, defaults to 0600 : (V%=&8000:W%=0:6: D^A 2($&780="":"MCode file: "L$:$&780=L$ <#X%=&700:Y%=X%256:C%=0:L$=$&780 FUL$="" L$,2)="-?":"Syntax: MCODE (|PAGE ())":DTA PQI%=L$+" "," "):F$=L$,I%-1):L$=L$,I%+1):L$,1)=" ":L$=L$,2):L$,1)<>" " Z&780):L$>"`":L$=(L$-32) nF%=L$,1)="P":F%:L$="" xP$&780=F$:!X%=&780:A%=5:A%=(&FFDD)&FF:A%<>1:"File '"F$"' not found":DTA Y(X%!2&FFFF0000)=0 (X%!6&FFFF0000)=0 X%!2&780:[OPTZ%:STY&A9:LDA#&F2:STA&A8:JSRH%:LDA&AC:PHA:] 5B%<>&780:[OPTZ%:JSRH%:LDA&AC:STA&A9:PLA:STA&A8:] /B%<>&780:[OPTZ%:BNE_%:LDA&A9:CMP#6:BNE_%:] JB%<>&780:[OPTZ%:LDY#&FF:.Lp:LDA&5FF,Y:STA&600,Y:DEY:BNELp:BEQK%:._%:] ?[OPTZ%:LDY#0:.J%:TYA:PHA:JSRH%:PLA:TAY:LDA&AC:STAB%,Y:INY:] -B%<>&780:[OPTZ%:BEQK%:] [OPTZ%:BMIK%:] A[OPTZ%:CMP#13:BNEJ%:.K%:]:B%<>&780:[OPTZ%:LDA#"*":STAB%-1:] F%:[OPTZ%:LDA#131:JSR&FFF4:STX&70:STY&71:LDA#(L%255):STA&72:LDA#(L%256):STA&73:LDY#0:LDX#(255+#C%)256:.M%:LDA(&72),Y:STA(&70),Y:INY:BNEM%:INC&71:INC&73:DEX:BNEM%:] n[OPTZ%:JSRR%:LDX#W%255:LDY#W%256:JMP&FFF7:.H%:LDX#&A8:LDY#0:LDA#5:JSR&FFF1:INC&A8:BNEN%:INC&A9:.N%:RTS:] [OPTZ%:.R%:LDX#3:.Lp:LDA&20E,X:TAY:LDAVec,X:STA&20E,X:TYA:STAVec,X:DEX:BPLLp:RTS:.Vec:EQUWWr:EQUWRd:.Cnt:EQUB5:.Idx:EQUB0:] C[OPTZ%:.Wr:PHA:CMP#13:BNEWr0:DECCnt:BNEWr0:JSRR%:.Wr0:PLA:RTS:] "<[OPTZ%:.Rd:STX&70:LDXIdx:LDAV%,X:INCIdx:LDX&70:CLC:RTS:] ,?[OPTZ%:.V%:EQUS"Q%=PAGE":]:F%:[OPTZ%:EQUS":PAGE=&"+~L%:] 6L[OPTZ%:EQUB13:EQUS"OLD":EQUB13:EQUS"RUN":EQUB13:.W%:EQUS"BASIC":EQUB13:] @$:Z%=X%O%:#C%,?Z%::#C%:C%=0 J:$&780=F$:!X%=&780:A%=1:X%!2=L%:X%!6=E%:X%!14=T%:&FFDD TF$=13:Q%?1=0:=Q%: ^:C%:D%=C%:C%=0:#D% h :DTA B(C) H zh0 zzL `zz`zzH ηz zh`pzzzp`Q%=PAGE:PAGE=&7200 OLD RUN BASIC MDump Syntax: MDump (-80) (/+) - 𵢪 + ( eeE)E 4)  ) . m iEE $| `,z0R+H, 4H  4 N ) N , h4h0`ﰮ   祖L HJJJJ h) ii0L L   666 `0:@)`8`ȱ!ȱ `v1.02Ver1.17 x ȱ)F [   (` =   bn)  E ꩀ % @ (` (`)`m0l )HHHxm`)mHJJ8 > h > hhh@) i i (i8  0(`HH hh `jjjj)@`@l HɀɁhl  h` ʊ)Iijjjj-`ih`pc8s LTv@W9q(((((((((((((((((((((((((((((((((((((((((/((((((/ ?? /((((((((((/ /(((((((((((((((PrList  W"No BASICNot foundKH0 - n橱+ n橦@  & Not a BASIC filemqqV/W 0  A No BASICNot foundKH0 - n橱+ n橦@  & Not a BASIC filemqqV/W 0  A B  a Z ,0 ~  D$0= 8,ɀ;" M" ֢ H  h Ln h0`ɍ # L 六 ޅ H)Eh E ~ L ȱŪȘeeL/ ,0,   0 ,   `'  d 0L8宅寅ee 0 0`LL1.13Repair h:SAR#RCDEIwJRhTXWYhZa-b-[ `H  |  h [   ^ L}   L`  ] < $0 `%ɣ! L @ &ʩ@ >REPAIR 1.02 H7:" "8,"*")" Bad program recovery "8,"*")':28;22,39,2:=P:*K.0 :" at line ";:TXA ( A%=Q%:L%=0:A$=8," "):?Q%=13 2A%?1>127:dH@ <A%?3<5 A%?3>180:d\@ F?(A%+A%?3)<>13:t`@ P3A%?1*256+A%?2>L%+100 A%?1*256+A%?2<=L%:tt@ ZL%=A%?1*256+A%?2 d+;L%;" ";:B%=4:F%=0::A%?B%=34:F%=1-F% nA%?B%<32:A%?B%="|" x~A%?B%=141:B%=B%+1:;(?(A%+B%+2)63)*256+(?(A%+B%+1)63)+(((?(A%+B%)16)1) 3)*64+(((?(A%+B%)15)4)*4096);:B%=B%+2:tL@ 127 F%=0::A1%=127 A%?B%:A$:A1%:A$; A%?B% B%=B%+1:B%=A%?3:A%?B%=13 " ok":A%=A%+A%?3:Tr@ 3"No CR on line ";A%?1*256+A%?2;". Fix?";:TDA &Z%="Y"?(A%+A%?3)=13:DP@d\@ -"Line ";A%?1*256+A%?2;"? Change?";:TDA :Z%<>"Y" DZ@ A%?1=(L%+1)256:A%?2=(L%+1)256:DZ@ 1"Line ";A%?1*256+A%?2;". Ignore end?";:TDA CZ%<>"Y":A%?1=255:TbA A%?1=(L%+1)256:A%?2=(L%+1)256:Tr@ :"Length wrong on line ";A%?1*256+A%?2;". Fix?";:TDA 4Z%<>"Y":A%?1=255:"Can't go any further":TlA CB%=$(A%+4):B%=0B%>254:A%?1=255:"Can't go any further":TlA A%?3=B%+4:DF@ ;" (Y/N)";:Z%=( &DF):5,127);:Z%="Y""Yes""No"  &=17?(A%+1)=255:;L%:TlA;: ""Program repaired." ,*KEY0 LOMEM=TOP:*K.0|F|M 6/"FX138,0,128":Y%=:26,31,0,Y%+2,21:=Q%: @ *,AND,DIV,EOR,MOD,OR,ERROR,LINE,OFF,STEP,SPC,TAB(,ELSE,THEN,o,OPENIN,PTR,PAGE,TIME,LOMEM,HIMEM,ABS,ACS,ADVAL,ASC,ASN,ATN,BGET,COS,COUNT,DEG,ERL,ERR,EVAL,EXP,EXT,FALSE,FN,GET,INKEY,INSTR(,INT J LEN,LN,LOG,NOT,OPENUP,OPENOUT,PI,POINT(,POS,RAD,RND,SGN,SIN,SQR,TAN,TO,TRUE,USR,VAL,VPOS,CHR$,GET$,INKEY$,LEFT$(,MID$(,RIGHT$(,STR$,STRING$(,EOF,AUTO,DELETE,LOAD,LIST,NEW,OLD,RENUMBER T SAVE,,PTR,PAGE,TIME,LOMEM,HIMEM,SOUND,BPUT,CALL,CHAIN,CLEAR,CLOSE,CLG,CLS,DATA,DEF,DIM,DRAW,END,ENDPROC,ENVELOPE,FOR,GOSUB,GOTO,GCOL,IF,INPUT,LET,LOCAL,MODE,MOVE,NEXT,ON,VDU,PLOT,PRINT,PROC ^S READ,REM,REPEAT,REPORT,RESTORE,RETURN,RUN,STOP,COLOUR,TRACE,UNTIL,WIDTH,OSCLI B(C) H yh0 ݢ z  6zL `KEY0 Q%=PAGE:PAGE=&7200|MOLD|MV.6:RUN|M BASIC 0Repeat jq{x W6q  > Repeat / Repeatedly do things to directory objects : (C 30-Jun-98 v0.10 JGH: Gets confused if cmd=Delete, Rename, etc 2$ 31-Jul-98 v0.11 JGH: Fix quit$  > Repeat / Repeatedly do things to directory objects : (C 30-Jun-98 v0.10 JGH: Gets confused if cmd=Delete, Rename, etc 2$ 31-Jul-98 v0.11 JGH: Fix quit$ <7 01-Aug-98 v0.12 JGH: Decends Apps as well as Dirs F: P"ctrl%30,data%80:A$=OS_GetEnv Z4quit$=cl(" -q",1):debug%=cl("-d",0):::end djcl("-?",0):"Syntax: "run$" cmd dir -dir -app -file -recurse -verbose -tail tail -quit quitcmd":end n7file%=cl("-f",0):app%=cl("-a",0):dir%=cl("-d",0) x6all%=(file% app% dir%):verbose%=cl("-v",0) Irecurse%=cl("-r",0):tail$=cl(" -t",1):cmd$=cl("",0):dir$=cl("",0) debug%:"run$='"run$"'"'"file%=";file%;" app%=";app%;" dir%=";dir%;" all%=";all%;" recurse%=";recurse%'"dir$='"dir$"'"(19-)"quit$='"quit$"'"'"cmd$='"cmd$"'"(19-)"tail$='"tail$"'" dir$<>"":"Dir "+dir$ Scan:end: : 0end:quit$<>"":A$=quit$:quit$="":os(A$): Q%?1=0:=Q%:: Bݤfile(A$,A%):$data%=A$:?X%=data%:X%?1=data%256:=(&FFDD)&FF Uݤgbpb(A%):X%!1=data%:&FFD1:A%=data%+((A%<>5)(1+?data%)):A%?(1+?A%)=13:=$(A%+1) 6ݤOS_GetEnv:A$:A%=0:X%=1:os%=((&FFF4)&FF00)256 6os%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ")) os%=32:A$=$&100 /A$=0:?(P-3):A$=$&600 A$=0:A$=$&3800 AA%=0:A%=A%+1:A%=A$A$,A%)<32A$,A%)>126:A%<>A$:A$="" 7A%=A$+" "," "):run$=A$,A%-1):run$<>"":=A$,A%+1) uX%=ctrl%:Y%=X%256:A%=9:?X%=0:X%!1=data%:!data%=0:&FFD1:!data%?data%+data%?2<>8:data%?(1+data%)=13:=$(data%+1) "="" ,Hݤcl(l$,n%):l$="":I%=A$+" "," "):l$=A$,I%-1):A$=s(A$,I%+1)):=l$ 6l$=32 A$<>"":A$=" "+A$ @bI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$+" "," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$+" "," ")-1) JqI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-2-(I%=1)) I%:A$=A$,I%-1)+A$,A$+" "," ",A$+" "," ",I%)+l$)+1) T"A$=s(A$):n%:=s(l$) =I%<>0 ^(os(A$):A$=""A$=42:A$: A$: h/ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " r+A$,1)=" ":A$=A$,A$-1):A$,1)<>" " |=A$ : Scan: p%,r% X%=ctrl%:Y%=X%256: 8?X%=0:X%!1=data%:X%!5=1:X%!9=p%:!data%=0:A%=8:&FFD1 !r%=X%!5:p%=X%!9:r%=0:RdName  r%=1: :  إ File not found H JJJJhĪ  ) #" o ) l  H HSyntax: ScrLoad  إ File not found H JJJJhĪ  ) #" o ) l  H H L3  Bad file@ , H$0J DH =h)8ei,hhHHhвhh hh` )  0>0;ʠ ) JJJJ `ܘee o "L`lLffffff` L L000@XX`|16/12/91Scroll ^{6W=  > Scroll ! Scrolling text file display +xtr:A$=OS_GetEnv:ver$="1.12":c$="128" ((&83:h%=24:w%=79:>&4000:&80:h%=31 2Ainit:lp$=cl("-l"):tt$=cl("-4"):  > Scroll ! Scrolling text file display +xtr:A$=OS_GetEnv:ver$="1.12":c$="128" ((&83:h%=24:w%=79:>&4000:&80:h%=31 2Ainit:lp$=cl("-l"):tt$=cl("-4"):ch$=cl("-c"):pl$=cl("-p") <6quit$=cl(" -q"):Z$=cl("-?"):A$=cl(" "):asm:go F" "+A$+Z$," -?"):"Syntax: Scroll (-lp ) (-4 ) |-chan + (-plen ) (-quit )":end(): PA$="""""":A$="" ZCcat%=A$+ch$="":max%<2500:"Not enough memory to run":end(): dlp$="":lp$=FindLP nplen%=0:pl$<>"":plen%=pl$ x err A$<>"":end(): EX%=ctrl%:Y%=X%256:pr% f$<>"":pr%=:go:con:cat%=lp(f$):f$="" :cat%::">> Scroll Version "ver$" - (C) J.G.Harston Buffer size: &";~max%;" (";max%;" bytes) <<"':".":'"Press SHIFT-Escape to exit.":*FX4 D:cat%=:f$=A$:f$+ch$="":"File: "f$:f$,1)="*":dis:f$:con 'f$,1)<>"*":cat%=lp:f$="":A$<>"" end(): : end(F%):cl:*FX4 *FX229 *FX225,1 dis:F%: &quit$<>"":13:"Exit";:os(quit$)  <ݤerr:<>17::<128 <>17:" at line ";; <>17: cat%==17:cl:=-1 #init:cat%=:ch%=0:pr%=:f$="" NMax%=--1000+2000*(os%=6):ctrl%20,data% Max%+4:end%=data%+Max%:max%=Max% "X%=ctrl%:Y%=X%256: ,,ݤcl(l$): I%:l$=32 A$<>"":A$=" "+A$ 6SI%=A$,l$):l$="":I%:l$=A$,A$," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$," ")-1) @?I%:A$,I%,1)=" ":A$=A$,I%-1) I%:A$=A$,A$,l$)+1+l$) J=l$ Tcl:ch%:A%=ch%:ch%=0:#A% ^ h(os(c$):c$=42c$="":c$: c$: rݤlp:len%=0:f$+ch$="":= |@ch$<>"":len%=ch$,"+"):ch%=ch$,len%-1):len%=ch$,len%+1) 8ch$="":ch%=(f$):ch%=0:"File '"f$"' not found":= qlen%=(#ch% (len%=0))+len%:pt0%=#ch%:len%end% ch%:dn i%=8 ptr%end% ch%:dn LI%=2 ptr%I%=4 ch% fst%0:fst%=0:gbpb(max%,0) NI%=5:top%=data%:pg:0 X'(I%&FE)=6:c$=(c$32):on:pg:0 b(I%&FE)=16:pr l5I%=18 tt$<>"":end():"Mode7";:os(tt$+" "+f$) vI%=1:*FX229  *FX225,1 = : Bpg::13:ptr%=top%:line%=line0%:p(ptr%):ptr%=ptr%+1+$ptr% F>=h% ptr%>=data%+len% ptr%>=end%:=top%:data%+1+$data%=top%:t%=data% =top%=t%:t%=ptr%-100:t%=t%+1+$t%:t%+1+$t%=ptr%:ptr%=t% ?30,11,13:p(top%):0,h%);:ln:ptr%+1+$ptr%data%+len%-fst%:ptr%=t%: dn:fst%+max%>=len%: -f%=fst%+max%2:f%+max%>len%:f%=len%-max%  off%=f%-fst%:off%=0: end% A%>data%+len%: ppr:(79);13;"Print out ";f$;" Printout with *";:lp$<>"":i%=1 lp$+1:"FX138,0,"+×lp$+" ",i%): C""lp$:lp$="":7:"No printout command found";:A%=(200):pg: >pr%=:dis:"Printing...";:lp$+" "+f$:go:on:pr%=:pg: : ݤFindLP:i("lp")=1:="lp" A%=i("%.lp"):A%=1:="%.lp" !A%=2:i("%.lp.#"):="%.lp.#" !A%=2:i("%.lp.*"):="%.lp.*" i("$.lp"):="$.lp" $os%<6:i(":0.$.lp"):=":0.$.lp" ="" 6ݤi(f$):A%:$data%=f$:A%=5:!X%=data%:=(&FFDD)&FF : $7ݤOS_GetEnv:A$:A%=0::X%=1:os%=((&FFF4)&FF00)256 .Aos%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ",1+A$," "))) 8os%=32:A$=$&100 B-A$=0:?(P-3):A$=$&600 A$=0:=$&3800 L-A%=A$+" "," "):run$=A$,A%-1):=A$,A%+1) V: `on:m%:"CODE "+c$ j toff:m%:"CODE 0" ~ con:m%:"CODE 251"  dis:m%:"CODE 253"  go:m%:"disp ON":  c(-1): Cp(P%):line%=line%+1:plen%:line%plen%=0:off:79,"="):off m%:$P%:  c(?P%):P%=P%+1:P%?-1=13: =asm:m%=os%<>6:m%:: :"Can't find *disp":end():   xtr: .(-256 &F0)=&A0: ?(P-3):$&700=$&600  reloc(&500,3):A%=:A%=A%+1+$A%:I%=$A%,&DD+&F2+"xtr:"):I%:A%!(I%+5)=!(P-3+2*(?(P-3)=0)):=A%+I%+8-2*(?(P-3)=0):?(P-3):$&600=$&700: ': Last line MUST end with ENDPROC !c(A%):A%<0:flg%=0:out%=1: (A%<32:ctrl(A%): 2flg%>127:flg(A%): <out%=out%+1:A%=32:A%=9 Fflg%=0: A% out(A%) P Zctrl(A%) d%A%=9:z%=(out% 7) 7:c(32):: nA%=13 A%=10::out%=1: x%A%=28:flg%=flg% 1:: Underline 5A%=29:flg%=flg% 128:: Wait for next character  .flg(A%):flg%=flg% 127:A%<65 A%>126: b%=0:a%=A%<96:A%=A% &DF A%="B":b%=&FD A%="H":b%=&BF A%="I":b%=&F7 A%="Q":b%=&BB: Almost A%="S":b%=&EF A%="W":b%=&FB A%="X":b%=&BB A%="Y":b%=&DF b%=0:"(";A%;")";: 'flg%=(flg% b%)(a% (b% 255)): out(C%):C%=9:C%=32  z%,a%:A%=10:?X%=C%: &FFF1 ")(flg% 1):X%?8=255: or X%?8 EOR 255 ,4(flg% 2): z%=1 8:X%?z%=X%?z% (X%?z% 2): 6Z(flg% 8):X%?1=X%?1 4:X%?2=X%?2 4:X%?3=X%?3 2:X%?4=X%?4 2:X%?7=X%?7*2:X%?8=X%?8*2 @>(flg% 48):X%?2=X%?3:X%?3=X%?5:X%?4=X%?6:X%?5=X%?7:X%!6=0 J8(flg% 32):X%!8=X%!5:X%!4=X%!1:X%?1=0:X%?2=0:X%?3=0 T* Sub/Super need a bit of modification ^(flg% 4):z%=1 8:?(X%+9+z%)=X%?z%:X%?z%=(X%?z% 128)+(X%?z% 128) 2+(X%?z% 64) 2+(X%?z% 64)4+(X%?z% 32) 4+(X%?z% 32) 8+(X%?z% 16) 8+(X%?z% 16) 16::outB h(flg% 4):z%=1 8:X%?z%=?(X%+z%+9):X%?z%=(X%?z% 1)+(X%?z% 1)*2+(X%?z% 2)*2+(X%?z% 2)*4+(X%?z% 4)*4+(X%?z% 4)*8+(X%?z% 8)*8+(X%?z% 8)*16: r outB: | outB (flg% 68)=68: 23,255:z%=5 8: X%?z%,X%?z%:: 10,255,8,11:z%=7 0 -2:?(X%+z%+1)=?(X%+1+z%2):?(X%+z%)=?(X%+1+z%2): (flg% 68)=64: 23,255:z%=1 4: X%?z%,X%?z%:: 11,255,8,10:z%=0 7 2:?(X%+z%+1)=?(X%+5+z%2):?(X%+z%+2)=?(X%+5+z%2): ' 23,255:z%=1 8:X%?z%:: 255: Greloc(S%,X%):A%=133:X%=X%&80:A%=(&FFF4 &FFFF00)256:A%->S%: $&700=$&600:B%=(+(A%--S%))&FF00:"Relocating to &";~B%:A%=0 -+4 4:A%!B%=A%!::C$="":B$=(0):B$<" " B$<>"":B$="|"+(64+B$) FC$=C$+B$:B$="":"KEY0 RUN|M"+C$:"FX138,0,192":=B%:$&600=$&700:  B(C) {H {h H {h * pqr^srpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC MScrSave 'W3Syntax: ScrSave  ٥ #" o ) l   ? ` ? u  L H Library G TScrSae ?'pSetExc ? sSetLod ? tSetTye ? _uShow ? wSRLoa ?C xSRSav ?9 5zStamp ? AP|TreeCpy {]{gH~TxSav ? axVList ?wETree i{10|Exploe ? bFileIfo ? p,Filer L{^/Files ? vXForm10 `?<`?xKillDS ?@ X qlpS ?;XxMakeL D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6O` X  LHADFSROM  Press BREAKNo SRAM Not a system disks`_NullKeyboard0.12 (01 Aug 1998)O`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGHPRINT ???r t ???????????????Syntax: SetExec  Υ ! 𴢪 Ъ Р LFile not found   6666 `0:)G)`ȱ 8`v1.00SetLoad  W> Syntax: SetLoad Syntax: SetLoad  Υ ! 𴢪 Ъ Р LFile not found   6666 `0:)G)`ȱ 8`v1.00SetType  _W3Syntax: SetType Syntax: SetType  Υ ! 0 𬢪 Т  F        $0  LFile not found   666 `0:)G)`ȱ 8`TEXTCOMMANDDATAUTILITYBASICMODULEBBC FONTTELETEXT|BBC ROMShow  W30:)`Bad key #* ȱ 7 i ȅ$ 1 0 k `"  ū# Ū0:)`Bad key #* ȱ 7 i ȅ$ 1 0 k `"  ū# Ūū 䫐" LH| ! h) |" LH| hi@)L V1.00SRLoad C W3PresPress SPACE to loadSyntax: SRLoad () (I) (R) (P) (Q) 򥩅 A0:,A)G RQPIЇi) x x )w H,x 0 B w x J  y z y w 8 0櫥x )&> w x )Lh0`(C) 8 `No RAM found01.03SRSave 0:U%=d$:U%=0:'"No output available.":C: UE(2,U%,g%):d%=g%:b%=g%::#U%:C:F:Z%=Z%&FF:`%=U$Press SPACE to saveSyntax: SRSave (P) (Q) 򥩅 9+0:"A)GQPЕ)   ) H J     0櫥 J )``0! %  h0`0p1.03Stamp  AW*Syntax: Stamp  = > α! 6 6  L~ )?8 )7  i`i@6 6  6 8 H)8 h)Jm6 Ɍi_i6 =  Syntax: Stamp  = > α! 6 6  L~ )?8 )7  i`i@6 6  6 8 H)8 h)Jm6 Ɍi_i6 =  6 )p 8 L 6 7 M LFile not found0): )GF&&&&)eѥ`H)JJJ: m: : h)m: `YMDdHMS1.04TreeCopy {]{gW) ! > TreeCopy 1.57 15-Jan-2007 F}&87:23;2,53;0;0;0:A$=C+" ":11"TreeCopy 1.57"'1114,"=")':A=&FFD1:B=&FFDD:C=&FFF1:D=&FFDA:X%31,C%127:Y%=X%256:*FX1 dG%= ! > TreeCopy 1.57 15-Jan-2007 F}&87:23;2,53;0;0;0:A$=C+" ":11"TreeCopy 1.57"'1114,"=")':A=&FFD1:B=&FFDD:C=&FFF1:D=&FFDA:X%31,C%127:Y%=X%256:*FX1 dG%=(-P-2500)&FFFF00:B%G%:G%=G%-256:Q%=B%+G%:Q$="":S$="":D$="":f%=1:h%=1:i%=1:a%=1:M%=1:R%=1:n%=:I%=0:A$,6)="-quit ":Q$=A$,7,A$-7):A$="" (A$,2)="-d":n%=:A$=A$,A$," ")+1) CA$<>""S$=""A$,1)<>"-":I%=A$," "):S$=A$,I%-1):A$=A$,I%+1) CA$<>""D$=""A$,1)<>"-":I%=A$," "):D$=A$,I%-1):A$=A$,I%+1) .S$<>""D$<>"":I%=A$,1)="~":I%:A$=A$,2) %S$<>""D$<>"":A$,1)="C":h%=I% %S$<>""D$<>"":A$,1)="P":f%=I% %S$<>""D$<>"":A$,1)="R":i%=I% %S$<>""D$<>"":A$,1)="E":a%=I% %S$<>""D$<>"":A$,1)="A":M%=I% %S$<>""D$<>"":A$,1)="S":R%=I% $" ACDEFPRSU",A$,1)):A$=A$,2) [A$="-? "::"Syntax: TreeCopy (fs:)src (fs:)dest CPREAS (-dest) (-quit (*)name)":q: A$="":"Caution - This program does not check"'"for circular pathnames - Eg Copying"'"$.FRED into $.FRED.JIM will repeatedly"'"create $.FRED.JIM.JIM.JIM.JIM...etc."''"Buffer length: &";~G% ,7S$<>"":I%=S$,":"):I%>1:K$=S$,I%-1):G$=S$,I%+1) 6#:-1:Q$=13:"FX1,"+ß:q @S$<>"":I%<2:K$="":G$=S$ JFS$=""::K$=E("Source filing system: "):K$:G$=E("Source dir: ") T8j%=(A("^")=2):F=4:e%=(A(G$+".$")):e%=2e%=A(G$) ^"e%=0:G$" does not exist.":q h'e%<>2:G$" is not a directory.":q r*f%>0:'"Pause to change disks";:f%=D |7D$<>"":I%=D$,":"):I%>1:L$=D$,I%-1):d$=D$,I%+1) D$<>"":I%<2:L$="":d$=D$ AD$="":':L$=E("Dest. filing system: "):d$=E("Dest. dir: ") L$="":L$=K$ M$="":J$="":E$="":K%=F:B:N%=F:E$=d$:N%>4E$,"$")+E$,"%")+E$,"&")+E$,":")+E$,"@")=0:"Dest. dir must be an absolute pathname, ie it must contain one of $,%,&,@ or :":q K%=N%:K$="":L$="" K%<>N%K%=8:M$="Mount" K%<>N%N%=8:J$="Mount" WK%=N%f%(K%=8K%=16):M$="Mount "+H:J$=M$:J$:G$,1)<>"$"G$,1)<>":":G$="$."+G$ N%>4:L(E$)*DIR$ h%>0:I:"Confirm";:h%=D (i%>0:i%=:K%>4'"Recurse";:i%=D: K%=5:_%=&FFFFFF3B_%= 2a%>0:a%=:N%=4"Expand into DFS dirs";:a%=D !a%E$,2)=".$":E$=E$,E$-2) Go%=:R$=E$+".":H$="":I$="":K%<>N%:A("^")=2:H$="DIR ":R$="":O$=B 0AK%=N%K%>4j%f%:A("%")=2:H$="LIB ":I$="%.":R$="%.":O$=G :H$<>"":H$+E$ DC::N$="":j%:N$=B NMM%=:R%=:F=4:"Do all DFS dirs";:M%=D:M%:'"Put in subdirs";:R%=D: XR%:T$="."T$="/" b_F:" Dir. ";G$:"DIR "+G$:E$=E$+".":Z%=0:H%=B%:k%=:?H%=0:F$="":O%=0:S%=0:L%=33:M%:*DIR ! I:"FX1,"+ß:q U:k%Z%=0:S::q q:n%:B Q$="":Q$=13: Q$,1)="*":Q$:Q$=13: Q$ S:H$<>"":B:H$+O$ F<>K%:C N$<>"":"DIR "+N$   (ݤE(A$):A$;:""B$:B$,1)="*":B$ B$,1)<>"*":=B$ * ݤI:I:11::;:<128::= 4_=195(Z%&C)=4:". Overwrite";:q%=D:q%:H%=P%+F%:==195(Z%&C)=4:"ACCESS "+d$::= >". Skip";:m%=D:m%Z%=0: HZ%=0m%:F$=C$:T%=A%:= R (Z%&C)=4::m%:H%=P%+F%:= \)(Z%&C)=12m%::H%=B%:?H%=0:F$="":J zF$="":=<128-1 7J:J$="":(Z%&100)=0:Z%=0:#`%:B:#U%:C:F:: #J$="":Z%=0:#U%:C:#`%:F:: (Z%&100)=0:Z%=0:#`%: Z%=0:#U%:C:F:: U:Z%=0:O: (Z%&C)=0?B%=0:Z%=Z%+12 &(Z%&C)=0::B:Z%=Z%+4:H%=B%:P: (Z%&C)=4:M:Z%<8: )(Z%&C)=8:C:Z%=Z%+4:H%=B%:F:f%: (Z%3)<>1:Z%=0:?H%=0: )(Z%&C)=12:Q:Z%=0:F$="":H%=B%:?H%=0  *O:F$<>"":C$=F$:A%=A(C$):F$="":A: $0Z%<>0:l%=0: BM%:A%=3:C$="":A: L7O%=0:L%=L%+1:L%=34L%=":"L%="*"L%="|":L%=L%+1 VL%="a":L%="{" `&L%<127:"DIR "+L%A%=3:A:*DIR $ j ~IK:?(C%+?C%+1)=13:C$=$(C%+1):C$,1)=" ":C$=C$,C$-1):C$,1)<>" " 3A%=A(C$):A%=2i%:(S%*2);:A%=2:"Dir. "; #A%<1A%>2:" not recognised": M%L%<>"$":L%,46 C$;:h%:笤J:: A: DA:V%=X%!2:W%=X%!6:F%=X%!10(A%=1):F%>G%-32:F$=C$:T%=A%:Z%=1: DK%=5:$(C%+8)=C$:G(&14,&12002000,&40000000):C%?2=0:X%!15=C%!10 LJ%=X%!14:$(H%+1)=K(C$):P%=H%+2+$(H%+1):P%+F%+32>Q%:F$=C$:T%=A%:Z%=2: "A%=3Q%=B%+G%:k%=:Z%=2:11:  #A%=3:N:O%=!Q%:Q%=Q%+4:S%=S%-1 6!P%=V%:P%!4=W%:P%!8=F%:P%!12=J%:P%=P%+16:A%<>3:I (XA%=1:"LOAD "+C$+" "+~P%A%=2:"DIR "+C$:Q%=Q%-4:!Q%=O%:O%=0:G$=G$+"."+C$:S%=S%+1 <?H%=A%:H%=P%+F%:?H%=0: PݤK(F$):K%>4:=F$ ZM%L%<>"$":=L%+T$+F$=F$ nHN:G$=G$,G$-1):G$,1)=".":G$=G$,G$-1):j%:"DIR ^""DIR "+G$  7B:f%I:"Insert dest. and press SPACE";:<65: L$<>"":L$ *J$<>"":J$:E$<>"":"DIR "+E$,E$-1) 6(J$<>""E$<>"")(K$+L$=""j%):"DIR "+E$,E$-1)  6C:f%:"Insert source and press SPACE";:<65: K$<>"":K$ M$<>"":M$:"DIR "+G$ %M$<>""(K$+L$=""j%):"DIR "+G$  M:?H%=0:Z%=Z%+4: [A%=?H%:C$=$(H%+1):P%=H%+2+C$:V%=!P%:W%=P%!4:F%=P%!8:J%=P%!12:P%=P%+16:A%=3:T:H%=P%: ,A%=2:R:H%=P%: 6'H:E$;C$;:I$="":d$=E$+C$d$=I$+C$ @C"SAVE "+d$+" "+~P%+"+"+~F%+" "+~W%+" "+~V%:D:H%=P%+F%:: TD:N%<4: UK%=4:J%=(J%1)((J%8)4) VN%=4:J%=J%8 ^ N%=8:J$ hH$="":$C%=E$+C$$C%=I$+C$ r7!X%=C%:X%!2=V%:X%!6=W%:X%!14=J%_%:A%=1:B:N%<>5: K%<>16K%<>5: $(C%+11)=$(C%+1):C%!7=J%_%:C%?10=?C%:G(&14,&13002000,&05000000):$(C%+18)=$(C%+10):C%!7=J%_%:C%!10=0:C%!12=J%_%:C%?12=0:C%?16=0:C%?17=0:G(&14,&13002000,&40000000): -H:a%C$,2,1)="/":C$=C$,1)+"."+C$,3) .N%=4:C$=C$,7-2*(C$,2,1)=".")):J%=J%&33 4M%R%o%<>C$C$,2,1)=".":L(E$+C$,1)):o%=C$ K%=4:J%=J%&33  5T:E$=E$,E$-1):E$,1)=".":H$<>"":H$+I$+"^"  "R:I$="":L(E$+C$)L(I$+C$) &!D:E$=E$+C$:H$<>"":H$+I$+C$ 0E$=E$+".": DnQ:C$=K(F$):U$=F$:A%=A(U$):V%=X%!2:W%=X%!6:F%=X%!10:J%=X%!14:U%=0:`%=U$:`%=0:"No input available.": bQg%=(Q%-B%-32)&FFFF00:E(4,`%,g%):#`%:B:P:Z%=Z%&100:H:I$="":d$=E$d$=I$ l'E$;C$;:d$=d$+C$:$C%=d$:!X%=C%:X%!2=V%:X%!6=W%:X%!10=0:X%!14=F%:A%=7:A%=(B)&FF:U%=d$:U%=0:U%=d$:U%=0:'"No output available.":C: UE(2,U%,g%):d%=g%:b%=g%::#U%:C:F:Z%=Z%&FF:`%=U$:#`%=d%:d%+g%>F%:b%=F%-d% pE(4,`%,b%):#`%::B:Z%=Z%&100:U%=d$:#U%=d%:P:E(2,U%,b%)::d%=#U%:#U%:d%>=F%:D:C:Z%=Z%&FF:F:: -E(A%,c%,b%):?X%=c%:X%!1=B%:X%!5=b%:A: (L(F$):F>4:A(F$)<>2:"CDIR "+F$  (ݤA(F$):!X%=C%:$C%=F$:A%=5:=(B)&FF F:I:"Reading...";:  P:I:"Writing...";: *I:>0: 4 HXݤD:A%:"? (Y/N)";:A%=&DF:A%=89A%=78:5,8);:A%=89:"Yes ";:="No ";:= p{ݤJ:A%:"? (Y/N/A)";:A%=&DF:A%=89A%=78A%=65:7,127);:A%=89:"Yes ";:=A%=78:"No ";:="All ";:h%=:= ݤF:A%,E%,Y%:=(&FFDA)&FF ݤB:A%,n$,p$:A%=6:X%!1=B%:A:?(B%+2+?B%+?(B%+?B%+1))=13:n$=$(B%+2+?B%):"DIR ^":n$=n$,n$+" "," ")-1):p$=n$+"."+p$:n$="$"n$="&":p$=p$,p$-1):"DIR "+p$:X%!1=B%:A:?(B%+1+?B%)=13:n$=$(B%+1):n$<>"":=":"+n$+"."+p$ $SX%!1=B%:A%=5:A:?(B%+1+?B%)=13:n$=$(B%+1):n$=n$,n$+" "," ")-1):=":"+n$+"."+p$ 82ݤG:a$,b$:a$=B:"DIR %":b$=B:"DIR "+a$:=b$ `/ݤH:A%=6:X%!1=B%:A:?(B%+1+?B%)=13:=$(B%+1) ~@G(A%,D%,E%):X%,Y%:X%=C%:Y%=X%256:!X%=D%:X%!4=E%:&FFF1: rݤC:A$,A%:X%=1:p%=((&FFF4)&FF00)256:X%-1:p%=32:>&FFFF:ș"GetModuleFileName",0,X%,255:A$=$$X%:P$=A$:=V$ p%=32:A$=$&100 wA$=0:>&7FFF:P$=$&8100:ș"OS_GetEnv"A$,,A%:ș"OS_WriteEnv","",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=P$ 0A$=0:?(P-3):A$=$&600A$=0:A$=$(-&300) 3A%=A$+" "," "):P$=A$,A%-1):P$<>"":=A$,A%+1) bY%=X%256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:&FFD1:A%=X%+16:!A%?A%+A%?2<>8:A%?(A%+1)=13:=$(A%+1) ="" B(C) {H {h H {h * pq{r]srpqs {۠{L `{{`{{H Ϋ{ {h`p{{{p`Q%=PAGE OLD RUN BASIC "TxSave  aWSyntax: TxSave  O P ϩ HHO  O P  / 0   Syntax: TxSave  O P ϩ HHO  O P  / 0    ޤ  h hLʽ? H hJʊH hH ( h`HO JJJ)h)' =? ,' ? ? O  O P O ` @1VList W5w tL`, 8 ȱꅪ L 轀Х0̠ȱe<   Ji@ ȱ L0 H" tL`, 8 ȱꅪ L 轀Х0̠ȱe<   Ji@ ȱ L0 H"0%V$L (L* 8L 9 ɠffff>( 0L   ie(+<P 檥 $ 0<HhHhL ȱȱ$ " H ` h  L )HH  hh  H hLCHR$(& '=#&")+HJJJJ h) ii0Lv1.11 8*W+Manual 7vChapter1 "Read"; fJ?X%=ch%:X%!1=data%:X%!5=n%:X%!9=p%+pt0%:&FFD1:data%!max%=&D0D0D:*FX21 p cr: zcr:13"Wait";:A%=data%: R(?A%=10 A%?1=13)(?A%=13 A%?1=10):?A%=32:A%Manual G Chaptr1 N?tXChaptr2 N?@8XChaptr3 N?STgx%Chaptr4 O?t|!MNx%aChaptr5 N?ex%Chaptr6 N?ѭ,XChaptr7 O?A ex%CChaptr8 O?A BNx%Chaptr9 O?Y (Histoy ?RJx%Ш0` X  LHADFSROM  Press BREAKNo SRAM Not a system disk`_NullKeyboard0.12 (01 Aug 1998)a`4SoftRTC0.10 (23 Nov 1992)(Untitled_Disk) (C)JGH D?5%MCode r_zg$MDump ?0 -Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai ry=p6Repea jq{x q?ROMS ? JScrLod ?@LScrol ^{6OQ1 Introductionq   DWhat is HADFS?d The HADFS is a full hierarchial filing system similar to the NFS and ADFS systems. It runs on any 6502-based BBC computer, with any disk hardware. It is independent of the hardware configuration, adapting its operation to different requirements. HADFS formatted disks contain the ROM image for the system, allowing it to be easily distributed. The only requirements needed are a DFS (any sort) that supports OSWORD &7F to read and write sectors of the disk, and 16K of sideways RAM. As an alternative to the sideways RAM, the ROM image can be blown into an EPROM and permanently installed in the machine. HADFS was written and is under continuing revision by: Jonathan Harston 70 Camm Street Walkley Sheffield S6 3TR EMail: jgh@arcade.demon.co.uk and remains wholly copyrighted, (C) 1990-2007. The program can be freely distibuted, as long as the code is not modified, and all copyright and authorship messages remain, and no charge is charged, other than legitimate disk purchase and copying costs. Ownership can be registered by writing to the above address, enclosing `5. This entitles you to a full printed reference manual and to immediate code updates. You are under no obligation to register, and you can probably manage with the manual contained these files. DDefinitionsd Within this text, the following terms are used: IPressi means press, ie put your finger on the key, push down, and then release, as in: IPress "X"i. ITypei means a succession of presses, ie pressing each individual key, as in: IType "fred"i. It does not mean press Return at the end. IEnteri means Itypei, and then Ipressi the Return key, ie enter in something, as in: IEnter the filenamei. IReturni refers to the key labelled BRETURNb (or sometimes BENTERb). IShifti refers to the key labelled BSHIFTb. ICtrli refers to the key labelled BCTRLb, and is called the control key. IDeletei refers to the key labelled BDELETEb. IBreaki refers to the Break key. IShift-Breaki means press the Break key while holding down the Shift key. The Shift key on its own does not do anything, so don't be afraid to hold it down longer than necessary. In fact, this is to be recommended. ICtrl-Breaki means press the Break key while holding down the Ctrl key, similar to above. BKb is a unit of storage size, being 1024 bytes. BMb is a unit of storage size, being 1024K, being 1048576 bytes. BGb is a unit of storage size, being 1024M, being 1048576K, being 1073741824 bytes. DText conventionsd Within this manual, different styles of printing are used to differentiate between different things: Ordinary text appears like this. Text that appears on the screen, including error messages, *commands you type in and filenames appears in bold, like this: B*CATb Program names, specifying one of the HADFS programs appears in italics, like this: IHUtilsi. Subsection headings are underlines like this: Subject DStartupd There are two types of HADFS disk. There is an HADFS data disk, which just contains data, and an HADFS system disk. The only difference is the presence of an IHADFSROMi file on the HADFS disk. On booting up an HADFS disk for the first time with Shift-Break (or Shift-D-Break), any HADFS ROM image is loaded in and the machine is reset again. This only needs to be done if the ROM image is not present in an EPROM. If it is, then it is already present at power-on. Unless otherwise stated, the manual will assume that the ROM image is in the machine, either in sideways RAM, or in an EPROM. If a second processor is attached when loading in the ROM image, then the message BPress Break to reset Tubeb is given, and the Break key should be pressed to reset the second processor. An HADFS data disk does not have the ROM image on, thereby releasing 16K of space for extra files. In all other respects, HADFS data and system disks are identical. Once HADFS is in your machine, it can be selected by B*HADFSb or by H-Break. DCompatabilityd I have written and tested HADFS on a variety of machines, with a variety of DFSs. At the moment, all the DFSs I've tested it with have been Acorn and Watford ones, so I can't guarantee that it will work on others, but if it provides all the legal calls needed by HADFS, it will work. I have used HADFS on the following machines: BBC, DFS 0.90 BBC, DFS 1.20 BBC, Watford DFS 1.43, 1.44 BBC B+, DFS 2.10 Master, DFS 2.24 Master Compact, DFS 2.24 also with: Watford ROM/RAM board Aries-B32 sideways RAM Solidisk sideways RAM Solidisk DFS (limited testing) 6502 second processor (BBC and Master) Z80 second processor (BBC) 32016 second processor (BBC) ARM second processor (BBC and Master) Shadow screens are recognised on: Master computers Aries-B32 Watford 32K RAM card HADFS needs the OSWORD call &7F provided by Acorn DFSs to read and write to disks. I haven't yet been able to test it properly on an Electron, as although I have a disk interface for it, I haven't got a Plus-One, so I can't plug it in. You are welcome to copy HADFS and give it to your friends, etc., as long as none of the code or files are changed. DSystem Startup Softwared The System Startup disk contains all the software needed to start using HADFS. The disk contains the following directories: Manual containing text files of this manual Utils contains HADFS utility programs DMap, HDInit, HEdit, HUtils, Intern/s, MCat, Rescue, SetDate, VisCompact Library contains three groups of utility commands: HADFS commands: *BACKUP, *COMPACT, *Copy, *Disks, *Files. File commands: *CLoad, *CSave, *ETree, *FileInfo, *Filer, *PrList, *Repeat, *ScrLoad, *ScrSave, *SetExec, *SetLoad, *SetType, *SrLoad, *SrSave, *Stamp, *TreeCopy, *TxSave. Utility commands: *Break, *Crunch, *disp, *Explode, *lp.*, *lpS, *MakeLP, *MCode, *MDump, *Mouse, *pc8s, *Repair, *ROMS, *Scroll, *Show, *VList BASIC Programming library: BLib.* Extras contains various extras including demonstrations of using HADFS and HADFS extensions. Includes DemoArgs, DemoGbPb Examine, FredDisk/s, JimDisk/s, NFSFront, PrInfo, RSLink/s, Stats, Support/s. HADFS is available in the following formats: ISBN 1-899366-00-8 Manual, 400K 5" disk, 400K 3" disk and EPROM `5.00 On special request, the startup disk can be supplied on 5" disks as: 2*5" 1*80trk 200K disks AB and CD `5.00 2*5" 2*40trk 200K disks AB and CD `5.00 4*5" 1*40trk 100K disks A, B, C and D `5.00 The software is split over the disks as: A: Utils and small Library B: Library, Extras C: Manual Chapters 1 to 5 and small Library D: Manual Chapters 6 to 10 and small Library Chapter2 =Z%&100:U%=d$:#U%=d%:P:E(2,U%,b%)::d%=#U%:#U%:d%>=F%:D:C:Z%=Z%&FF:F:: -E(A%,c%,b%):?X%=c%:X%!1=B%:X%!5=b%:A: Q2 The Filing Systemq   DWhat is a filing system?d Almost all computer applications need some kind of access to an external storage medium, for example a disk, to save information. The most common reason for this is that the computer does not remember what is in its memory after it has been switched off. Also, some programs may need to use large amounts of data that will not all fit into memory at the same time. To use this external data, some means of accessing it must be provided in order to retrieve or modify existing items and to create new items. The items are refered to as Efilese. A Efiling systeme provides a convenient way of performing these tasks. DWhat about DFS?d Many BBC series computers are fitted with DFS to access disks with. DFS is useful, but suffers from one major limitation. You are only allowed to have 31 files on each disk (62 if you count both sides of a disk). You could use ADFS, but that requires different hardware. HADFS allows you to use the existing DFS hardware and uses a modified DFS-format disk to provide a full hierarchial disk-based filing system. DDirectories and subdirectoriesd HADFS is a hierarchial filing system. What this means is that the disk can contain files and directories. Directories are collections of files and can also contain more directories, or subdirectories. The structure is called a 'tree' because it looks like an upside-down tree. Everything starts at the 'root', which, being upside-down, is at the top. ͻ $ (Root directory) Ѽ Ŀ Ŀ ͻ ͻ ͻ ͻ !Boot Extras Manual Library Utils ͼ ͼ ͼ ͼ Ŀ Ŀ Ŀ Ŀ ͻ Ŀ Ŀ Ŀ Ŀ Copy Disks ETree lp MakeLP TreeCopy HEdit HUtils ͼ Ŀ Ŀ Ŀ Ŀ Ŀ a4 nlqa4 66 nlq66 The root directory is called I$i. This diagram, which shows part of the HADFS System disk, shows the root directory containing several subdirectories, IExtrasi, IManuali, ILibraryi and IUtilsi. ILibraryi and IUtilsi in turn each have files and subdirectories of their own. When HADFS is first used, or a B*MOUNTb command is used, the I$i directory becomes the 'Currently Selected Directory', or CSD. When you type B*CATb or B*.b a catalogue of the CSD is displayed. You can also show other directories by giving the B*.b command a directory name, eg: B*CAT Libraryb or B*.Utilsb DMoving around the directory structured For directories to be useful, you have to 'move around' and create new directories. The B*DIRb command is used to change the CSD and move around the directory tree, for example to make the root the CSD, use: B*DIR $b You can use pathnames of any length, eg: B*DIR $.Library.lpb If you want to move back 'up' the directory tree, you use the B^b symbol, pronounced 'up'. Suppose you had set the CSD to I$.Library.lpi using the above command, then B*DIR ^b would move you back to I$.Libraryi. You can also select another disk by starting the pathname with B:b, so for example B*DIR :1b would set the CSD to B$b on drive 1. DCreating directoriesd You can create new directories anywhere on the disk using the B*CDIRb command. As an example B*CDIR $.Utils.Gamesb would create the directory IGamesi inside the IUtilsi directory. If the CSD was already set to I$.Utilsi, you could use B*CDIR Gamesb for the same effect. Once you have created a directory, you can move into it with the B*DIRb command and move back out of it with B*DIR ^b. DLibrariesd When a B*bcommand is issued, the MOS and sideways ROMs fitted in the computer are searched to find a match. If the command cannot be found there, then it is passed on to the filing system. HADFS looks in the CSD for a file of the name. If it cannot find one, then it looks in the currently selected library directory, the LIB. By default, the LIB is set to a directory called ILibraryi on the default drive or the drive mounted on. To set the CSD to the parent of the current directory. To specify a new library, the B*LIBb command is used, eg: B*LIB $.Utilsb You could set the LIB to be the same as the CSD by using B@b, which refers to the CSD: B*LIB @b DWildcardsd A means of abbreviating long names is provided by the 'wildcard' facility. The wildcards are B#b and B*b. The B*b character is used to ignore everything after the position it is used in. For instance B*INFO Let*b would show the information on the first object that started with the letters 'Let'. If would match ILettersi, ILettacei and ILettingsi. The B#b character matches to any character for one position only. For instance B*INFO F##Db would match to IFoodi, IFindi, IFordi or IFredi. It would not match to IFindsi, IFlyi or IFeedingi. DAccess codesd Files and directories have associated with them an access code which descibes what operations can be done on them. These are: D - Directory. This is a directory which may contain more files and directories. R - Read. If this letter is present, the file can be read using LOAD or OPENIN, or can be run using B*RUNb or B*nameb. W - Write. If this letter is absent, the file cannot be written to with OPENOUT. The file can however be overwritten with SAVE. L - Locked. A locked file cannot be deleted or renamed and cannot be overwritten with SAVE. Directories are locked by default. E - Execute. If this option is present, the file can only be run as machine code with B*nameb, B*/nameb or B*RUNb. If the Execute option is set, the Read option is masked out. P - Private. This can make an entry invisible to a user that does not own the directory. By default, the whole disk is owned. Each file has two sets of access codes. The ones to the left of the '/' are the owner's access code, the ones to the right are the public's access codes. In general use, you will only need to be concerned with the owner codes as the entire disk is owned by you. See Chapter 8 for more information. The B*ACCESSb comand allows a file's access code to be changed: B*ACCESS DATA LWRb Allows the file to be read and written with OPEN, but cannot be renamed, deleted or overwritten with SAVE. B*ACCESS PROG WR/Rb Allows the file to be read by anyone, but can be written to with OPEN only by its owner. It can be deleted, overwritten or renamed (only by its owner). The default attributes are BWR/wrb for a file and BLb for a directory. DDeleting, renaming and copyingd When a file is no longer needed, it can be deleted from the disk. This releases the space it used for use by other files. The B*DELETEb command removes a single named entry from a directory; the filename must not have any wildcards in it. For example: B*DELETE Rubbishb You cannot delete a file which has been locked with the 'BLb' access code. To successfully delete such a file, the access must be removed, eg: B*ACCESS datab B*DELETE datab Directories are created locked, and they must also be empty when you delete them. Being able to rename files is very useful, as it can be used not only to change the name of a file, but to move it around the directory structure. The B*RENAMEb command is followed by the old filename, and then the new filename. The command B*RENAME old newb will change the file Ioldi to have the name Inewi. Furthermore, the command B*RENAME test $.Programs.testb actually moves the file Itesti from the CSD to the directory I$.Programsi. You can also change the name of a file while moving it, so B*RENAME OldFile ^.NewFileb will move IOldFilei into the directory above the CSD, and change its name to INewFilei. Directories as well as files can be renamed like this. You cannot use wildcards in the newname part of a B*RENAMEb command and you cannot rename a directory into a subdirectory of itself. The B*COPYb command makes a copy of a file whilst retaining the original. The command is followed by the source filename, and the the destination filename. An example would be: B*COPY ThisFile $.Data.ThatFileb B*COPYb uses as much unused shadow memory as possible to transfer the file and avoids using the program memory. If you want to copy lots of files, or copy files between different disks in the same drive or between different filing systems, the ITreeCopyi program should be used, see Chapter 5. In current versions of HADFS, the B*COPYb command is a transient command in the system ILibraryi directory. DFile and disk informationd HADFS knows more things about each file that is shown in the display given by B*CATb. The B*INFOb command displays this extra information. The result of a B*INFOb command might look like this: BChapter1 FFFFFF00 FFFFFFFF 001B78 WR/WR 28/12/1993 00078Bb The numbers shown are the load address, the execution address and the length, then the access code, date and sector address. There is also a command B*EXb which does a B*INFOb on all the entries in the specified directory. A special instance of the B*INFOb command will get information on the disk. Using B*INFO $b could give a display like: BDrive 0: Letters 03/04/1992 Size: 400K ID: 984F Datab It shows the title of the disk, the date it was created and its size, its disk ID number and whether it is a Data disk or System disk. If it is a system disk, it shows the version of HADFS installed on it. Disks have only a finite amount of space on them. To find out how much space is available, the B*FREEb command is used. A typical display would be: B>*FREE 0001A4 Sectors = 107,520 bytes free 00049C Sectors = 302,808 bytes usedb The first hexadecimal figures are the number of sectors free or used, the decimal number is the space in bytes. DFormatting disksd Before a new disk can be used, it must be formatted. Blank disks are like a blank piece of paper, formatting it is like drawing lines on it. Note that formatting completely erases everything that may be on a disk, so if you accidently format a disk that already has information on it, there is no way to recover its contents. To format an HADFS disk, you use the B*FORMb command, followed by the number of tracks. The most common size is double-sided 80 tracks, making 160 tracks in total, so you would use: B*FORM160 0b to format the disk in drive 0. Before formatting, you are asked to confirm the operation: BFormat drive 0 Go? (Y/N)b You must respond by pressing BYb. Anything else will abort the process. Once a disk has been formatted, it can be used immediately. Freshly formatted disks are Data disks with the title '(Untitled)'. This can be changed using B*TITLEb or B*INSTALLb. If you want the disk to be a system disk, you must copy the IHADFSROMi file into the root directory, or use B*INSTALLb, for example: B*INSTALL 0 $ NewDisk 400Kb This installs the system files onto the disk in drive 0, setting its title to 'NewDisk'. Non-floppy disks, such as hard drives and RAM disks, usually do not need formatting or will be supplied with a program to format them. You then just need to initialise the drive with the B*INSTALLb command. For instance, to install HADFS on a 16M hard disk in drive 4, use: B*INSTALL 4 $ IDEDisk4 16384Kb DAutostartd Sometimes it is useful to make a program automatically start when you first use a disk. This can be done using a file called I!Booti and the B*OPT4b command. This file can be in any directory, but the most common place for it is in the B$b directory. When you log on to a directory using B*I AMb, then the boot option set with B*OPT4b is looked at and the I!Booti file is loaded, run or executed. Pressing Shift-Break is the same as doing B*I AM BOOTb If there is no I$.BOOTi directory, then the I$i directory is logged into. Doing B*I AMb is similar to doing B*MOUNT b then B*DIR b. DChanging disksd An important fact to realise is that HADFS stores some disk information in memory, and that information will stay there even if the disk is removed from the drive. For example, if you take a disk out, and put a different one in the same drive and try to do B*CATb you will get a listing from the previous disk. If you try to write or save anything, or select another directory, a BDisk changedb error will occur. You have to inform the computer that you have changed the disk. You do this using B*BYEb and B*MOUNTb. B*BYEb closes all open files, and then goes into a 'dismounted' state. After using B*BYEb, all disks can be removed and replaced. B*MOUNTb forgets all information, and selects a new drive. If no parameter is given, then the default drive (usually drive 0) is selected. If a drive parameter is given, then that drive is selected. B*BYEb is the same as B*CLOSEb followed by B*MOUNTb. DSpecial charactersd B$b means 'root directory' and points to the top of the directory tree. B^b means 'parent directory' and points to the directory that is the parent of the current one. The parent of the I$i directory is I$i. B%b means 'library directory' and points to the directory set with B*LIBb or the one selected after doing B*MOUNTb, B*BYEb or B*I AMb. B@b means 'current directory', the one selected with B*DIRb. If a command needs a directory and you need to select the CSD, you use this, eg using B*LIB @b makes the library directory the same as the currently selected directory. B:b means 'drive', and is followed by a drive number. Drive numbers can be from 0 to 9, and A to V. DCommands on other systemsd MSDOS disks have a similar directory structure, but the commands to move around it are slightly different. In summary: Operation: BBC MSDOS Show this directory: B*CATb or B*CAT @b BDIRb or BDIR .b Move down a directory: B*DIRb Inamei BCDb Inamei Move up a directory: B*DIR ^ CD ..b Move to another drive: B*DIR :bIdi BCD bIdiB:b To change a disk: B*MOUNTb or B*MOUNTb Idi -C TEXTCOMMANDDAQ3 Filing systemq Qcommandsq   HADFS provides a variety of commands used to access HADFS disks. The following pages describe these commands. They are all B*b commands, and so must be at the end of a program line, or accessed using OSCLI from BASIC. Some of the commands are provided by HADFS as filing system commands, some of them are provided by HADFS as general utility commands, and some are provided by the MOS, which communicates with the HADFS filing system to implement them. There are also some commands that are in DFS on BBC Bs and in the MOS in Masters. There are also transient commands which are loaded from disk to run them. The commands are labelled as EFilinge, EUtilitye, EMOSe, ETransiente or EDFS/MOSe. All HADFS commands can be prefixed with BHb to prevent clashes. Commands can be prefixed with B\b to pass it to the filing system only. They will not be searched for on the disk or passed to other ROMs if they are not matched. This is the same as with SJ Fileservers. HADFS commands can be terminated by any non-letter, so B*DIR $b is the same as B*DIR$b, but B*DIR FREDb cannot be shorted to B*DIRFREDb, this would look for a command file IDIRFREDi. DCommand Syntaxd The syntax abbeviations used in these descriptions, and in B*HELPb messages are as follows: ambiguous file. A filename or directory name that can include the wildcard characters B#b and B*b. file specifier. A filename or directory name that does not include the wildcard characters B#b and B*b. source filename/dirname/drive. destination filename/dirname/drive. a directory. a user number. a drive number. If a syntax abbreviation appears in brackets, this indicates that it is optional. DFilenames and pathnamesd Filenames can consist of one to ten alphanumeric characters, containing no spaces, and none of the following special characters which are reserved and cannot be used in filenames: B"b, B#b, B$b, B%b, B&b, B^b, B:b, B*b, B.b and B@b. The following characters are valid in filenames and will be valid in future versions: BAb-BZb, Bab-Bzb, B0b-B9b, B!b, B_b, B(b, B)b, B?b, B+b, B-b. Any other characters not specifically mentioned in this list may in future not be recognised. Pathnames consist of one or more filenames separated by B.b, optionally including the following absolute directory reference characters: B$b root directory, and disk prefix. Identical to B:b. B:b root directory, and disk prefix. Identical to B$b. B%b library directory (LIB). B&b user root directory (URD). B@b currently selected directory (CSD). B^b parent directory. So the pathname B%.FREDDYb refers to the file IFREDDYi in the library directory, and B:1.HELLOb or B$1.HELLOb refers to the file IHELLOi in the root directory of drive 1. The B$b and B:b can be used interchangably. The following wildcard characters are used: B#b matches any one character B*b maches any characters D*ACCESS Filingd This command changes the access string on a file, eg B*ACCESS MATHS WR/Rb Each letter in the access string refers to a different type of access allowed to the file: BLb - Locked => The file cannot be deleted or overwritten or renamed. BWb - Write => The file can be written to using random access. BRb - Read => The file can be read with LOAD, RUN or random access. BPb - Private => The file cannot be seen by non-owners. BEb - Execute => The file can be executed with B*b, B*/b or B*RUNb. When you use this option, the read and write options are disabled to make the file a run-only file. Setting the BRb option allows you the same access as the BEb option, but does not make the file run-only. The B/b character separates the owner's access (on the left) from the public access (on the right). You are the owner of a file if you own the directory that it is in. When a disk is B*INSTALLbed or B*FORMbatted, you own the whole disk. Ownership is changed using the B*ACCOUNTb command, and allows you to segregate files and simulate an network server environment using local disk drives. Saving a file on top of an existing file does not change the file's access setting. D*ACCOUNT () Filingd This sets the hexadecimal account number of an entry. On small disks only the ownership of directories can be set. If a file is specified it is ignored, and any auxiliarly account number is ignored. With large disks the account numbers of both files and directories can be set. When a disk is B*MOUNTbed, your account number is reset to 0, so to own any objects in directories that have had the account number changed, you must log into them using B*I AMb. D*BACKUP Programd B*BACKUPb makes an identical copy of a disk. It is implemented as a transient program and is described in Chapter 5. D*BUILD DFS/MOSd B*BUILDb opens a new file with the specified name and all subsequent lines of keyboard input are directed to the file. Input is terminated by pressing Escape. D*BYE Filingd This closes any open files and dismounts all the disks. You should always use this (or B*MOUNTb) before changing a disk. D*CAT () MOSd The B*CATb command provides a list (catalogue) of the files in the selected directory. The files are currently not listed in alphabetical order, but it is intended that they will be in the future. The top three lines contain information about the directory being catalogued. With the example below, the first line shows that the directory being catalogued is called BPROGRAMSb and the disk it is on is called BMyDiskOneb. The CSD is the root (B$b) and the library directory is called BLibraryb. B PROGRAMS (33) Owner 000 MyDiskOne Option 0 (Off) Dir. $ Lib. Library MATHS WR/R GAMES DL/ STARTUP LR/R START2 R/Eb D*CDIR Filingd This command creates a subdirectory. If the specified subdirectory already exists, then the command returns with no errors. If a file already exists with the same name then a BFile existsb error will be generated. The created directory has its access locked. D*CLOSE MOS/Utild This closes all open files and ensures any data in buffers is written to disk. It is identical to using BCLOSE#0b from BASIC. D*COMPACT () Programd This compacts a disk creating larger areas of free space. It is implemented as a transient program and is described in Chapter 5. D*COPY Filing/Transientd On the Master series, this command is supplied in the ROM using the MOS B*MOVEb command. On the BBC it is run from disk as a library command. It copies a specified file, creating another copy, leaving the original intact, eg: B*COPY Prog1 $.Fred.OldProg1b The B*MOVEb-based version uses only the private MOS memory, including any unused shadow screen memory, so the user program area is untouched. The disk-based version uses the HADFS buffers and the CFS and soft key buffers at &900 to &CFF in the I/O processor, so again the user program area is untouched. Later versions of the command will use spare shadow memory to speed up the operations. For copying multiple files and to other filing systems, use the transient program ITreeCopyi instead. See Chapter 5. D*DELETE Filingd This simply deletes an entry from the directory, eg: B*DELETE FREDb If the file is locked, the error BFile lockedb is generated. If you try to delete a directory that has entries in it, the error BDir. not emptyb is generated. You can only delete files in directories that you own. D*DIR () Filingd This command allows you to move between directories, eg: B*DIR PROGRAMSb The example selects IPROGRAMSi to be the Currently Selected Directory (CSD). Doing B*DIRb with no name will reset the CSD to the User Root Directory (URD), this usually being B$b, or the directory selected with B*I AMb. The CSD can be refered to in pathnames with B@b, eg: B*RUN @.FREDb This would run the file IFREDi in the CSD. D*DISKS Transientd This command lists the names of all the disks present in all the available drives, and the amount of free space on them. A typical display would be: B >*Disks Drv Title Free Used :0 Documentation 1K 399K :1 HADFS_System 22K 378K :I Internal_Files 0K 28Kb D*DUMP DFS/MOSd This command displays a hexadecimal and ASCII dump of the named file, with eight bytes per line, preceeded by the displacement from the start of the file. Non-printable characters are displayed as a B.b character. D*ENABLE Filingd This command is used to enable the dangerous commands B*FORMb and B*INSTALLb with the B$b parameter. It should be given before the command is used, eg: B*ENABLE *FORM160 0b If a command is not enabled, then you are asked BGo? (Y/N)b and a keypress is waited for. Pressing anything other than BYb or Byb will result in the command being abandoned, and a BNot Enabledb error being generated. D*EX () Filing/MOSd This command is similar to doing a B*INFOb on all the files in the directory. If no directory is given, the CSD is listed. An example would be: B>*EX $ (69) Owner 000 MyDiskOne Option 0 (Off) Dir. $ Lib. $ !ReadMe 67542742 26533684 002DAD WR/R 08/10/1989 00004A Manual1 65524372 38573523 001029 WR/R 08/10/1989 000078 COMPACT FFFF1900 FFFF8023 00055E LWR/R 17/10/1989 0000A2 COPYFILES FFFF1900 FFFF8023 000652 LWR/ 18/10/1989 0000A8b D*EXEC () MOSd This command reads the specified file in byte by byte as if it were being typed in at the keyboard. This is usually used with B*OPT4,3b to B*EXECb a !Boot file. If a file's execution address is &FFFFFFFF or the load address if &FFFFFFxx, then attempting to do B*RUN b will do B*EXEC b instead. B*EXECb without a filename closes any open B*EXECb file. D*FILES Utild B*Filesb lists the information on all the currently open files. The display shows each channel's object information, sector start, current pointer, extent, directory sector, disk ID number and allocated space. The object information will be either *CLOSED* or start IN, OT or UP for OPENIN, OPENOUT or OPENUP. The next six bits are the EOF flag, Directory, Write attribute, Read attribute, Output buffer modified, Input buffer present. An example display would be: B>*Files 25 OT..WROI 00:0004E5 PTR=0000002A EXT=00000037 Dir:00004A ID:D951 Alloc=000040 26 IN.D.... 01:000047 PTR=00000000 EXT=00000300 Dir:000047 ID:F01D Alloc=000003 27 UPE.WROI 00:000285 PTR=0000023B EXT=0000023B Dir:0000D3 ID:D951 Alloc=000003 28 *CLOSED* 00:000000 PTR=00000000 EXT=00000000 Dir:000000 ID:0000 Alloc=000000 29 *CLOSED* 00:000000 PTR=00000000 EXT=00000000 Dir:000000 ID:0000 Alloc=000000b D*FORMnn Utild This command, which needs to be B*ENABLEdb, will format a disk in drive 0 or 1. The number of tracks is specified by nn, this can be from 1 to 255, though sensible values would be 40, 80 and 160. The formatted disk is a blank data disk with the title B(Untitled)b. The command can be used without HADFS selected, and if so, the drive parameter can be 0 to 3 which will create a blank DFS disk. As an example, B*FORM160 0b will format a double-sided 80 track disk. Many disks and disk drives can actually access about 82 tracks, so you could use B*FORM164 0b to format a double-sided 82 track disk. D*FREE () Filingd This displays the free space available on the disk, or the disk the CSD is on if no drive is given. An example would be: B>*FREE 000193 Sectors = 103,168 bytes free 0004AD Sectors = 306,432 bytes usedb D*HADFS Utild This command selects the HADFS. Once selected, HADFS becomes the current filing system and all filing operations are directed to it. HADFS can also be used as a temporary filing system using the prefix B-HADFS-b. D*HELP MOSd Displays list of helpful information. HADFS responds to B*HELP HADFSb to list the HADFS Filing commands and B*HELP UTILSb to list the HADFS utility commands. D*I AM Filingd This command is used to log on to a specified directory on a disk. An example would be: B*I AM PROGRAMSb which would set the User Root Directory and the CSD to I$.PROGRAMSi on the default user drive, normally drive 0. A directory I$.Libraryi is looked for on the default library drive and the logged on drive if different, and if found, the library directory is set to it. The autostart command is then executed (see B*OPT 4b). A drive other than the default user drive may be logged on by prefixing with a drive identifier, and subdirectories can be logged on to, eg: B*I AM :1.WORK.SHEETSb would log into the directory IWORK.SHEETSi on drive 1, and look for a library directory on drive 1 and then the default library drive. If the specified directory cannot be found, then B$b on the default user drive is logged into instead. D*INFO Filingd This displays the file information for a particular file, eg: B*INFO MATHSb produces a string of information about the file IMATHSi. The format is: For example, the above command may produce the following output: B MATHS FFFF1900 FFFF8023 000734 WR/R 22/05/1988 000092b When you do a B*INFOb on the root directory, you are given information on that drive, eg: B Drive 0: WordProcessing 06/02/1991 Size: 400K ID: 7632 HADFS 0.44b This gives the disk title, the date is was created, its size and ID code, and what version of the HADFS ROM is installed on it. D*INSTALL () ($) () (D) () Filingd This very important command creates an HADFS disk, installing on it the required DFS files to partition it and setting up the root directory (I$i). B*INSTALLb can be used on disks that already have HADFS installed on them to install the current version of the software, or to change the disk name. If the B$b parameter is given, then a new root directory is created, effectively deleting everything on the disk. You must give the drive number and a name when using the B$b parameter. Also, the command must first be B*ENABLEbd. The disk must already be formatted as an HADFS or DFS disk, either 40 or 80 track, single or double sided. You can do this with the B*FORMb command, which will create a blank HADFS Data disk. HADFS works best with 80 track double sided disks, but you can specify other size disks with the Bb parameter in either number of tracks or number of sectors. Using the BDb prefix will create a data-only disk by leaving off the DFS installation files. The Bb parameter can be one of the following: Bb number of tracks, eg 160 for 80 track double sided. BKb size in K, eg 400K. B&b the total number of sectors, eg &640 All of the above examples give a size parameter for a standard 80 track double-sided HADFS disk. If the size is followed by B*2b, then the disk is a split disk, that is, a disk with less than 80 tracks on one side. An example of this is a 40 track double-sided disk. This would be B*INSTALLbed with B40*2b as the size parameter. If no size parameter is given, then a size is looked for on the disk. If there is no size already on the disk, ie it has never been B*INSTALLbed before, a BBad numberb error will be generated. Using the BDb prefix can only be used when creating a blank disk. As an example, B*INSTALL 0 $ DataDisk D 40b would install a 40 track disk as a 98.5K HADFS data disk. If you use the command B*INSTALL ?b a brief reminder of the size parameters is displayed. The Bb can be one to sixteen characters long, but should be at least two characters and should start with a letter to distinguish it from a drive number. D*LIB () Filingd This sets the library directory to the directory given. The library directory is where machine code command files are searched for if they cannot be found in the current directory with B*b and B*/b. The search path followed to find a file to run is shown below. If a file is found, it is loaded and executed, else the search path is followed onwards towards the end. So B*KEYb is matched as the MOS command to reprogram a function key, B*/KEYb bypasses the MOS and is sent to HADFS to search for a general command file, and B*RUN KEYb would look for a machine code file in the current directory only. After a B*MOUNTb, the LIB is set to I$.Libraryi on the mounted disk if it exists, or to I$i if it doesn't. Search path used to run files B*\bname B*bcommand B*/bname B*RUNb name | | | | | MOS looks in MOS rom | | | | | | | V | | | Look at sideways rom | | | commands | | | | | | V V | | Look at filing system | | commands | | | | | | | \-----------\ | | | | | | | V V V | HADFS looks in CSD HADFS looks in CSD | | | | V | | Yes Does filename include | | /------ B$b, B%b, B&b, B@b or B:b | | | | | | | | No | V V V V | | HADFS looks in LIB | \------\| | | | | | V V V | Master computers check | | LIBFS | | | | \-----------\ | | V V V BBad commandb error BFile not foundb error D*LIST DFS/MOSd This command displays the contents of the named file on the screen, with each line of text preceeded with a line number, starting at line 1. D*LOAD () MOSd This loads the named file into the computer's memory, starting either at the specified address, or at the file's own load address if no loading address is specified. If the high byte of the load address is &FF, ie addr=&FFxxxxxx, then the file is loaded into I/O memory. If the high byte is not &FF, then the file is loaded into language memory. If there is shadow screen memory available and the load address is &FFFDxxxx, then the file is loaded into the shadow memory, regardless of which memory is being used to display the screen. If the load address is &FFFExxxx, then the file is loaded into whichever memory is currently displaying the screen. If the load address is &FFFFxxxx, or there is no shadow screen, then the file is loaded into normal I/O memory. D*MAP () Filingd This displays the free space map for the selected drive, or the drive of the CSD, if none is given. D*MOUNT () Filingd This abandons any open files and dismounts all the disks preparatary to inserting a new disk. You should always use this command, or B*BYEb, before changing a disk, as directory information is kept in memory to speed up disk accesses. If no drive parameter is given then the default drive, usually drive 0, is mounted. After a B*MOUNTb, the CSD and URD are set to I$i on the mounted drive, and LIB is set to I$.Libraryi if it exists on the mounted drive, or I$i if is doesn't. D*OPT ( ()) MOSd This is used to set various file options. These are: B*OPT 0b - This resets OPT 1,2,3,6 and 7 to their default values. B*OPT 1b - Sets level of file information messages given on LOAD and SAVE commands: B*OPT 1,0b gives no messages (default) B*OPT 1,1b gives detailed messages B*OPT 2b - Sets the filing system number returned by OSARGS 0,0. With this you can make HADFS pretend to be a different filing system, eg setting B*OPT 2,5b will make it be recognised as NFS. Default is 16, and you cannot set to 4, as that is the value of DFS. B*OPT 3b - Sets the auxilary filing system recognition number. A filing system can be selected with service call &12, and HADFS recognises the OSARGS 0,0 number set with B*OPT 2b and the number set with this call. B*OPT 4b - This sets the autostart action as follows: B*OPT 4,0b ignores B!BOOTb B*OPT 4,1b B*LOADbs B!BOOTb B*OPT 4,2b B*RUNbs B!BOOTb B*OPT 4,3b B*EXECbs B!BOOTb B*OPT 5b - set the maximum number of channels used. Default 5. B*OPT 6/7b - set drive to use internal or external drivers: B*OPT 6,db drive d uses internal drivers B*OPT 7,db drive d uses external drivers After B*HADFSb, B*MOUNTb or B*BYEb the first access to a drive numbered 0 to 7 first tries to use an external driver with OSWORD 90. If no external driver is found for that drive a flag is set to use internal drivers for that drive. Using B*OPT 7b can force a particular drive to always use external drivers, giving the BDrive x not presentb error if there is no driver. B*OPT 6b returns to allowing internal drivers to be used. The setting for drive 1 is saved in CMOS on the Master and can be set with keyboard links on the BBC B. D*RENAME Filingd This command renames an entry to give it a new name. If the entry is locked, or the new name already exists, you will get a BFile lockedb or BFile existsb error. You cannot rename across disks, and you cannot rename the root I$i directory. If you try to rename a directory inside itself or a subdirectory, you get a BCircular renameb error. D*RUN () MOSd This command is used to load and run machine code programs. It loads a file into memory, and then jumps to its execution address, unless it is &FFFFFFFF or the load address is &FFFFFFxx when the file is B*EXECbed instead. If the file's load address and execution address disagree about which memory the file should run in, (ie, the top byte of the addresses should both be &FF or they should both be not &FF), then the error BI cannot run this codeb will be generated. Using B*b or B*/b is the same as B*RUNb, except that the library directory is also searched. See B*LIBb for more information. D*SAVE |+ ( ()) MOSd This command takes a copy of the specified section of memory and writes it to a file with the given name. If the execution or reload addresses are not given, then they are set to be the same as the start address. If the start address's high byte is not &FF, ie start<>&FFxxxxxx, then language processor memory is saved. With a machine with no second processor, this will be that same as I/O processor memory. If the start address's high byte is &FF, is start=&FFxxxxxx, then I/O processor memory is saved. If shadow screen memory is available, then a start address of &FFFDxxxx will save the shadow memory, regardless of whether is is being displayed or not. A start address of &FFFExxxx will save the memory currently being displayed, and a start address of &FFFFxxxx will always save the normal I/O memory, whether it is being used to display the screen or not. D*SETLOAD Utild B*SETLOADb sets the specified file's load address to the supplied hexadecimal address. D*SETEXEC Utild B*SETEXECb sets the specified file's execution address to the supplied hexadecimal address. D*SETTYPE Utild B*SETTYPEb sets the specified file's load and execution addresses to the RISC OS-compatible filetype. The load address is set to &FFFxxx00 with xxx being the supplied value. D*SETDATE (dd/mm/yy (d)) Utild When files are created, they are date-stamped. On Master computers, the date for this is fetched from the on-board Real Time Clock. The pre-Master BBCs, however, do not have this feature, and so using this command simulates the date part of it. After using the B*SETDATEb command, you can read the date using the OSWORD 14 call, as on the Master. If there is an on-board Real Time Clock, this will take precedence to the date set with B*SETDATEb as long as the code to access it is in a higher priority ROM than the HADFS. The optional parameter Bdb can specify the day of the week 1 to 7 for Sun to Sat. Using B*SETDATEb with no date disables the function. D*SHUT MOS/Filingd B*SHUTb is similar to B*CLOSEb in that is closes all open files. On Master series computers it closes all open files on all filing systems, leaving the current filing system selected. D*SPOOL () MOSd This command opens a file with the specified name to recieve all the information subsequently displayed on the screen. It is the opposite of the B*EXECb command. B*SPOOLb with no parameter closes any opened spool file. D*STAMP Transientd Sets the date attribute on the specified object to the current date. D*STATUS HADFS MOSd This displays HADFS's current configuration status, that is, the number of channels, which drives are using external drivers, and the current time and date setting. On the Master series, the settings are saved in CMOS RAM. On the B/B+, the settings are forgotten after power-off, except for the drive 1 status which is defined by keyboard link 2. D*TIME MOSd This command produces a standard display containing the day, date and time, if set. On Master computers, the time will be read from the Real Time Clock. If no RTC is present, then the date can be set with B*SETDATEb, and the time can be set with BTIME=((minutes*60)+hours)*60*100b. The format of the display is DDD,dd mmm yyyy.hh:mm:ss, ie Day, date, month, year, hours, minutes, seconds. D*TITLE () Filingd This will change the disk title on the currently selected or the specified drive. The title can be one to sixteen characters long, but should be at least two characters long, and should start with a letter. In some versions of HADFS, the B*TITLEb command is an alias for the B*INSTALLb command, and will accept B*INSTALLb parameters. D*TYPE <afps> DFS/MOSd This command displays the contents of the named file, as with B*LISTb, except that no line numbers are generated. Q4 Low level fileq Qentry pointsq   This chapter details the filing system entry points as well as some OSWORD and OSBYTE calls provided by HADFS. DOSFILEd DEntry address: &FFDD File and directory informationd On entry: A function code On exit: A object type XY pointer to control block XY preserved control block updated Control block: &00 Address of filename &02 Load address &06 Execution address &0A Length, or start address for SAVE &0E Attributes, or end address for SAVE, or start sector for &FD &12 Functions: &FD Read an object's extra catalogue information into the control block. The load field returns the account numbers, main account in XY+2,3 and auxillary account in XY+4,5. The contents of the execution field is currently undefined. The length field returns the length. The attributes field returns holding the start sector and drive of the object. A is returned holding the object type. &FE Verify a file. Unsupported, returns A=&FE. &FF Load a file into memory. If the low byte of the execution address is zero, it loads to the supplied load address, else it loads to the file's own load address. If the filename does not exist, or is a directory, or an execute-only file, or does not have read access, then an error is generated. &00 Save a file. If a file already exists with the same name, it is overwritten. If the file is locked, or a directory exists with the same name, then an error is generated. &01 Write a file's reload address, execution address and attributes. &02 Write a file's reload address. &03 Write a file's execution address. &04 Write a file's attributes. &05 Read object's catalogue information into the control block. &06 Delete object. If the object does not exist, A returned as &00. If the object is locked, or is not owned, then an error is generated. &07 Create an empty file of defined length. Block as for SAVE. &08 Create a directory. If a directory already exists, there is no error. If a file already exists, an error is generated. &09 Object types returned in the A register are: &FF Execute-only file &00 Object not found &01 File found &02 Directory found, the length field holds the amount of disk space that the directory's catalogue takes up. When reading information on I$i, then A returns 0 if the specified drive does not exist, or 2 if it does exist. The disk size in bytes is returned at XY+2, the disk ID at XY+6,7 and the disk flags at XY+8,9. The date the disk was created is returned in the date field of the attributes. File attributes are returned in four bytes as follows: Byte &0E bit 7 Private 6 Execute only by others 5 Writable by others 4 Readable by others 3 Locked 2 Execute only for owner 1 Writable by owner 0 Readable by owner Byte &0F bits 0-4 Date: day of month 5-7 Date: years since 1981, bits 4-6 Byte &10 bits 0-3 Date: month of year 4-7 Date: years since 1981, bits 0-3 Byte &11 bits 0-3 Undefined (zero) 4-7 Undefined (zero) All the calls update the control block with the catalogue information and return the object type in A. If a call is unsupported, then A is returned preserved. DOSARGSd DEntry address: &FFDA Attribute of open objectd On entry: A function code On exit: A usually preserved X points to zero page location X preserved Y file handle or 0 Y preserved Functions: Y=0 &FD Return HADFS version*100 in A and version and capability flags in zero page. The flags show what code is available in the HADFS ROM: zp+0, b0: *COPY in ROM b4: Date provided b1: Passwords used b5: Full INSTALL b2: *COMPACT/*BACKUP in ROM b6: Fast OSGBPB b3: Time provided b7: Random access output zp+1: b0: Scattered workspace b4: Mouse driver provided b1: New workspace b5: Only small disks supported b2: - b6: Hard disk supported b3: - b7: FRED/JIM ramdisk supported zp+2: version number x of x.yy zp+3: BCD version number yy of x.yy &FE Return last drive used to zero page. &FF Update all files to media, zero page ignored. &00 Return filing system number in A, zero page ignored: 0 No current filing system 12 Ram filing system 1 1200 baud cassette 13 2 300 baud cassette 14 3 ROM filing system 15 4 Disk filing system 16 Harston ADFS 5 Econet filing system 17 6 Teletext/Prestel telesoftware 7 IEEE filing system 29 DOS filing system 8 Acorn ADFS 45 Nexus filing system 9 Host filing system 71 BeebItFS 10 Videodisk filing system 92 LinkFS 11 Coprocessor filing system The filing system number in HADFS can be changed using B*OPT 2b to any value between 5 and 16. &01 Return address of any parameters after a filename to zero page. &02 Return version number in A, zero page ignored. &03 Return libfs number in A, zero page ignored. &04 Read disk space used to zero page. &05 Read disk free space to zero page. &06 Y<>0 &80 Read information about an open file to zero page (unimplemented). &FD Read/write system parameters to zero page. Y=&04..&0D reads the values and Y=&84..&8D writes the values: Y=&05/&85 USERNUM Y=&06/&86 CURR - current directory in memory Y=&07/&87 reserved Y=&08/&88 CSD - Currently Selected Directory disk address Y=&09/&89 LIB - Current library disk address Y=&0A/&8A URD - User Root Directory disk address Only CURR, CSD, LIB and URD are guaranteed to be valid. All other values are liable to change from version to version. &FE Unsupported, zero page ignored. &FF Update file on channel Y to media, zero page ignored. &00 Read PTR for channel Y to zero page. &01 Write PTR for channel Y from zero page. If the PTR is moved past the end of the file, the file is extended with zerosS*s and zero is returned in A. &02 Read EXT for channel Y to zero page. &03 Write EXT for channel Y from zero page. If the length of the file is reduced, the end disappears. If the length is increased, the file is extendedS*s as with &01 and zero is returned in A. &04 Read size allocated to file on channel Y to zero page. &05 Read EOF status of file on channel Y. If PTR=EXT then zero page is set to -1, else zero page is set to 0. &06 Ensure file size of file on channel Y of at least the value in zero page. Actual size allocated is returned in zero page. Where zero page is ignored X is ignored and so can be left set to anything on entry. S*sCurrently, extending a file does not pad it with zeros. The extra length of file will contain whatever was originally on the disk. DOSBGETd DEntry address: &FFD7 Read (get) a byted On entry: Y channel number On exit: A byte read Y preserved Cy EOF status. If the byte read is after the end of file, the carry flag is set on exit. After the EOF byte has been read, the next read produces an error. DOSBPUTd DEntry address: &FFD4 Write (put) a byted On entry: A byte to be written On exit: All preserved Y channel number DOSGBPBd DEntry address: &FFD1 Read or write multiple bytesd On entry: A function code On exit: A 0 if call supported XY pointer to control block <>0 if unsupported XY preserved control block updated Control block: &00 Channel number/cycle number &01 Data address &05 Number of bytes/filenames to transfer &09 PTR for transfer/directory pointer &0D Functions: &01 Write bytes to media using new PTR &02 Write bytes to media ignoring new PTR &03 Read bytes from media using new PTR &04 Read bytes from media ignoring new PTR On exit from calls &01 to &04 the 'number of bytes' field holds the number of bytes not transfered. The 'data address' field is updated to point to the next location for data transfer. The PTR for the file is updated by the number of bytes transfered and placed in the 'PTR' field. In functions &01 and &03 the PTR is first set to the supplied value before transfering data. The carry flag is returned set if EOF was met. The EOF-error-flag is reset. &05 Get media title of CSD disk and boot option into data block: &00 length of title (n) &01 title in ASCII characters &01+n startup option &02+n drive number &03+n &06 Get currently selected directory name into data block: &00 length of drive identity (n) &01 ASCII drive identity (drive number) &01+n length of directory name (m) &02+n directory name in ASCII characters &02+n+m ownership: &00 - owner, &FF - public &03+n+m &07 Get current library name into data block: &00 length of drive identity (n) &01 ASCII drive identity (drive number) &01+n length of library name (m) &02+n library name in ASCII characters &02+n+m ownership: &00 - owner, &FF - public &03+n+m &08 Read filenames from current directory into data block: &00 length of filename 1 (n) &01 filename 1 in ASCII characters &01+n length of filename 2 (m) &02+n filename 2 in ASCII characters &02+n+m etc... The first call to function &08 should be made with the directory pointer set to zero. This will read the first filename, and the pointer will be updated so that the next call will read the next filename. On exit, the 'number of filenames' field holds the number of filenames EInotie returned. When no filenames are left, the call returns with the 'number of filenames' left unchanged and the carry flag set. &09 Reads work/login filename or entries from specified directory. If XY+0 is zero, reads command line parameters after a BASIC bootstrap: &00 length of text string (n) &01 Any command line parameters &02+n If XY+0 is a channel number of an open directory, reads a null- terminated list of directory entries. The function is called as for OSGBPB 8, but XY+5 returns the number of filenames read. &0A Read entries and information from the opened directory whose channel number is in XY+0 or the CSD if XY+0 contains zero. This function is called as for OSGBPB 8, but XY+5 returns the number of filenames read. Each record is a whole multiple of four bytes long: &00 Load address &04 Execution address &08 Length &0C Attributes &10 Object type (1=file, 2=directory) &14 Object name, null terminated xxx next record &0B Read entries and information from the opened directory whose channel number is in XY+0 or the CSD if XY+0 contains zero. This function is called as for OSGBPB 8, but XY+5 returns the number of filenames read. Each record is a whole multiple of four bytes long: &00 Load address &04 Execution address &08 Length &0C Attributes &10 Object type (1=file, 2=directory) &14 Sector start address &18 Five zeros (reserved for centisecond time since 1900) &1D Object name, null terminated xxx next record &0C Note: Calls with A=&09, &0A, &0B are only available from version 0.49 onwards. DOSFINDd DEntry address: &FFCE Open or close a filed On entry: A function code On exit: A channel number, or Y channel number for A=0 or 0 if no file opened XY pointer to filename XY preseved If function not supported, A is returned as zero. Functions: &00 Close the file on channel in Y. If Y=0 then close all files. &4X Open file for input. If no file exists, A is returned as 0. &8X Open file for output. If file already exists, tries to delete it first. If no file exists, a file is created with load and execution addresses set to &FFFFFFFF. &CX Open file for update. If no file exists, A is returned as 0. The bottom four bits of A control how the file is opened: If b3 is set, returns an error if file not found, instead of zero handle. If b2 is set, error is generated if attempt to open a directory. File attributes determine how a file can be opened. Directories can be opened for input, but the open channel can only be used for reading information. Trying to do a BBGETb will close the channel and return an error. DFSCVd DVectored Filing system controld This vector is only called by the operating system, and should not be called directly. This list just shows the calls implemented in HADFS. Functions: &00 B*OPTb command. X and Y hold parameters &01 EOF being checked with OSBYTE &7F. On exit, X=&FF if EOF, X=&00 otherwise. &02 B*/b command. XY points to the command text. HADFS tries to run the command from the CSD or the LIB. &03 Unrecognised OSCLI. XY points to the command text. HADFS checks the command against its own commands, then tries to run it from disk as with function &02. &04 B*RUNb command. XY points to filename. HADFS tries to run this from the CSD only. &05 B*CATb command. XY points to any pathname. &06 A new filing system is about to take over. This call is generated by filing systems themselves before they start their initialisation. &07 File handle range request. Lowest returned in X, highest in Y. HADFS uses handles 25 to 29. &08 OSCLI command being processed. This is used to facilitate the B*ENABLEb command. &09 B*EXb command. XY points to any pathname. &0A B*INFOb command. XY points to the filename. &0B B*RUNb from library. Currently not implemented. &0C B*RENAMEb command. XY points to the filenames after the command. &0D DOSWORDd DEntry address: &FFF1 OSWORD functionsd On entry: A function code On exit: A,X,Y usually preserved XY pointer to control block HADFS provides two OSWORD functions, 14 (&0E) and 90 (&5A). &0E Read real-time clock If there is no on-board clock provided (such as in the Master), then the B*SETDATEb command can be used to set a date. This date is then used by HADFS to date-stamp files, and can be read using the standard RTC call. The time part can be set from BASIC using: BTIME=((hours*60+minutes)*60+seconds)*100b TIME is preserved over Ctrl-Break. There may be a few seconds discrepency depending on when the last ROM service call or HADFS filing system call was made. On entry: &00 &00 - read time and date string. On exit: &00 Time and date is returned in the format: Mon,25 Oct 1987.12:24:30 On entry: &00 &01 - read time and date in BCD format. On exit: &00 year (&00-&99) &01 month (&01-&12) &02 day of month (&01-&31) &03 day of week (&01-&07, Sun-Sat) &04 hours (&00-&23) &05 minutes (&00-&59) &06 seconds (&00-&59) A year value of >&80 implies a century number of &19, a year value of <&81 implies a century number of &20. On entry: &00 &02 - convert BCD time and date to string. &01 BCD time and date as for call &01. &08 On exit: &00 Time and date string as with &00. &5A Read/Write sectors This call allows you to read and write sectors of a disk in an internal or external drive. HADFS translates this call into the required low-level calls with OSWORD &7F or OSWORD 90. On entry: &00 &00 \ These two values &01 &06 / identify this call &02 Address &06 Sector start \ Sector &09 Drive number / address &0A Number of sectors &0B Call number, and returned result byte &0C The call numbers are: &80 read sectors &81 write sectors If the call was successful, then the return byte is zero. If not, then one of the following values is returned: &12 Drive read only &14 Track zero not found &18 Sector not found &FE Drive not present HADFS low-level calls also use OSWORD 90, using call numbers 1-7. DOSBYTEd DEntry address: &FFF4 OSBYTE functionsd On entry: A function code On exit: A preserved X,Y any parameters X,Y any returned values A=127 (&7F) - Read EOF status On entry: X=channel number On exit: X=0 if EOF has not been reached X<>0 if EOF has been reached A, Y preserved If PTR=EXT on the channel specified, then EOF is returned true. This call is used to provide BASIC's EOF# function. A=90 (&5A) - JGH sideways ROM service call OSBYTE 90 - General All the ROMs that I write conform to my ROM selection standard that allows interrogation of the roms in a uniform manner. This is the OSBYTE 90 call, used to enable and disable the rom, and to ask for status information about it. The arrangement of the OSBYTE 90 call is: On entry: A=90 X=ID number, or zero Y=call number On exit: A=90 X=b7-b6 rom status, b5-b0 other specific info. Y=other info. All ROMs respond to X=0, Y=0 on entry (B*FX90,0b or just B*FX90b) by displaying their ID number and their name, eg: B>*FX90 6: Harston ADFS 9: Z80 BASICb With X set to non-zero, it is a specific call to a particular ROM, with Y containing the call number. All ROMs respond to calls with Y=0 to enable the ROM, Y=1 to disable the ROM and Y=255 to request the ROM's status, eg: >B*FX90,9,1b will disable the ROM with program ID 9, ie Z80 BASIC. On return from calls 0, 1 and 255, the top two bits of X hold information about whether the ROM is present, and whether it is enabled or not. Bit 7 holds if the ROM is enabled or disabled, and bit 6 holds if the ROM is actually present of not. This is summarised as: X=11xxxxxx rom not present (X returned as &FF) X=10xxxxxx rom present, but disabled X=0yxxxxxx rom present and enabled If the ROM is enabled (ie bit 7 is zero), then it must also be present, so bit 6 is an implied zero. This allows bit 6 to be used to return information on other things. The other six bits of X can be used to return specific information about the ROM. The top two bits of X hold the status of the ROM before the call, so if the ROM is disabled, and you enable it with Y=0, then X will return %10xxxxxx. When calling from a second processor using the OSBYTE call, the Y register is ignored and zero is used instead for calls below OSBYTE &80. This means that if you use a call with Y=255 to read the status, and it returns saying that the ROM was disabled, the ROM will actually have been enabled, because Y=0 has been used instead. To get round this, use something like: BA%=90:X%=number:Y%=255:S%=(USR&FFF4 AND&FF00)DIV256 IF (S% AND &C0)=&80 THEN OSCLI "FX90,"+STR$(number)+",1"b This will redisable a ROM found to be actually disabled. Some of the program IDs that I have used so far are: 1: CharROM - Character set ROM 2: NewMOS 3: 4: 5: Games Auto Boot ROM 6: HADFS - Harston Advanced Disk Filing System 7: Z80 Emulator - Emulates a Z80 CPU 8: 9: Z80 BASIC - BBC BASIC(Z80) with BBC file i/o 10: 11: Dissem ROM - Various disassembly routines 12: 13: 14: 15: 16: NFS Front End If anyone else wants to adhere to this method for a ROM that they are writing, write to me, and I will assign you a number and give you the routine I use for service call 7 to provide the OSBYTE 90 call. OSBYTE 90 - In HADFS The HADFS ROM has program ID 6, and by default it is enabled. To disable it, you can use B*FX90,6,1b. The ROM will re-enable itself on a power-on reset or a memory-clear reset. The X register returns the following information: bit6: HADFS owns workspace from &E00 bit5,4: Number of channels - 2 bit3-0: Private workspace pointer - &14 The call values in Y used by HADFS are: Y=0 Enable ROM Y=1 Disable ROM Y=2 Enable ROM, select HADFS, and do B*I AM BOOTb Y=3 As Y=2, but without B*I AM BOOTb Y=4..Y=63 Unused HADFS calls Y=64 Look for default drive, return drive in X Y=65 Look for default library drive, return drive in X Y=66 Look for default user drive, return drive in X Y=67..Y=127 Unused external HADFS calls Y=128..Y=254 Unused HADFS calls Y=255 Return status Calls from 64 to 127 are only used from version 0.49 onwards Q5 The filing systemq Qutilitiesq   There are a number of utilities supplied on the HADFS System disk. Some of these are machine code and some are BASIC programs. Programs in subdirectories of the library directory can be run just like the main library programs. This allows you to group collections of similar commands together in subdirectories instead of creating an ever- lengthening library directory. If there is a file I%.Progs.RunMei then using B*Progs.RunMeb will call it. You have to bear in mind that some alphabetic sequences with a full stop directory separator may be interpreted as an abbreviation for a ROM-based command. For example, I*K.Progi will be matched as B*KEY Progb. The programs and utilities supplied on the system disk are as follows: Library: (HADFS utilities) BACKUP, COMPACT, Copy, Disks, Files Library: (File utilities) CLoad, CSave, ETree, FileInfo, Filer, PrList, Repeat, ScrLoad, ScrSave, SetLoad, SetExec, SetType, SrLoad, SrSave, Stamp, TreeCopy, TxSave Library: (General utilities) Break, Crunch, Disp, Explode, lp, lpS, MakeLP, MCode, MDump, MDump80, Mouse, pc8s, Repair, Roms, Scroll, Show, VList Utils: DMap, HDInit, HEdit, HUtils, Intern/s, MCat, Rescue, SetDate, VisCompact Extras: DemoArgs, DemoGbPb, Examine, Support/s, PrInfo, FredDisk/s, JimDisk/s, NFSFront, RSLink/s, Stats There may be more than the list given here. Any extra files and programs will be detailed in accompanying text files, and they will be mentioned in a I$.!ReadMei text file. The ILibraryi HADFS utilities are for using with HADFS. The ILibraryi file utilities can be used on any filing system for accessing or giving information about files. The ILibraryi general utilities can be used on any filing system. The IUtilsi and IExtrasi are HADFS programs. The library commands B*Copyb, B*Disksb, B*Filesb, B*SetExecb, B*SetLoadb, B*SetTypeb and B*Stampb are detailed in Chapter 3. XHADFS Library Programsx The following are programs designed to run with HADFS. DBACKUPd This program will copy an entire HADFS or DFS disk sector by sector, ignoring the file structure. Any faulty sectors on the source disk are ignored. The destination disk must already be formatted the same as the source disk. BBACKUPb can take the following command line parameters: BBACKUP <src> <dst> <trks> <sides> -s <spt> -t <tries> -quit <name>b If the B<src>b and B<dst>b drives are given, both must be given. If the number of tracks and sides are given then both must be given. The single character options must be given in lower case. The B<spt>b option is the number of sectors per track, currently only 10 is implemented. The B<tries>b is the number or retries BBACKUPb uses before abandoning a disk read or write. The B<src>b and B<dst>b can be filenames, in which can a disk image will be read from or written to. For example: B*BACKUP 0 -net-DiskImg 80 2b will copy the disk in drive 0 to a 400K disk image. Disk images are 'sequential/noninterleaved', that is, all the tracks on one side are used before all the tracks on the other side. Filenames can be prefixed with Bfs:b instead of B-fs-b, ef Bnet:DiskImgb. The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. If no parameters are given, you are prompted for the source and destination drives. These can be the same, in which case you will be prompted to change disks. You are then prompted for the size of the disk, the number of tracks, the number of sides and the maximum number of retries to use. If ERETURNe is pressed, then the defaults are used. Once all these are entered, the program waits for a keypress before starting. DCOMPACTd As a disk is used, as files are created and deleted, the free space on it may get fragmented until a stage arrives where there may be enough space to save a file, but none of the small areas of space are individually large enough. The BCOMPACTb program tries to move all the files on a disk together so that the free space is in the largest areas possible. BCOMPACTb can take the following command line parameters: BCOMPACT <drv> -quit <name>b The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. If no parameters are given, you are prompted for the drive number to compact. It then looks through the entire disk and moves as much as it can to compact the disk. It can only move files that will fit into memory, so the compaction may not be the maximum possible. DRescued This program can be used to rescue a file that has been corrupted and made inaccessible due to disk errors. You are prompted for the filename of the file to rescue, the new filename to save the rescued file as (don't use the same one!) and the fill byte for bad sectors. You give a decimal number or a hexadecimal number prefixed by '&'. If you just press return, then the bad sectors are not filled, but the beginning is marked with '!!!!!!!!' and the end is marked with '********', and any control codes other than CR (13) are converted to '|'. Rescue can only rescue files that are short enough to fit into memory. It goes through the file, loading it sector by sector, listing any bad sectors. After rescuing the file, you can try to repair it. For example, with text files use either fill byte 13 or nothing, and then load or read it into a word processor to edit the damaged section. For BASIC programs, use no fill byte, and then use B*REPAIRb to repair the bad program, and then edit the damaged section. After rescuing a file, don't delete it. B*RENAMEb it somewhere out of the way, eg as I$.BadSectors.File1i. This will hide the bad sectors from other files. If you deleted it, the the free space would be returned to the Free Space Map, and you could attempt to save into the bad sectors again. If you get a lot of bad sectors on a disk, you should copy off the files to another disk and re-format it. If that doesn't solve the problem, you should throw the disk away and replace it. Regular disk-drive cleaning reduces disk errors considerably. XHADFS Utils programsx These programs provide utilities to be used with HADFS. DHUtilsd HUtils provides some extra utilities for use with HADFS disks. On running, if no date is set, you are asked to enter the date. Then the main menu appears: 1 : Initialise a new HADFS disk 2 : Alphabetically sort a directory 3 : Convert a DFS disk to HADFS 4 : Set drive boot options H : HADFS Info D : Disk info You can also press 'B0b' to exit, and 'B*b' to enter B*b-commands. Option 1: Initialise a new HADFS disk. This option allows you to create a new HADFS disk with a partition for DFS files. This option also allows you to reserve a partition in the HADFS disk for DFS files. The usual thing to do is, with a double-sided 80 track disk, is have HADFS files on side 2 and DFS files on side 0. You do this by starting the 'hole' in the HADFS map at sector 74, just after the I$i directory, and extending it all the way to the end of that side of the disk. The HADFS disk map then continues from sector 800 to sector 1599. You can then save up to 27 other files in the DFS catalogue. The I!Booti file is renamed as IHADFSi and the I'D I S K'i file as I'H.D I S K'i. TheIROMi file stays as IROMi. This way, you can have other DFS files, including a I!Booti, and doing B*HADFSb from DFS will either select HADFS if it is already loaded, or load the IROMi image file, as the HADFS I!Booti would do. Option 2: Alphabetically sort a directory. HADFS disks at present do not store the directories alphabetically. It is intended that in future they will be, but at present you can use this option to alphabetically sort a directory. The case of names is ignored in sorting. Option 3: Convert a DFS disk to HADFS This will convert a DFS disk to an HADFS data disk. You are asked for the size of the disk, and whether you want to convert both sides. There needs to be some space on the disk on track seven for the HADFS root directory, so if track seven is occupied, the files will be moved out of the way. If they cannot be moved (the disk is too full) you may have to B*COMPACTb the DFS disk. If that does not free up sufficient space, you will have to remove some of the files. The files from side 0 are put into directory I$.Side0i, and those from side 1 into directory I$.Side1i. DFS directories other than I$i are pre-pended to filenames in the same way as ITreeCopyi, so that IB.FREDi becomes IB/FREDi. Option 4: Set drive boot options This allows you to specify which drive HADFS defaults to on start-up or after B*MOUNTb. This disk's current settings are displayed, and you can change each of them. If more than one drive is set as the default drive, then the lowest number drive is used. The CSD drive is the drive defaulted to after startup or B*MOUNTb. The LIB drive is the drive to look for I$.Libraryi on before searching the CSD drive. The URD drive is the drive to look on with B*I AMb before searching the CSD drive. Option H: HADFS Info This option shows various information about the version of HADFS in the machine. It shows the version number and capability bits returned by OSARGS &FD,0. This function is also contained in the program IExtras.PrInfoi. Option D: Disk Info This reads the flag bytes of a disk and shows what type it is. DHEditd IHEditi is a DFS/HADFS disk sector editor. When run, it loads sector &46, the root sector if an HADFS disk, or sector zero if not. Keys: cursors keys move around Shift-cursor keys move to next sector TAB swaps between ASCII entry and HEX entry COPY swaps which half of the sector is displayed f1 select drive f2 select absolute HADFS-style sector number f3 select track f4 select sector within the current track f6 Chain HUtils program Escape exits program Ctrl-D search for a Directory Ctrl-F display HADFS File information under cursor Ctrl-G Goto file's start sector Ctrl-H display Help information Ctrl-O OS command Ctrl-S Save sector Ctrl-U go Up from a directory When moving to a different sector or exiting, you are given the opportunity to save the current sector to disk, so Esc can be used as a 'save this sector' key. DDMapd IDMapi graphically shows the layout of all the files on the disk. DVisCompactd A combination of ICOMPACTi and IDMapi. Graphically shows the layout of a disk while it is being compacted! Needs quite a lot of memory, so needs shadow screen memory available. It will take the same command line parameters as BCOMPACTb. DIntern/sd IInterni creates an internal ROM-drive thet can be loaded into sideways RAM. It utilises the OSWORD 90 calls implemented by HADFS to allow extra drives to be added. When run, the following prompts are given: Drive number: The drive defaults to drive BIb. To change this, enter a drive number/letter here. Disk name: To change the default name, enter a new name here. Make default drive? Enter drive number: If set to 'Yes', then after a B*MOUNTb, then the specified drive will be the default drive. Make default library drive? Enter drive number: If set to 'Yes', then the specified drive will be looked for for a Library directory before any others. Make default user drive? Enter drive number: If set to 'Yes', then the specified drive will be looked at first when doing any B*I AMb commands. Boot option: This will set the option to use if the drive is booted from. Make files externally runnable? If set to 'Yes', then any file with a public 'Brb' access will be able to be called as a ROM-based B*bcommand without HADFS being selected as a the current filing system. Once these are entered, files can be loaded into the ROM image. You are given a prompt which shows how much space and directory space is left. B*bCommands can also be given at this prompt, eg to change directory. The file I$.Extras.IntRomi is a ROM with the supplied Library in it DDemoGbPbd This demonstates calls to OSGBPB to read various information. It runs through all the calls from 5 to 255, and displays the returned information. This will also work on other filing systems to demonstrate what is returned. DDemoArgsd This demonstates calls to OSARGS to read HADFS context parameters. XGeneral Programsx These programs should work any machine, including RISC OS systems, and on any filing system. DTreeCopyd ITreeCopyi will copy files between filing systems, preserving the directory structure and file attributes. The program is quite easy and self- explanatary to use. It has been completely rewritten to be fully error-trapped, allow disk swapping, and it reads as many files as possible before writing, thereby reducing disk swaps. Some notes to bear in mind are: * The attributes have the 'W' and 'R' options added when copying from DFS. * Filenames are shortened to seven characters when copying to DFS. * If a file has no read access, ITreeCopyi will set the access to 'R', copy it, and then reset the access to what it was. Obviously, the source disk will need to be not write protected if this happens. * If copying to or from ADFS disks, put the ADFS disk in drive 0. This is because the B*ADFSb command mounts drive 0. Alternatively, use BFADFSb as the filing system. * When copying from ADFS disks, B*MOUNTb them first. * When copying from Econet, the Execute bit is masked out as it is usually just a copy of the Read bit. * Answering 'Yes' to the 'Recurse?' question will copy subdirectories. * The 'Pause to change disks?' option allows you to use the same drive for different disks. * When copying from DFS the 'Copy all DFS directories?' question allows you to copy the whole disk, creating an approximation of the DFS directory structure by putting all the non-I$i directories into subdirectories, or adding a prefix to the filename. If you answer 'Y' to the subsequent 'Put into subdirs?' question, any directory other than the DFS I$i directory is put into a subdirectory of the destination directory. Answering 'N' will put them in the destination directory, prefixed with x/, when x is the directory. Eg, DFS IB.Progi becomes IB/Progi. When copying to DFS there is the 'Expand into DFS dirs?' question. This allows you to copy files with a x/ prefix saved by answering 'N' to the 'Put into subdirs?' question into the DFS x directory. Eg, IB/Progi becomes DFS IB.Progi. ITreeCopyi can take the following command line parameters, which must be in this order: B(<fs>:)<src> (<fs>:)<dest> CPRE (-dest) (-quit <name>)b The B<src>b and B<dest>b directories can be prefixed by a filing system name terminated with a B:b, eg BHADFS::0.$b The single character options control the level of copying: C - Confirm P - Pause to change disk R - Recurse E - Expand DFS directories They can be prefixed with 'B~b' to turn off the option, eg B~Cb means no confirm. If the B-destb option is given, then BTreeCopyb will terminate with the destination filing system selected. Otherwise, the source filing system remains selected. The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. An example command line would be: B*TreeCopy HADFS::0.$.Disk1 ADFS::1.$ ~C~PR~E -quit %.MenuProgb If any parameters are not given, they are asked for. The B-destb and B-quitb options must be given in lower case, and only the first letter is significant. DETreed IETreei will display an expanded tree display of the directory structure. When run, IETreei asks for the path of the directory to display. At this prompt, you can also give command line option flags. If you did not given any option flags when entering the path, you are then asked whether to show files (or just directories) and file information, and whether to print out the display. If you select printing, then the characters used are those suitable for printing on a printer that has characters 128 to 255 set to PC-8 characters. If there is any information available on the disk root, it is show. At the end, the total space used by the directories and files looked at is show. If you use the B-countb option, then all directories will have their contents added up and the total shown individually. IETreei can take the following command line parameters, which can also be entered at the 'Path to show:' prompt: B*ETree path [-files] [-info] [-count] [-list] [-print]b The option flags must be in lower case, and only the first letter is significant. If there are no parameters, IETreei asks for them. XLibrary File Utilitiesx These transient utilities can be used on any filing system for accessing or giving information on files. Information about these commands is given in the file I$.Extras.Library/ti. XLibrary General Utilitiesx These transient utilities and MCoded Basic programs can be used on any filing system. Information about these commands is also given in the file I$.Extras.Library/ti. XPrintout Programsx Most of the text files supplied on the System Startup disk are extended View files. These are text files created with Acorn's View word processor, using extensions to highlight two to provide easier-to-use printer functions. IMakeLPi creates the B*lpb commands to print out the files (replacing View's BPRINTb command), B*lpSb can be used to show the effects on the screen (replacing View's BSCREENb), and BScrollb can be used to scroll though a text file of any length, again showing the effects. DMakeLPd This program creates the Blpb command to print out View or text files to a printer. The name Blpb comes from Unix - it's short for ELeine EPerinter. IMakeLPi allows you to create a customised version of Blpb tailored for your printer and for what effects you wish to use. The default settings are for Epson-compatible printers. Blpb extends View's highlight 2 to give the extra facilities. After a highlight 2 you put a letter indicating an effect. A capital letter turns it on and a lower case letter turns it off. As an example: doing *Ihello*i would put the word 'hello' in italics. Pound symbols are correctly printed (hurray!!) - for this you need your printer set in US mode. This is done by setting some DIP switches somewhere, usually the endmost three to 'off'. Check your manual on this. The pound symbols are printed by switching to UK, printing a '#', and then switching back to US. As with everything else, this can be changed. The program is fairly simple to use. There is a main menu with a few options. Option 5 - Create View Driver - is not yet implemented. Options 1 and 2 allow you to change the parameters for your printer. Options 3 and 4 allow you to save and load the settings, and option 6 creates an Blpb command. The actual name can be changed to anything reasonable. I recommend creating a Ilpi directory in the Library, and naming the commands I%.lp.nlqi, etc. The System Startup Disk has various files supplied in the I%.lpi directory. On option 1, you have some Yes/No questions and some value questions. Pressing BRETURNb leaves them as they are. You may have to experiment a bit to find what the correct values are for your setup. There are some supplied files for different lengths of paper and number of lines on each page. Text lines Page lines Supplied files Continuous A4 70 70 I%.lp.70A4 %.lp.70A4nlqi Standard A4 66 70 I%.lp.66A4 %.lp.66A4nlqi Short A4 60 70 I%.lp.60A4 %.lp.60A4nlqi Continuous Listing 66 66 I%.lp.66 %.lp.66nlqi Standard Listing 60 66 I%.lp.60 %.lp.60nlqi These are the files used by the JGHPD ViewHello View menu system. On option 2, you select the code string you want to alter with the cursor keys. To change the string, type in the new string. The input is fairly flexible. You can put commas between everything, or not. You can enter in characters or decimal. If you want the number characters "0" to "9", they must be surrounded in quotes, otherwise they are taken as values. Examples are: 27,S,"0" \ 27,S,48 } all the same. 27,83,48 / To remove a setting, press ESPACEe followed by ERETURNe. The setting should then disappear. Pressing ECOPYe will allow you to edit the settings for punctuation and numbers. When Blpb starts it does a '@' code. This is defined to reset the printer, and can also set it to NLQ if you want. This makes the current position on the paper the top of the form (the place where Form Feeds go to). If you don't want this, set '@' to nothing. Blpb ignores View's ruler and embedded commands, etc. Tabs are to 8 character positions, as on the default ruler. The syntax of Blpb is: B*lp (+) <afsp> (<num>)b If the 'B+b' prefix is given, Blpb double spaces. If a decimal B<num>b is given, then that number of copies are printed. You can press BEscapeb at any time and the print job will be terminated, but the printer itself may continue for a while as it empties its own buffer. Hints If your printer prints everything on the same line, you need to set IAuto linefeedi to IYesi from option 1. If it doublespaces when you don't ask it to, you need to set IAuto linefeedi to INoi. If your printer form feeds to much, set IForm feedsi to INoi. The following are Highlight 2 extensions that are used in most of the text files, and so I recommend you set them to do a suitable effect on your printer. Bb BBoldb on/off Main bold effect Cc CCondensedc on/off Dd DDouble-striked on/off \ Auxilary Ee EEmphasidede on/off / bold effects Hh HDouble Heighth on/off Ii IItalicsi on/off Qq QQuad sizeq on/off This takes 3 lines (That bottom line ^^^^ has to be blank for Quad to work on the LC10/1001) Ss SSuperscripts on/off, as in dates: 3Srds March Ww WWidew on/off Xx XWide X Highx Yy YSubscripty on/off also: Highline One is used for underline Pound: ` Hash: # D*lpS (-<lines>) <afsp>d The BlpSb command will display a text file to screen, taking account of the following effects: BBoldb, IItalicsi, SSuperscripts, WWidew, YSubscripty and Underline. If a B<lines>b parameter is given, then each page is split with a line of '=' characters. DScrolld IScrolli is a scrolling textfile reader. You can scroll upwards and downwards through text files of any length. Extended View highlight codes as used by B*lpb and B*lpSb are acted on to give Bboldb, Iitalicsi, Ssuperscripts, Wwidew, Ysubscripty and underline effects. These can be turned off to give plain View extensions of *bold* and underline. IScrolli will also run on the Archimedes. If there is enough memory, IScrolli uses shadow mode 0, otherwise mode 3 is used. Unless a command line file is given, IScrolli shows the current directory and asks for a filename. At this prompt you can also give B*bcommands to change directory, etc. Once a file is given, it is loaded and displayed. The keys are simple. Cursors move up and down. Pressing EShifte will jump one screen at a time. Pressing ECtrle will jump to the ends of the file. Pressing ECOPYe will flip between extended highlights and plain highlights. Pressing EEscapee will leave. Pressing EPe and ERETURNe will let you print out the file. Before you press ERETURNe a prompt appears telling you the name of the printout command. You can change this here by deleting it and typing in another comand, but IScrolli will usually have found a suitable one. The recommended command B*lpb comand is created with the IMakeLPi program. Pressing E4e will display the file in 40 column teletext mode, if IScrolli has been told what program to use. The bottom line of the screen shows the filename of the file being scrolled, a percentage figure showing how far through the file you are, and a reminder of the keys used. IScrolli will take the following command line arguments: B*Scroll (-lp <name>) (-4 <name>) (-p <pagelen>) <afsp> (-quit <name>)b B<afsp>b is the file to display. The B-lpb option gives a command to use to print out the file. If this option is not given, then a default printout command is looked for as detailed below. The B-4b option gives a command to use to display the file in 40 column teletext mode. The B-pb option gives a pagelength to use when displaying page breaks. The B-quitb option gives a command to run on exit. If the B<name>b starts with a B*b, then it is called as a B*bCommand, otherwise it is BCHAINbed, with any parameters passed via the keyboard buffer. The options must be in lower case, and only the first letter is significant. So, for instance, to call IScrolli from another program, you could use the following: B CHAIN "Scroll -4 $.3to7 "+name$+" -quit Menu"b This would run BScrollb and display the file Bname$b, and CHAIN the program I$.3to7i to display in teletext mode. On exit, it would return to the program BMenub. On starting, if no B-lpb option is given, IScrolli looks for an B*lpb printout program. The order it looks for one is: Ilpi, I%.lpi, I%.lp.#i, I%.lp.*i, I$.lpi, I:0.$.lpi. The recommended place to put the B*lpb command is in the library in a subdirectory I%.lpi, with a file I1i being a default general purpose printer. With DFS, the best place would be in the I$i directory. IScrolli consists of the following files: IScrolli - The program Idispi - Controls screen output giving display effects IScroll/ti - This text file. Q6 Error messagesq   This chapter lists all the HADFS error messages, each preceded by the appropriate error codes. The error codes are returned by the BASIC function BERRb. The errors are listed in alphabetical order, and some similar error messages have the same error number. E&CF 207 Bad attributee The B*ACCESSb command has been attempted with an access string containing characters other than WRELP. E&FE 254 Bad commande The command was not recognised by HADFS, nor was it found as a transient command in the CSD or the library. E&CD 205 Bad drivee An attempt to use an invalid drive number. Valid drives are :0 to :9 and :A to :Z. :W to :Z map onto :0 to :3. E&CC 204 Bad filenamee An illegal filename was used, eg part of the name was longer than ten characters or less than one character, or contained a control character or a character larger than B~b, or one of the special characters B%b, B&b, B^b or B@b used incorrectly. E&FC 252 Bad numbere The B<size>b parameter of the B*INSTALLb command or the B<nn>b parameter of the B*FORMb command was wrongly used. E&CB 203 Bad optione An invalid argument to a B*OPTb command. E&B0 176 Bad renamee Not enough parameters were given to the B*RENAMEb command, or an attempt was made to rename the I$i directory. E&A8 168 Broken directorye An attempt has been made to access a directory where HADFS cannot find the reference to it in its parent directory. This would happen if the directory header or the parent directory has been corrupted. E&96 150 Can't delete CSDe You are not allowed to delete the currently selected directory. Use B*DIRb to change the CSD. E&97 151 Can't delete LIBe You are not allowed to delete the current library. Use B*LIBb to change the current library. E&A2 162 Can't delete URDe You are not allowed to delete the user root directory. Use B*I AMb or B*MOUNTb to change the URD. E&BF 191 Can't extende An attempt has been made to move PTR past the end of a file opened for writing, but there is no free space after the file on the disk for it to expand into. Future versions of HADFS will attempt to move the file to lessen the possibility of this error occuring. E&DE 222 Channele A random access operation has been attempted on a channel that is not valid to HADFS. HADFS uses channels 25 to 29. E&DE 222 Channel not opene A random access operation has been attempted on an HADFS channel that has not been opened. E&B0 176 Circular renamee An attempt to rename a directory inside itself or one of its subdirectories. E&98 152 Compaction requirede A creation operation (BSAVEb, B*CDIRb, BOPENOUTb) has been attempted on a disk where the free space map has become too fragmented. E&C7 199 CRC error in data at D:SSSSSSe E&C7 199 CRC error in ID at D:SSSSSSe Some data on the disk has become corrupted. E&B4 180 Dir. not emptye An attempt has been made to delete a directory which still contains files or directories. E&C8 200 Disk changede An attempt has been made to access a disk, but it is not in the drive. E&C7 199 Disk Error VV at D:SSSSSSe A disk error has occured that does not have a textual error message. E&C6 198 Disk fulle There is not enough free space on the disk to do the requested operation. This includes BSAVEb, B*CDIRb, opening new files or extending existing files. This error will also occur if there appears to be enough disk space, but the free space map is fragmented so that there are only small bits of space available, none large enough to be used. E&C9 201 Disk read onlye A write operation has been attempted on a disk that is write-protected. E&D2 210 Drive x not presente An attempt has been made to access a drive :2 to :V and there is no support routine for the drive, or drive :0 or :1 have been set external with B*OPT 7b and there is no support routine for them, or there is no DFS OSWORD &7F routine to support drives :0 and :1 internally. E&DF 223 End of filee This error occurs if two consecutive attempts have been made to read from a file whose end has been reached. The first failure will have been flagged by the Carry being set following a OSBGET or OSGBPB. E&C3 195 Entry lockede An attempt has been made to remove, rename or overwrite a file or directory which is locked. E&BD 189 File execute onlye An attempt to read or write to a file which has the execute-only access bit set. E&C4 196 File existse An attempt has been made with B*RENAMEb or B*CDIRb to create a new file or directory with the same name as an existing file or directory. E&C2 194 File opene An attempt has been made to delete, rename, or overwrite a file that is open, or to open a file that has already been opened for writing. A file can be opened many times at once for reading, but only once for writing. E&93 147 I cannot run this codee The load address and execution address high bytes disagree about which processor the file should be run in, eg load: FFFF0900, exec: 00000900. E&BD 189 Insufficient accesse An attempt has been made to read or load a file with no BRb attribute bit, or to write to a file with no BWb attribute bit. E&A8 168 Is a directorye An attempt to read from or write to a channel opened on a directory. E&BE 190 XXXXX is not a directorye An attempt to access a file as though is was a directory, eg with B*DIRb, B*LIBb, B*CATb or B*EXb. E&B5 181 XXXXX is not a filee An attempt to access a directory as though it was a file, eg with BLOADb. E&C6 198 Length too longe An attempt to create a file whose length would be 512K or longer on a small disk or 4G or larger on a large disk. The maximum file length on a small disk is 524287 (&7FFFF) bytes. This is 512K-1 bytes. The maximum file length on large disks is 4294967295 (&FFFFFFFF) bytes. This is 4G-1 bytes. E&C8 200 Not an HADFS diske An attempt to use HADFS on a non-HADFS disk. E&BD 189 Not enablede An attempt has been made to use a dangerous command, B*FORMb or B*INSTALLb, without first using B*ENABLEb, or answering BYb to the BGo?b prompt. E&D6 214 XXXXX not founde The file or directory referenced was not found. E&C1 193 Not open for updatee An attempt has been made to write to a channel that is only open for reading. E&B7 183 Outside filee An attempt has been made to move PTR past the end of a file opened for reading. E&B0 176 Rename across diskse An attempt has been made to use B*RENAMEb with the two filenames referencing different disks. This could come about with a command such as: B*RENAME Prog %.Progb if the library directory is on a different disk. E&C7 199 Sector not found at D:SSSSSSe An attempt has been made to access a sector that does not exist on the disk or is wildly out of range, larger than 2559 on a floppy disk. This could be because the disk has become corrupted somehow, or the HADFS memory has become corrupted. E&C0 192 Too many opene An attempt has been made to open a sixth file. Only five files may be open at once, only four of them being for output. E&C7 199 Track 0 not found at D:SSSSSSe The disk drive couldn't find track zero on a disk. This is usually because the disk has become corrupted. This usually does not affect HADFS much, as the root catalogue is not stored on track zero. A system disk stores some system files there, so this would mean you cannot boot the disk, and data disks may have part of an HADFS file stored there, so part of that file would be inaccessible. E&CE 206 Unsupported directorye This error is given if a large directory, used on disks larger than 16M in size, is read with versions of HADFS that do not support them. E&FD 253 Wildcardse A wildcard character B#b or B*b was found where a full filename specification was needed, eg in B*DELETEb, B*SAVEb, B*CDIRb and the destination of B*RENAMEb. E&C7 199 Write fault at D:SSSSSSe An error occured when writing to a disk. This is usually because of an error with the drive, or sometimes the disk. Disk errors report the sector the error occurs at as D:SSSSSS where D is the drive, and SSSSSS is the absolute sector number in hexadecimal. On floppy disks, SSSSSS is sector+10*track+800*side. DThe different between BLength too longb, BDisk fullb and BCan't extendbd BLength too longb is returned if you try to create a file longer than will fit with the directory structure used using OSFILE, ie SAVE or CREATE. Small directories, used on small disks, can hold files containing up to 512K-1 bytes. Large directories, used on large disks, can hold files containing up to 4G-1 bytes. BDisk fullb is returned if there is not a large enough area of free space on a disk to create a file using any creation command, ie SAVE, CREATE, CDIR, OPENOUT. BCan't extendb if returned if there is not enough space to extend an opened file, or if you try to extend it past the maximum size the directory structure can store, eg 512K-1 bytes in small directories. DError codes, numerically orderedd EHex Dece &93 147 I cannot run this code &94 148 &95 149 &96 150 Can't delete CSD &97 151 Can't delete LIB &98 152 Compaction required &99 153 Free space map full &9A 154 Bad disk &9B 155 Too many disks &9C 156 Illegal use of ^ &9D 157 &9E 158 Ambiguous disk name &9F 159 Not same disk &A0 160 &A1 161 &A2 162 Can't delete URD &A3 163 &A4 164 &A5 165 &A6 166 &A7 167 &A8 168 XXXXX broken from parent &A8 168 Is a directory &A9 169 Bad free space map &AA 170 &AB 171 &AC 172 Bad user name &AD 173 Mode x &AD 173 Sizes don't match &AE 174 Not logged on &AE 174 Same disk &AF 175 Types don't match &B0 176 Bad rename &B0 176 Rename across disks &B0 176 Circular rename &B1 177 Already a user &B2 178 PW file full &B3 179 Directory full &B4 180 Dir. not empty &B5 181 XXXXX is not a file Is a directory &B6 182 Map fault &B7 183 Outside file &B8 184 Too many users &B9 185 Bad password &BA 186 Insufficient privilege &BB 187 Wrong password &BC 188 User not known &BD 189 Not enabled &BD 189 File execute only &BD 189 Insufficient access &BE 190 XXXXX is not a directory &BF 191 Can't extend Who are you? &C0 192 Too many open &C1 193 Not open for update &C2 194 File open &C3 195 Entry locked &C4 196 File exists &C4 196 Types don't match &C5 197 Drive fault &C6 198 Disk full &C6 198 Length too long &C7 199 CRC error in ID at D:SSSSSS &C7 199 CRC error in data at D:SSSSSS &C7 199 Track 0 not found at D:SSSSSS &C7 199 Write fault at D:SSSSSS &C7 199 Sector not found at D:SSSSSS &C7 199 Disk Error VV at D:SSSSSS &C8 200 Not an HADFS disk &C8 200 Disk changed &C9 201 Disk read only &CA 202 Bad sum &CB 203 Bad option &CC 204 Bad filename &CD 205 Bad drive &CE 206 Unsupported directory type Bad directory &CF 207 Bad attribute &D0 208 &D1 209 &D2 210 Drive x not present &D3 211 Drive empty &D4 212 Disk not found &D5 213 Disk not present &D6 214 XXXXX not found &DC 220 Syntax &DD 221 &DE 222 Channel &DE 222 Channel not open &DF 223 End of file &FC 252 Bad number &FD 253 Wildcards &FE 254 Bad command �', then the specified drive will be looked for for a Library directory before anyQ7 HADFS programmingq Qexamplesq   This chapter gives some examples of calling various HADFS functions, and provides some useful BASIC functions and procedures for incorporating into programs. Some of the functions need some memory reserved for control block and data. Where a control block is used, it must be set by the main program before using the functions, and X% and Y% must be set to point to it with the following code: B DIM ctrl% 31:X%=ctrl%:Y%=X%DIV256b Where a function requires other memory, it is shown before the function definition, such as: B DIM name% 80b In the listings given, no line numbers are shown, as none are needed. Where a line is too long to fit on the page, it is continued on the next line indented. Unless otherwise stated, these functions will work on all the following varieties of BBC BASIC: 6502 BBC BASIC on I/O processor, Tube, RISC OS 65Host and 65Tube emulators 32000 BBC BASIC on the 32016 second processor ARM BBC BASIC V on RISC OS and ARM second processor BBC BASIC(Z80) using BBC I/O on Z80 Tube or Archimedes Tube emulator Most will also work on BBC BASIC(86) and BBC BASIC(Win) for PCs and BBC BASIC(X) for UNIX. These functions are all supplied in the ILibrary.BLibi directory on the System Startup disk. DGeneral functions - BLib.MOSd OSBYTE Calls BFNbyteb returns the single byte in the X register for the specified call. BFNfxb returns the two-byte value held in XY. B DEFFNbyte(A%,X%,Y%)=(USR&FFF4 AND &FF00)DIV256 DEFFNfx(A%,X%):LOCAL Y%:Y%=X%DIV256:=(USR&FFF4 AND &FFFF00)DIV256b As an example, BFNfx(133,mode%)b returns HIMEM for the specified mode, and BFNbyte(135,0,0)b returns the character under the cursor. BFNfx(135,0)DIV256b returns the current screen mode number. OSFILE Calls - BLib.FileIO This call performs an OSFILE function, returning the object type from the A register. B DIM name% 127 DEFFNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FFb BFNfile("FRED",5)b would read the catalogue information for the file FRED. The catalogue information is put into memory with X%!2=load, X%!6=exec, X%!10=length and X%!14=attributes. OSGBPB Calls - BLib.FileIO These procedures and functions call OSGBPB. BPROCgbpbb makes a general call. Calling BFNgbpbb with A% passed as 5, 6 or 7 returns the name of the current disk, the current directory or the current library respectively. BFNgbpb8b reads a filename from the current directory, returning a null string if at the end. The updated pointer is returned in the control block. B DIM name% 31 DEFPROCgbpb(A%,chn%,addr%,num%,ptr%) ?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:CALL &FFD1:ENDPROC DEFFNgbpb(A%):X%!1=name%:CALL &FFD1:A%=name%+((1+?name%)AND((A%AND-2)=6)) A%?(1+?A%)=13:=$(A%+1) DEFFNgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL &FFD1:IFX%!5=1:="" A%=name%:A%?(1+?A%)=13:=$(A%+1)b After calling BFNgbpb8()b, X%!9 holds the ptr% to be used on the next call. After calling BFNgbpb()b with A%=6 or 7 using B name%?(1+?name%)=13:Drive$=$(name%+1)b will set Drive$ to the ASCII drive identifier for that directory. OSARGS Calls - BLib.FileIO These two functions allow you to make OSARGS calls. BFNargsAb returns the value from the A register, ignoring the zero page data. BFNargsb sets and returns data passed in zero page. When reading a value, the zero page parameter is ignored, so you can set it to zero on entry. When writing a value, some calls return a value, often the same as the value just written. B DEFFNargsA(A%):LOCAL X%,Y%,E%,!&70:X%=&70:=(USR&FFDA)AND&FF DEFFNargs(A%,Y%,!&70):LOCAL X%,E%:X%=&70:IF?(TOP-3)=0:E%=Y%:Y%=0 CALL &FFDA:=!X% used%=FNargs(4,0,0) :REM Get disk space used free%=FNargs(5,0,0) :REM Get disk free space size%=free%+used% :REM Find disk size dummy%=FNargs(1,chn%,num%) :REM identical to PTR#chn%=num%b BFNfsb returns the current filing system number. B DEFFNfs:LOCAL A%,Y%,E%:=(USR&FFDA)AND&FFb Time and Date - BLib.Time BASIC IV (on the Master) and V (on the Archimedes) have a =BTIME$b function to read the real-time clock (RTC). HADFS provides a RTC function, but BASIC II (on the B/B+) does not have a function to read it. Also, the 6502 second processor only reads 24 bytes instead of 25, and so loses the terminator. The function BFNtimeb will read the RTC regardless of what machine it is running on, and will correct for years after 1996 and 1999, or return a null string if no time is available. The 'Acorn Era' is defined as starting in 1981, so the century range is 1981-2080. B DEFFNtime:?X%=0:A%=14:CALL&FFF1:IF?X%=0:="" X%?25=13:A%=VAL$(X%+4):$(X%+4)=RIGHT$("0"+STR$(A%AND31),2) $(X%+11)=STR$(INTVAL$(X%+11)+(A%AND&E0)DIV2-100*(INTVAL$(X%+11)<1981)) X%?6=32:X%?15=46:=$X%b The function BFNTimeb checks for any onboard RTC and if none is found will also check for any fileserver clock. B DEFFNTime:!X%=1:A%=14:CALL&FFF1:FORA%=0TO7:X%?A%=VALSTR$~X%?A%:NEXT ?X%=?X%+((X%?2)AND&E0)DIV2:X%?2=X%?2 AND31:IF?X%<81:?X%=?X%+100 IF!X%=101:!X%=&10000700:X%!4=0:A%=20:CALL&FFF1:!X%=0:IFX%!4:?X%=81+(X%?5 ... DIV16)+((X%?4 AND&E0)DIV2):X%?1=X%?5 AND15:X%?2=X%?4 AND31:X%!4=X%!6 IFX%?3=0:IFX%?2:X%?3=FNDate_DayOfWeek(X%?2,X%?1,1900+X%?0) =FNDay(X%?3)+","+FNd0(X%?2,2)+" "+FNMon(X%?1)+" "+FNd0(1900+ ... X%?0,4)+"."+FNd0(X%?4,2)+":"+FNd0(X%?5,2)+":"+FNd0(X%?6,2)b The function BFNdateb returns the current date in the format &yyyymmdd. So, if it is called with BT%=FNdateb, then BT%DIV65536b would give the current year. B DEFFNdate:A%=14:!X%=1:CALL&FFF1:IF!X%=1:=0 ?X%=(VALSTR$~?X%+(((VALSTR$~X%?2)DIV2)AND&F0))MOD100 =(VALSTR$~X%?2 AND31)+256*VALSTR$~X%?1+65536*(6400+?X%-&700*(?X%<128))b Time and Date - BLib.Date The functions BFNDayb and BFNMonb return three-character string containing the specified day or month. BFNDayb and BFNMonb are also in the ITimei library. B DEFFNDay(A%):=MID$("000SunMonTueWedThuFriSat",A%*3+1,3) DEFFNMon(A%):=MID$("000JanFebMarAprMayJunJulAugSepOctNovDecDDDEEEFFF", ... A%*3+1,3)b The function BFNDate_DayOfWeekb returns the day of the week for the given date, month and year. The day number is 1..7 for Sun..Sat and can be converted to the name of the day with BFNDayb. BFNDate_DayOfWeekb is also in the ITimei library. DEFFNDate_DayOfWeek(d%,m%,y%):y%=y%MOD400 =(y%*365.25+m%*30+d%+VALMID$("120112234455",m%,1)+((y%MOD4)=0)- ... ((y%-1)DIV100)-(m%>2AND((y%MOD4)=0AND(y%MOD100)<>0ORy%=0))+3)MOD7+1 BPROCDate_FromOrdb converts the given time and date to a 5-byte centisecond count from 00:00:00 on 1st Jan 1900, as used for RISC OS time-stamps. B DEFPROCDate_FromOrd(mem%,d%,m%,y%,hr%,mn%,sc%,cs%):y%=y%MOD400 d%=y%*365.25+m%*30+d%+VALMID$("120112234455",m%,1)+((y%MOD4)=0)- ... ((y%-1)DIV100)-(m%>2AND((y%MOD4)=0AND(y%MOD100)<>0ORy%=0))+36493 IFd%>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%DIV256:ENDPROCb On entry: mem%->five bytes of memory day, month, year of the date hours, minutes, seconds, centiseconds of the time On exit: mem% to mem%+4 containes five-byte centisecond time since 00:00:00 on 1-Jan-1900. The d%+d% is deliberate. It prevents a 'Too big' error happening when &7Fxxxxxxxx overflows to &80xxxxxxxx. The five-byte time range ends at 06:57:57.75, 04/06/2248. The five-byte time can be used to set the load and exec addresses on a file with OSFILE with B PROCDate_FromOrd(X%+6,.......) X%!2=X%?10 OR type%*&100 OR &FFF00000b where X% is an OSFILE control block, or: B PROCDate_FromOrd(mem%,.......) exec%=!mem%:load%=mem%?4 OR type%*&100 OR &FFF00000b to get load and execution addresses separately. BPROCDate_ToOrdb converts a 5-byte centisecond count into a time and date. B DEFPROCDate_ToOrd(mem%):LOCAL A%,B%,C%,D% year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0:centi%=0 IFmem%!1<0:ENDPROC:REM Problems with negatives ATM D%=mem%!1DIV&83D6+2447065:C%=mem%?0+256*(mem%!1MOD&83D6):centi%=C%MOD100 C%=C%DIV100:second%=C%MOD60:C%=C%DIV60:minute%=C%MOD60:hour%=C%DIV60 B%=((D%*4+3)MOD146097AND-4)+3:C%=B%MOD1461DIV4*5+2:D%=D%*4+3 A%=C%DIV153+2:day%=C%MOD153DIV5+1:month%=A%MOD12+1 year%=D%DIV146097*100+B%DIV1461+A%DIV12-4800 ENDPROCb On entry: mem%->five bytes of memory containing the centisecond count On exit: year%, month%, day% are set to the date hour%, minute%, second%, centisecond% are set to the time BFNDate_Sinceb returns the number of days since a past date. On entry td%, tm% and ty% should be set to today's date, month and year and pd%, pm% and py% should be set to the past date, month and year. B DEFFNDate_Since(td%,tm%,ty%,pd%,pm%,py%):LOCAL past% PROCDate_FromOrd(X%,pd%,pm%,py%,0,0,0,0):past%=X%!1 PROCDate_FromOrd(X%,td%,tm%,ty%,0,0,0,0):=(X%!1-past%)DIV&83D6b Number output - BLib.Number The function BFNh0b converts the number A% to a N%-digit hexadecimal string padded with zeros. BFNd0b does the same, returning a decimal string. BFNhb and BFNdb return a N%-digit hexadecimal and decimal strings, padded with spaces. B DEFFNh0(A%,N%)=RIGHT$("0000000"+STR$~A%,N%) DEFFNh(A%,N%)=RIGHT$(" "+STR$~A%,N%) DEFFNd0(A%,N%)=RIGHT$("000000000"+STR$A%,N%) DEFFNd(A%,N%)=RIGHT$(" "+STR$A%,N%)b HADFS can support up to 32 drives, numbered from 0 to 9 and A to V. The function BFNdrvb gives the drive character "0" to "V" for the specified drive number 0 to 31. BFNDrvb converts the other way, giving the drive number from the given drive character. B DEFFNdrv(A%)=CHR$(48+A%-7*(A%>9)) DEFFNDrv(A$)=ASCA$-48+7*(A$>"9")AND31b BFNIntToTxtb converts the number A% to the English text string representing that number. B DEFFNIntToTxt(A%):LOCAL A$,B$ IF A%<0 AND A%<>-A%:="minus "+FNIntToTxt(-A%) ELSE IF A%<0: ... ="minus two thousand "+FNIntToTxt(147483648) IF A%=0:="zero" IF A%>999999:A$=FNIntToTxt(A% DIV 1000000)+" million": ... A%=A% MOD 1000000 IF A%>999 AND A$<>"":A$=A$+" " IF A%>999:A$=A$+FNIntToTxt(A% DIV 1000)+" thousand":A%=A% MOD 1000 IF A%>99 AND A$<>"":A$=A$+" " IF A%>99:A$=A$+FNIntToTxt(A% DIV 100)+" hundred":A%=A% MOD 100 IF A%=0:=A$ ELSE IF A$<>"":A$=A$+" and " IF A%>12 AND A%<20: ... B$=MID$("thir four fif six seveneigh nine",(A%-12)*5-4,5): ... =A$+LEFT$(B$,INSTR(B$+" "," ")-1)+"teen" IF A%>10 AND A%<13:=A$+MID$("eleventwelve",(A%-10)*6-5,6) B$=MID$("ten twenty thirty fourty fifty sixty seventyeighty ... ninety",(A%DIV10)*7-6,7):B$=LEFT$(B$,INSTR(B$+" "," ")-1) A$=A$+B$:IF A%>20 AND A%MOD10<>0 AND A$<>"":A$=A$+"-" A%=A%MOD10:B$=MID$("one two threefour five six seveneightnine", ... A%*5-4,5):=A$+LEFT$(B$,INSTR(B$+" "," ")-1)b Directory pathname - BLib.Pathname The function BFNPath_Nameb returns the pathname of the current directory, prefixed with the disk number. The function BFNPath_Fullb is almost the same, but it returns the disk name instead of the disk number. B DIM name% 31 DEFFNPath_Name:A%=6 DEFFNPath_Full:A%=&106 LOCAL n$,p$:REPEAT:X%!1=name%:CALL &FFD1 ?(name%+2+?name%+?(name%+?name%+1))=13 n$=$(name%+2+?name%):*DIR ^ n$=LEFT$(n$,INSTR(n$+" "," ")-1) p$=n$+"."+p$:UNTILn$="$"ORn$="&" p$=LEFT$(p$,LENp$-1):OSCLI"DIR "+p$ IFA%=6:X%!1=name%:CALL &FFD1:?(name%+1+?name%)=13:n$=$(name%+1):IF ... n$<>"":=":"+n$+"."+p$ X%!1=name%:A%=5:CALL &FFD1 ?(name%+1+?name%)=13:n$=$(name%+1) n$=LEFT$(n$,INSTR(n$+" "," ")-1):=":"+n$+"."+p$b The functions BFNPath_Libb, BFNPath_LibFullb, BFNPath_URDb and BFNPath_URDFullb use the BFNPath_Nameb and BFNPath_Fullb functions to give the pathnames of the library and user root directories. B DEFFNPath_Lib LOCAL a$,b$:a$=FNPath_Name:*DIR % b$=FNPath_Name:OSCLI"DIR "+a$:=b$ : DEFFNPath_LibFull LOCAL a$,b$:a$=FNPath_Name:*DIR % b$=FNPath_Full:OSCLI"DIR "+a$:=b$ : DEFFNPath_URD LOCAL a$,b$:a$=FNPath_Name:*DIR & b$=FNPath_Name:OSCLI"DIR "+a$:=b$ : DEFFNPath_URDFull LOCAL a$,b$:a$=FNPath_Name:*DIR & b$=FNPath_Full:OSCLI"DIR "+a$:=b$b This is an example of what would be returned by the functions: FNPath_Name would return :0.$.Progs.Temp FNPath_Full would return :ProgramDisk.$.Progs.Temp FNPath_Lib would return :1.$.Library FNPath_LibFull would return :UtilsDisk.$.Library FNPath_URD would return :0.$.User1 FNPath_URDFull would return :MyDisk.$.User1 These functions will work on any Acorn machine, including Archimedes/RISC OS, and on any filing system that recognises the I^i directory. The short name functions (ie BFNPath_Nameb, BFNPath_Libb, BFNPath_URDb) are suitable for using as a pathname, eg for B*CATb or B*DIRb. The path returned by the full path functions that include the diskname can only be used for filing operations on filing systems that recognise named disks, ie NFS and RISC OS filing systems. DProgram Environment Functionsd Command line tail HADFS, RISC OS and the B*MCodeb command allow BASIC programs to be run as B*bcommands. This function allows the command tail to be retrieved, and also gets the host type and the command that started the program. So if a BASIC program IPROGi was run with B*PROG Hellob, then BFNOS_GetEnvb would return "Hello" and run$ would be set to "*PROG" if MCoded or "PROG" if CHAINed or "". B DEFFNOS_GetEnv:LOCALA$,A%,X%,Y%:X%=1:os%=((USR&FFF4)AND&FF00)DIV256:DIMX%-1 IFos%=32:IFPAGE>&FFFF:SYS"GetModuleFileName",0,X%,255:A$=$$X%:run$=A$:=@cmd$ IFos%=32:A$=$&100 IFLENA$=0:IFPAGE>&7FFF:run$=$&8100:SYS"OS_GetEnv"TOA$,,A%:SYS"OS_WriteEnv","",A%: ... A$=MID$(A$,1+INSTR(A$+" "," ",1+INSTR(A$," "))):IFLENA$=0:A$=run$ IFLENA$=0:IF?(TOP-3):A$=$&600 ELSE IFLENA$=0:A$=$(PAGE-&300) A%=INSTR(A$+" "," "):run$=LEFT$(A$,A%-1):IFrun$<>"":=MID$(A$,A%+1) Y%=X%DIV256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:CALL&FFD1:A%=X%+16:IF!A%AND?A%+A%?2<>8: ... A%?(A%+1)=13:=$(A%+1) =""b This function works on the BBC/Master I/O processor, the 6502, Z80 and 32016 CoProcessors, Arthur, RISC OS, BBC BASIC(86) and BBC BASIC(Win). It needs 270 free bytes above the end of variable space for temporary workspace. As BFNOS_GetEnvb is usually called before most variables are set there should be sufficient space. On an Arthur and RISC OS it gets the command tail using the BSYSb call OS_GetEnv. On pre-BASIC V, the BSYSb token is listed and can be entered as BLOADATNb with no spaces between BLOADb and BATNb. Next, any command line passed with BBC BASIC for Windows is looked for. Then the command line passed on BBC BASIC(86), BBC BASIC(65) and BBC BASIC(80) is looked for; and if there is no run name, it finally checks to see if there is an HADFS or UNIX command tail available. If no command tail can be found anywhere, then a null string is returned. This function is used in programs like IETreei and ITreeCopyi. The following function can be used to run a BASIC program or B*bcommand, passing it a command line: B DEFPROCos(A$):IFA$=""ORASCA$=42:OSCLIA$:ENDPROC ELSE CHAINA$b If the passed command starts with a 'B*b', it is called as a command. If not, it is CHAINed as a BASIC program. DHADFS functionsd HADFS Version number BFNhadfs_verb returns the HADFS binary version number. This is the version number*100 for versions before 0.52 and version number*100 for versions 5.20 onwards, ie HADFS 0.48 returns 48 and HADFS 5.20 returns 52. B DEFFNhadfs_ver:LOCAL A%,X%,Y%,E% A%=&FD:X%=&70:A%=USR&FFDA AND &FF:=((A%+3) AND &FF)-3b The +3 and -3 are so that early version of HADFS, or non-HADFS filing systems return a value of -3 so easy comparisons can be made, eg B IF FNhadfs_ver<40 THEN PRINT "Must be HADFS 0.40 or later":ENDb Number of channels You can change the number of channels available on HADFS using B*OPT5b. This function will find out how many channels are available. B DEFFNhadfs_chns=2+(FNbyte(90,6,255)AND&30)DIV16b Preserving directory context OSARGS &FD can be used to read HADFS's Currently Selected Directory (CSD), so that it can be set to something else using B*DIRb, and then restored later. The LIB and URD can also be preserved and later restored in this way. B csd%=FNargs(&FD,8,0):REM Read CSD *DIR somewhere : : Do something here : : csd%=FNargs(&FD,&88,csd%): Restore CSDb The B*Disksb command uses this method to switch between disks without losing where it was to start with. Adding extra drives with OSWORD 90 Extra drives can be added by intercepting the OSWORD 90 call. The following is an example listing of some code to do just this by creating a RAM-disk in JIM. JIM is the area of memory at &FD00 which is reserved for access to multiple pages of extra memory. A paging selector is accessed at address &FCFF in FRED. The RAM-disk would have to be initialised with B*INSTALL d $ Name DxxxKb where Bxxxb is the amount of memory available, and Bdb is the drive number. Setting drive=27 gives drive R. The file I$.Extras.JimDisk/si contains the code for intercepting via WORDV. This efficiency of this listing is not what it could be, as it is programed for clarity rather than for speed. The code in IIntern/si is highly optimised, but is thereby much harder to read. BRAM-based intercepting WORDV ROM-based using service call 8 addr=&A8:sect=addr+4:ptr=&AE addr=&A8:sect=addr+4:ptr=&F0 drive=27:REM drive R drive=27:REM drive R Redirect WORDV to point to OswordCall, .Service8:\ Unknown OSWORD with old WORDV preserved in OldWord. LDA &EF:CMP #90:BEQ Osword90 .NotForMe .NotForMe LDX ptr:LDY ptr+1:LDA #90 LDX &F4:LDA #8:LDY ptr+1 .NotOsword90 RTS JMP (OldWord) : .OswordCall CMP #90:BNE NotOsword90 : \ Routine common to RAM or ROM-based: .Osword90 LDY #0:LDA (ptr),Y:BNE NotForMe :\ First check &0600 ID marker INY:LDA (ptr),Y:CMP #6:BNE NotForMe LDY #9:LDA (ptr),Y:CMP drive:BNE NotForMe :\ Check for drive number LDY #11:LDA (ptr),Y:BMI NotForMe:BEQ NotForMe :\ bit7 commands dealt by HADFS CMP #3:BCS NotForMe :\ This only does Read and Write : \ Control block now holds: \ 2..5=addr \ 6..8=sector \ 9 =drive (already checked) \ 10 =number of sectors \ 11 =type 1=write, 2=read : LDX #7 :\ Preserve the memory about to be used .SaveLoop LDA addr,X:PHA:DEX:BPL SaveLoop LDY #2 :\ Get address & sector .AddrLoop LDA (ptr),Y:STA addr-2,Y \ RAM-based routine :\ ROM-based routine: INY:CPY #8:BNE AddrLoop:INY:INY INY:CPY #10:BNE AddrLoop : INY:LDA (ptr),Y:TAX :\ Get number of sectors : INY:LDA (ptr),Y :\ Get Read/Write CMP #1:BEQ Write LDA &27A:BPL ReadLoop LDA addr+2:AND addr+3:CMP #&FF BNE TubeRead : .ReadLoop :\ Read to I/O memory JSR SetSector .ReadLoop2 LDA &FD00,Y:STA (addr),Y:INY BNE ReadLoop2 JSR NextAddress BNE ReadLoop:BEQ IOEnd : .TubeRead :\ Read to Tube memory TXA:PHA :\ Save number LDA #1:JSR ClaimTube PLA:TAX :\ Restore number .TubeReadLoop JSR SetSector .TubeReadLoop2 LDA &FD00,Y:STA &FEE5:INY JSR TubeDelay:JSR TubeDelay BNE TubeReadLoop2 JSR NextAddress BNE TubeReadLoop:BEQ TubeEnd : .Write LDA &27A:BPL WriteLoop LDA addr+2:AND addr+3:CMP #&FF BNE TubeWrite : .WriteLoop :\ Write from I/O memory JSR SetSector .WriteLoop2 LDA (addr),Y:STA &FD00,Y:INY BNE WriteLoop2 JSR NextAddress BNE WriteLoop:BEQ IOEnd : .TubeWrite :\ Write from Tube memory TXA:PHA :\ Save number LDA #0:JSR ClaimTube JSR TubeDelay:JSR TubeDelay :\ Write needs starting delay PLA:TAX :\ Restore number .TubeWriteLoop JSR SetSector .TubeWriteLoop2 LDA &FEE5:STA &FD00,Y:INY JSR TubeDelay:JSR TubeDelay BNE TubeWriteLoop2 JSR NextAddress BNE TubeWriteLoop .TubeEnd JSR TubeRelease .IOEnd LDX #0 :\ Restore memory .LoadLoop PLA:STA addr,X:INX:CPX #8 BNE LoadLoop LDY #11:LDA #0:STA (ptr),Y :\ Claim call RTS : .SetSector :\ Set the JIM page select latch LDA sect+1:STA &FCFE :\ Select hi byte LDA sect:STA &FCFF :\ Select lo byte LDY #0:RTS : .NextAddress :\ Increment sector and addr bytes 1/2/3 INC sect:BNE NextAd2:INC Sect+1 .NextAd2 INC addr+1:BNE NextAd3 INC addr+2:BNE NextAd3 INC addr+3 .NextAd3 DEX RTS : .ClaimTube :\ Tube claim and release routines PHA .ClaimLoop LDA #&C0+36:JSR &406:BCC ClaimLoop PLA LDX #addr AND 255:LDY #addr DIV 256 JMP &406 : .ReleaseTube LDA #&80+36:JMP &406 : .TubeDelay :\ Delays by 12us JSR TubeD2 .TubeD2 RTS b DBBC BASIC on different machinesd BBC BASIC has been implemented on many machines, and it is often useful to find out exactly what hardware a program is running on. On all Acorn hardware, this is simple enough, as INKEY-256 and OSBYTE 0,1 give unique values for the machine you are using. However, some machines do not implement negative INKEYs, and so would just wait about 12 minutes for you to press a key, and some do not let you do an OSBYTE call. There are ways around this though. In this discussion, the following BASICs will be refered to: BBC BASIC(2/4) 6502 BASIC, as supplied in the B and Master BBC BASIC(32) 32000 BASIC, as supplied with the 32016 CoPro BBC BASIC(V) ARM BASIC, as supplied in the Archimedes or ARM CoProcessors BBC BASIC(Z80) Z80 BASIC, for Acorn CPM, Torch CPN, Tatung Einstein, Cambridge Z88, Amstrad Notepad, or modified for Tube with BBC I/O, Sinclair Spectrum or Amstrad CPC. BBC BASIC(86) 80x86 BASIC, for PC machines BBC BASIC(Win) 80x86 BASIC for PCs running Windows BBC BASIC(X) C-coded BASIC, for UNIX platforms Brandy BASIC Brandy BASIC BBC BASIC(2/4) and BBC BASIC(V) could also be called BBC BASIC(65) and BBC BASIC(ARM). Some of the above can also be run on RISC OS under emulation. BASIC(65), BASIC(32) and BASIC(ARM) store the program in memory starting from PAGE with a CR, and ending with xx, CR, &FF where xx is the last character of the final line. BASIC(Z80), BASIC(86) and BASIC(Win) store the program ending with CR, 00, &FF, &FF. BASIC(65), BASIC(32) and BASIC(ARM) always have access to the MOS and FILE calls and allow INKEY-256. This allows us to use ?(TOP-3)=0 to indicate Z80/86/Win or 65/32000/ARM, and to indicate whether we can make a call to &FFxx or do INKEY-256. OSBYTE 0,1 will return 6 indicating an RISC OS/Archimedes when running on an emulator. BBC BASIC(ARM) running native always has PAGE>&8000. This can be used to indicate native. BASIC(86) starts with HIMEM>&FFFF, and BBC BASIC(Z80) always has HIMEM<&FFFF, so this check can be used to distinguish between Z80 and 80x86. Additionally, Windows always has PAGE>&FFFF and DOS has PAGE<&10000. BBC BASIC(86) allows only three MOS calls, OSBYTE 0,1 which returns 32, OSBYTE 135 to read the character at the cursor position and OSWORD 10 to read character definitions BASIC(Z80) may run under CPM or not under CPM. All CPM calls go through a jump vector at address &0005. In some BASIC(Z80) environments, the &0005 call returns zero to indicate non-CPM mode. In other environments, there isn't a jump vector there at all. If we first test to see if there is a jump vector there and if there is call it with C% set to 12 to ask for the CPM version number, we can find out if we are running under CPM. If the call returns zero, then we are running in a non-CPM environment that allows MOS and FILE calls. If we are running in a non-CPM environment we are probably running on a Cambridge Z88 or an NC100. The Z88 has its reset routine at location 0 starting with a &F3 byte. This distinguishes between Z88 and NC100, neither of which have any MOS or FILE calls. B REM Works on I/O,T6502,Arc,TZ80bbc,PC,CPM,Unix,NC,Z88,Einstein DEFFNOS_GetEnv:LOCAL A%,X%,Y%,A$ cpm%=0:dos%=0:win%=0:bbc%=0:os%=-1:arc%=0:unix%=0:z88%=0:nc%=0 bbc%=?(TOP-3)<>0:IFNOTbbc%:dos%=HIMEM>&FFFF: ... IFNOTdos%:cpm%=?5=&C3:IFcpm%:C%=12:IFUSR5=0:bbc%=TRUE:cpm%=0 IFbbc%ORdos%:A%=0:X%=1:os%=(USR&FFF4 AND&FF00)DIV256 IFNOTbbc%ANDNOTdos%ANDNOTcpm%:z88%=?0=&F3:nc%=NOTz88%:A$=$&A000 arc%=(os%=6 AND PAGE>&8000):unix%=os%=8 IFarc%:LOADATN"OS_GetEnv"TOA$:A$=MID$(A$,1+INSTR(A$," ",1+INSTR(A$," "))) DIMX%-1:IFos%=32:IFPAGE>&FFFF:win%=TRUE:SYS"GetModuleFileName",0,X%,255: ... X%?255=13:A$=LEFT$($X%,INSTR($X%,CHR$0)-1):=@cmd$ ELSE IFos%=32:A$=$&100 IFLENA$=0:IFbbc%:A$=$&600 ELSE IFLENA$=0:A$=$&3800 A%=INSTR(A$+" "," "):run$=LEFT$(A$,A%-1):IFrun$<>"":=MID$(A$,A%+1) DIMX%-1:Y%=X%DIV256:A%=9:?X%=0:X%!1=X%+16:X%!16=0:CALL&FFD1:A%=X%+16: ... IF!A%AND?A%+A%?2<>8:A%?(1+?A%)=13:=$(A%+1) =""b The above routine returns any command line parameters and sets the following global variables: run$ is set to the command used to start the program, os% contains the host operating system value (see below); cpm%, dos%, win%, bbc%, unix%, arc%, z88% and nc100% are flags indicating what hardware is running. These can be used to indicate the following: os% Host os value (see below) run$ Pathname used to start the program bbc% Calls to &FFxx and INKEY-256 ok, names are :d.$.dirname.leafname cpm% Calls to &0005 allowed, filenames are d:filename.xtn dos% filenames are d:\dirname\filename.xtn win% running on 32-bit Windows, long filenames and SYS available unix% filenames are /dirname/filename arc% extended BASIC functions allowed nc% running on an Amstrad NC100/150/200 z88% running on a Sinclair Z88 Host OS values returned in os% include the following: -1 : Unknown 6 : Archimedes/Acorn 0 : Electron 7 : Springboard 1 : BBC 8 : Unix 2 : BBC B+ 3 : Master 128 30 : Amstrad CPC 4 : Master ET 31 : Spectrum 5 : Master Compact 32 : IBM-type PC Q8 HADFS technicalq Qinformationq   DGenerald Sectors 0-1 usually a DFS catalogue. On a data disk or a dual-boot disk, sectors 2-69 contain data, and the DFS I!Booti file is embedded in the DFS catalogue. On a system disk, sectors 2-3 contain the DFS I!Booti file; sectors 4-5 contain the DFS ISPAREi or IReBooti file; sectors 6-69 contain the HADFS ROM image. Sector 70 contains the disk name and free space map. Sector 71-73 contains the root (I$i) directory. All names are padded with spaces. DSector 0-1d Sectors 0 and 1 usually contain a DFS catalogue with a boot file to select HADFS. The first six bytes of sector zero usually contain: "HADFS",&00. 0 1 2 3 4 5 6 7 8 9 A B C D E F +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | H A D F S |&00| | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ |Flg| Disk Structure Record | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ If Flg=&0D then &11 to &1F contain a disk structure record that describes the shape of the disk. The rest of sector 0 and 1 usually contain 6502 code to load the HADFS ROM from the disk. DSector 70d 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Disk name | &00,(C)JGH,&00 | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 18 19 1A 1B 1C 1D 1E 1F HADFS disks are identified +--+--+--+--+--+--+--+--+ by this string |DskID|Date |MaxSec|Flag| +--+--+--+--+--+--+--+--+ &18-&19: DskID Disk id - created pseudo-randomly when a new disk is created &1A-&1B: Date Date of creation: &1A b7-b3: day &1A b2-b0: (year-1981)DIV16 &1B b7-b4: (year-1981)MOD15 &1B b3-b0: month &1C-&1E: MaxSec Maximum number of sectors. (Last sector number) + 1. &1E-&1F: Flag b15=0 Small Disks - 16bit Free Space Map b14: Don't overwrite disk with *INSTALL b13: Mount this drive as URD b12: Mount this drive as LIB b11: Mount this drive as CSD b10-b6: unused b5: Reserved for 16 sectors/track flag b4: Sectors 0-1 do not contain a DFS catalogue b3: Don't modify DFS catalogue b2: Partitioned disk b1: Split disk, eg 40*2 b0: Data disk b15=1 Large Disks - 24bit Free Space Map b14: Don't overwrite disk with *INSTALL b13: Mount this drive as URD b12: Mount this drive as LIB b11: Mount this drive as CSD b10-b9: unused b8: Don't modify DFS catalogue b7-b0: MaxSec b16-b23 Small Disk Free Space Map: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C ... EB EC ED EE EF F0 F1...FE FF +--+--+--+--+--+--+--+--+--+--+--+--+- - - - -+--+--+--+--+--+ - - -+---+ |Start| Len |Start| Len |Start| Len | |00 00|00| | Reserved | +--+--+--+--+--+--+--+--+--+--+--+--+- - - - -+--+--+--+--+--+ - - -+---+ Large Disk Free Space Map: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C ... EB EC ED EE EF F0 F1...FE FF +--+--+--+--+--+--+--+--+--+--+--+--+- - - - -+--+--+--+--+--+- - - -+--+ | Start | Length | Start | Length | |00 00 00| | Reserved | +--+--+--+--+--+--+--+--+--+--+--+--+- - - - -+--+--+--+--+--+- - - -+--+ The free space map is terminated by a Start=0. The last entry ends at &EB. With a full free space map, &EC/&ED/&EE contains a zero terminator. DDirectoriesd There are two types of directory. Large disks always use Large Directories. Small Disks default to Small Directories, but can use Large Directories. Small Directory layout: &000 Dir. header &0C0 Entry 8 &180 Entry 16 &240 Entry 24 &018 Entry 1 &0D8 Entry 9 &198 Entry 17 &258 Entry 25 &030 Entry 2 &0F0 Entry 10 &1B0 Entry 18 &270 Entry 26 &048 Entry 3 &108 Entry 11 &1C8 Entry 19 &288 Entry 27 &060 Entry 4 &120 Entry 12 &1E0 Entry 20 &2A0 Entry 28 &078 Entry 5 &138 Entry 13 &1F8 Entry 21 &2B8 Entry 29 &090 Entry 6 &150 Entry 14 &210 Entry 22 &2D0 Entry 30 &0A8 Entry 7 &168 Entry 15 &228 Entry 23 &2E8 Entry 31 Large Directory layout: &000 Dir. header &116 Entry 8 &22E Entry 16 &021 Entry 1 &139 Entry 9 &251 Entry 17 &044 Entry 2 &15C Entry 10 &274 Entry 18 &067 Entry 3 &17F Entry 11 &297 Entry 19 &08A Entry 4 &1A2 Entry 12 &2BA Entry 20 &0AD Entry 5 &1C5 Entry 13 &2DD Entry 21 &0D0 Entry 6 &1E8 Entry 14 &0F3 Entry 7 &20B Entry 15 Directory header Small Directories: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Directory name |Parnt|NN|CC|Link |DskID|BB|UU|First|xx xx| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Large Directories: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Directory name |xx xx|NN|CC|xxxxx|DskID|BB|UU| First | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 17 18 19 1A 1B 1C 1D 1E 1F 20 +--+--+--+--+--+--+--+--+--+--+ | Link | Parent |xx xx xx xx| +--+--+--+--+--+--+--+--+--+--+ SmallDir LargeDir &0A-&0B &1A-&1C Parnt: parent directory sector address &0C &0C NN: b0-b4: number of entries b5: reserved b6: long object names present. If long object names are present, the load and exec address fields are used to hold characters 11 to 16 of the object name and bytes &10 and &11 hold the filetype. b7: 0=small directories, 1=large directories &0D &0D CC: cycle number &0E-&0F &17-&19 Link: sector of next directory chunk, or zero &10-&11 &10-&11 DskID: disk ID &12 &12 BB: b0-b1: boot option b2-b3: reserved b4-b7: b8-b11 of user number &13 &13 UU: b0-b7 of user number &14-&15 &14-&16 First: sector of first directory chunk, or zero Directory entries Small directories: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Object name and attributes | Load Addr | Exec Addr | Len |Date |Sectr| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Large directories: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Object name and attributes | Load Addr | Exec Addr | Length | Sector | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 19 1A 1B 1C 1D 1E 1F 20 21 22 +--+--+--+--+--+--+--+--+--+--+ |CDate|MDate|MTime|User|Aux|At| +--+--+--+--+--+--+--+--+--+--+ &00 contains &00 if the entry is deleted. &00-&07 contain the attributes in bits 7: RWELRWEP &08 b7: 'D' attribute - entry is a directory In small directories: &09 b7: (year-1981) bit 4 &0D b6-b7: (year-1981) b5-b6 b5: b5-b7 of Load address &14 b0-b2: b16-b18 of length b3-b7: day of object modification date &15 b0-b3: month of object modification date b4-b7: b0-b3 of (year-1981) of object modification date In large directories: &19 b0-b2: b4-b7 of (year-1981) of object creation date b3-b7: day of object creation date &1A b0-b3: month of object creation date b4-b7: b0-b3 of (year-1981) of object creation date &1B b0-b2: b4-b7 of (year-1981) of object modification date b3-b7: day of object modification date &1C b0-b3: month of object modification date b4-b7: b0-b3 of (year-1981) of object modification date &1D b2-b7: hours of object modification time b0-b1: b3-b5 of minutes of object modification time &1E b5-b7: b0-b2 of minutes of object modification time b0-b4 seconds/2 of object modification time DExtended Directoriesd To be able to store more than 31 entries in a directory, a directory can be extended by stringing together two or more directory chunks, where a directory chunk is three sectors containing directory information. The parent directory's entry for the directory points to the sector of the first chunk. The directory chunks' Link field points to the sector of the next chunk, the last chunk's Link field being zero. Each chunk's First field points to the sector of the first chunk, the first chunk's First field being zero. Parent directory: +-----------+-----+-----------+-----+---------+-----+-----------+-----+-- |Object name| |Object name| |DirName | |Object name| | +-----------+-----+-----------+-----+---------+-----+-----------+-----+-- | +-----------------------<-+------------<-+ | | v | +---------+-----+-----+ | |DirName |Link |zero | | +---------+-----+-----+ | | | +---------<-+ | | | v | +---------+-----+-----+ | |DirName |Link |First| | +---------+-----+-----+ | | | | +---------<-+ +->-----+ | | v | +---------+-----+-----+ | |DirName |zero |First| | +---------+-----+-----+ | | | +->-----+ If the directory's parent directory entry is also in an extended directory, the Parent field should point to the parent directory's first chunk, pointed to by the parent directory's First field. DSector Addressesd HADFS uses 256-byte sectors. Sectors are addressed by a four-byte value made up as &ddssssss where dd is the drive number and ssssss is the sector on that drive. All HADFS functions use four-byte sector addresses. Small disks use 16-bit sector addresses, &000000 to &00FFFF, allowing a maximum disk size of 16M. Large Disks use 24-bit sector addresses, &000000 to &FFFFFF, allowing a maximum disk size of 4G. DMapping to physical disk sectorsd Floppy disks are usually addressed H:C:S, that is, the sectors count upwards on one side of the disk, then upwards on the other side. This is called sequential addressing. On a DFS formatted disk (10 sectors/track), the second side Ialwaysi starts at sector 800. If you format a disk with fewer than 80 tracks, then there will be a gap just before sector 800, which must be reflected by a gap in the free space map, and the Split Disk flag must be set in the disk flags. Double-sided floppy disks can also be set to C:H:S addressing, that is the sectors count along one track on side 0, then along the same track on side 1, and then back to the next track on side 0. This is called interleaved addressing. If there are more than 80 track per side, then the extra tracks continue in the same manner. HADFS defaults to sequential addressing. HADFS determines if a floppy is sequential or interleaved by looking for the Free Space Map. If HADFS can't find the FSM using sequential addressing, it looks for it using interleaved addressing. If HADFS still can't find the FSM, the disk is not recognised as HADFS. DExternal drivesd Valid drive numbers are 0-9, A-V, giving 31 drives. Current allocation is: Drive 0 First physical drive 1 Second physical drive 2 Third physical drive 3 Fourth physical drive 4 First hard disk drive 5 Second hard disk drive 6 Third hard disk drive 7 Fourth hard disk drive 8-G unallocated I Internal ROM files J-L unallocated M GoMMC RAM disk N-Q unallocated R RAM disk S-V unallocated Drives 0 and 1 are the two physical drives that are accessed as drives 0/2 and 1/3 in DFS. Accessing drives numbered above 1 causes an OSWORD call for extra software to provide access to other drives. If there is no driving software for drives 2 onwards, then the error BDrive x not presentb is given if an attempt to access it is made. The OSWORD call for the extra drives is: A=90 (&5A) XY+0: 0 Check for these values XY+1: 6 in these two locations. XY+2: \ XY+3: \ Address XY+4: / XY+5: / XY+6: \ \ XY+7: } Start sector \ Four-byte XY+8: / / sector address XY+9: Drive number / XY+10: Number of sectors XY+11: Call type and return code Call types: 1 write sectors 2 read sectors 3 request drive info 4 format 5 park heads (do not claim) &80 user read sectors &81 user write sectors To provide access to extra drives, you must intercept the OSWORD routine and check for OSWORD 90. You must Ionlyi claim the call if the first two bytes are &00,&06 and the drive number is the drive you are supporting, and the call type is less than 128. Calls 128 and above are translated by HADFS into either an OSWORD &7F call or another OSWORD 90 call. Calls 1 and 2 read and write the supplied number of sectors using the address in memory and the sector start. HADFS usually reads and writes a between 8 and 64 sectors at a time, but you should be able to cope with the full range. Call 3 should return the total number of sectors on the drive in XY+6 to XY+8 (&000000 meaning &1000000). If the number of sectors in XY+10 is not zero, the call should do a sector read, as call 2. Call 4 reserved for formatting disks. Call 5 is issued when a B*BYEb comand is used. IThis should not be claimed, as it should be passed on to other driving routines.i Calls &80 and &81 are translated by HADFS into the required calls to read either the floppy drives by calling OSWORD &7F or an external drive by calling OSWORD 90. IThey should not be claimed or recognised in any way by the driving routines.i A return code of 0 indicates that all is well and the operation was provided. A return code of 1 to 7 (ie unchanged from the call type) indicates that the drive is not present. Return codes of 8 and above are used as disk error numbers. Some of these are: &08 Clock error &0A Late DMA &0C CRC error in ID &0E CRC error in data &12 Drive read only &14 Track zero not found &16 Write error &18 Sector not found Calls &80 and &81 translate an unchanged return code into: &FE Drive not present Error &10, Drive not ready, should never be returned. The routine should retry until the drive is ready, or another error is returned. Other return codes are reported as BDisk error XXb. Selection of screen memory is taken care of by the HADFS code, and so the only i/o address supplied will be &FFFFxxxx. Addresses in the language processor should be taken care of by the driving routine using the Tube communication routines installed by the Tube code at &406. If there is no Tube present, then the supplied addresses will always be in the i/o processor, ie &FFFFxxxx. DKeyboard links, *OPT6 and *OPT7d On the BBC B and B+, keyboard link 2 is used to signify if a second drive is present. If this link is made, then B*OPT7,1b is set and HADFS assumes that there is only one floppy drive and accesses to drive 1 will be made by calling OSWORD 90, above. The first time an access to drives 0 to 7 is made, it is made through OSWORD 90, above. If this is claimed, then all further accesses to that drive are made through OSWORD 90 until the next B*HADFSb, B*MOUNTb, B*I AMb or B*BYEb. Otherwise, accesses to drive 0 to 7 are made with internal drivers. Drives 0 and 1 access the floppy drive through OSWORD &7F. To force accesses to drives 0 to 7 to use external drivers via OSWORD 90, B*OPT7,<drive>b can be used. To make drive access return to using internal drivers use B*OPT6,<drive>b. B*OPT0b resets all the B*OPT6b and B*OPT7b settings. DMaster CMOS configurationd On the Master series, some information is saved in HADFS's CMOS byte at ROMnumber+30. The information stored there is the number of channels set with B*OPT5b and the B*OPT6,1b or B*OPT7,1b setting. These can be shown with B*STATUS HADFSb. When running on a BBC B, HADFS provides a B*STATUSb command to display the settings set by B*OPT5b, B6b and B7b. It also shows the current date setting. HADFS stores the following information in it's CMOS byte at ROMnumber+30: bits 0-3: unused bits 4-5: 5-(number of channels) bit 6 : Drive 1 external (B*OPT 7,1b) bit 7 : unused The top four bits are inverted after reading and before writing, so a CMOS value of &00 gives 5 channels and internal drive 1. DChanging default drivesd After a B*MOUNTb with no parameter, or after startup, HADFS needs to decide what drive to use. It does this by examining each disk present and then calling three OSBYTE calls to see if there is some software that wants to change the default drive. Normally, HADFS defaults to drive 0 if not told what drive to use explicitly. The OSBYTE calls are: A=90, X=6, Y=64 Look for default drive A=90, X=6, Y=65 Look for default library drive A=90, X=6, Y=66 Look for default user drive When there is a file access after a B*MOUNTb or a startup, HADFS checks the disk flags on each drive from 31 down to 2. Then, OSBYTE 90,6,64 is called to see if there is a default drive to set the CSD to. If there is, the URD and CSD are set to this. OSBYTE 90,6,65 is then called to see if there is a default drive for the Library directory. If there is, then the directory I$.Libraryi is looked for on that drive. If there isn't, then the LIB drive is set to the CSD drive (which may have been set by OSBYTE 90,6,64), and I$.Libraryi looked for there. If the OSBYTE call is not claimed, then the MOS sets the X register to &FF. If some software claims the OSBYTE call and sets the X register to a drive number, this will be in the range &00 to &1F for drive :0 to :V. HADFS checks bit 7 of the returned X to see if the OSBYTE call has returned a drive number. This means that lower numbered drives have mount priority over higher number drives, and software responding to OSBYTE 90 has priority over any disks present. The program IIntern/si demonstates various OSBYTE call claiming when creating a drive in sideways RAM. It also shows how to call the Tube code for communicating with a second processor. DHADFS memory used HADFS uses the following pages of memory: &0E00 Channel 25 buffer &0F00 Channel 26 buffer/FSM buffer/used for last few bytes of LOAD &1000 HADFS information &1100\ &1200 } Current directory &1300/ &1400 Channel 27 buffer &1500 Channel 28 buffer &1600 Channel 29 buffer private w/s: HADFS information when HADFS not selected. Channels 27 to 29 are only available if the memory is available. B*OPT5b can be used to limit the number of channels available and the amount of memory used. B*OPT5,0b tells HADFS to use as little memory as possible. If another ROM reserves sufficient absolute workspace with service call 1 (eg DFS), then HADFS will use all the memory available. Channel 26 is always used for input, as its buffer is also used for other purposes, and keeping channel 26 input-only means that HADFS doesn't have to keep saving the buffer to disk. The lowest value that PAGE can be moved to is: &1700 Loads/Saves/up to 5 channels open &1600 Loads/Saves/up to 4 channels open &1500 Loads/Saves/up to 3 channels open &1400 Loads/Saves/up to 2 channels open &0E00 No access available DBreak and Resetd Most of HADFS's information is preserved over a EBreake or ECtrl-Breake. All channels remain open and the CSD, URD and LIB remain selected. On a ECtrl-Breake, any open channels are abandoned. On a EShift-Breake, a B*I AM BOOTb command is issued, which abandons any open channels, mounts the default user drive and starts any auto-start sequence. Pressing ECtrl-CapsLock-H-Breake will disable HADFS in the same way as B*FX90,6,1b. Q9 HADFS as anq QEconet environmentq   HADFS disks have a similar structure to the file structure on Econet fileservers. Files have public and owner access strings, and directories can be given user numbers. Files and directories can be given a three-byte account number or user number using B*ACCOUNTb. When a directory is logged into with B*I AMb, then its user number becomes your current user number. When a file or directory is created, it is given the same user number as the directory it is in. You cannot do any modification actions in a directory that you do not own, and any files can only be accessed according to the right-hand (public) access string. B*MOUNTb sets your user number to 000. B*I AMb to a non-existant directory does the same as B*I AM $b on the default drive. Small directories only store the account numbers of directories. Files default to the account number of the directory they are in. Large directories store the account number for individual entries. Entries can be made private by setting the 'P' option with B*ACCESSb. If an entry is private, it cannot be seen if you do not own the directory it is in. The INFSFronti ROM created by IExtras.NFSFront/si provides OSWORD &14/0 (file-server interface) to simulate a file server and supports the following functions: 14: Read disk names 15: Read users -> returns a pre-set list 16: Read date and time -> returns 00:00:00 on 00/00/1981 25: Read server version -> returns NFSFront version string 26: Read free space -> returns zero free space B*OPT2,5b will make OSARGS 0,0 return A=5, so pretending to be NET. The program INFSTesteri in the IExtrasi directory tests some of the functions. Any other Econet-type programs will be in directory IExtras.Econeti. �ault user drive When there is a file access after a B*MOUNTb or a startup, HADFS checks the disk flags on each drive from 31 down to 2. Then, OSBYTE 90,6,64 is called to see if there is a default drive to set the CSD to. If there is, thHADFS Program History ===================== Version Release Date Remarks 0.03 03/03/1990 Very early non-documented version. 0.11 05/07/1990 Version string added to HADFS title strings. Parameters added to *INSTALL, and modified to do the previous work of *FORMAT, which has been removed. Multiple drive facilities added. Status messages on Master added. 0.12 01/09/1990 Loads and saves to screen memory at &FFFExxxx now supported. OSFILE 5 allowed on root. Load and save modified so that &FFxxxxxx refers to i/o processor instead of &FFFFxxxx. Bug removed from *RUN in second processor. Can do *INFO on special directories, eg *INFO @. 0.13 20/09/1990 *SETDATE command added, and OSWORD 14 call to provide a TIME$ string. Files date-stamped by reading date with OSWORD 14. Directories don't have the date set correctly. 0.14 30/10/1990 HADFS can be selected with the *HADFS # command which ignores checking for the presence of DFS ROM. This is so it can work with DFS 0.90 which doesn't support service call &12. *BACKUP and *ENABLE added to the command list, though no code written yet. Slight problem when DFS not present on a Master. Error message 'DFS OSWORD &7F not present' given, but shadow screen switched to for access, but not for display. In general, there are some bugs in code which accesses shadow screen memory which need rewriting. In normal use, they don't appear, but they need clearing up. 0.14a 06/11/1990 Removed bug from selection with service call &12. Used to give a 'DFS ROM not present' error if no DFS ROM present. Now it doesn't. Only *HADFS gives the error if there's no ROM. Access strings are shown in the order 'LWR' instead of 'WRL'. Bug in OSGBPB 8 corrected that counted empty entries in the directories instead of ignoring them. Bug with free space set to &xx00 removed. 'Length too long' error has same number as 'Disk full'. Various OSFILE actions on '$' modified. Load, save, delete and create all generate 'Can't modify root' error, all others return control block information. Boot option moved from byte &11 in directory sector to byte &12, and disk ID at &10 extended to &10-&11. 0.15 04/01/1991 *INSTALL routine rewritten to set the disk ID on new disks, and the 'X' parameter removed. HADFS selection with *HADFS and service call 3 modified to check DFS presence with *FX143,18,4 and then select HADFS with service call 18 so as to correctly work on the Master. OPENUP and OPENOUT no longer return errors; OPENUP does an OPENIN, and OPENOUT returns a zero file handle, indicating no file opened. *FREE displays free space and *MAP displays free space map. 'EOF' message changed to 'End of file'. Problem with selecting NFS solved. Stopped shadow screen from accidently switching in on disk errors. Deleting zero-length files no longer adds a zero-length entry to the FSM. 0.16 07/01/1991 *INSTALL routine puts disk size on disk so *FREE can work correctly. All file entries now return registers in defined states (ie preserved). OSARGS 4,0 and 5,0 and 5,Y written. *INFO $ changed slightly to show disk size and ID. OSGBPB 6 and 7 return the drive number. *ENABLE works and checked for in *INSTALL and *BACKUP. 0.17 08/01/1991 *INSTALL routine finished, and has a <size> parameter for different sized disks. Drive access via OSWORD 90 correctly sets up control block. *INFO $ doesn't attempt to print HADFS version if not installed. 0.18 09/01/1991 OSGBPB 1-4 written, but quite slow as they just perform multiple calls to BPUT and BGET. OSFILE 8 (CDIR) creates a locked directory. 0.19 01/02/1991 After a *MOUNT, LIB is set to :0.Library if it exists. 0.20 15/02/1991 The DFS !Boot file loads in the ROM image correctly with the Aries-B32 and the Watford ROM/RAM board. Shadow screen memory is supported on the Aries-B32 and Watford 32k RAM board as well as the Master. The problem with running an exec file in the library has been solved. Error message 147 'I cannot run this code' added. 0.21 24/02/1991 HADFS works on MOS 3.50, but can only read disks. Hidden commands *STATUS and *CONFIGURE added. 0.22 03/03/1991 Drive 1 may be external, as set by keyboard link 2 or by CMOS ram byte. Drive 0 may be external if claimed by OSWORD 90. 0.23 10/03/1991 Solved problem of selection on B+. 0.24 30/03/1991 '30' and '31' correctly printed out in dates, and *CDIR sets the creation date correctly. *OPT 6 sets if drive 1 internal or external and saved in CMOS ram byte. 'Acorn Era' extended by doubling dates from 1981-1996 to 1981-2012, though dates after 1999 not displayed correctly. Appears to work fully on the B+. 0.25 Made a mistake somewhere, so abandoned and went back to 0.24 0.24a 01/05/1991 Corrected version of 0.25. Loading to page &F possible. Minor tidying-up done. 0.27 10/05/1991 *INSTALL will create data-only disks. *INFO $ reflects this. INSTALL size 40/2 corrected so side two is correct size (&190 instead of &320). 0.28 14/05/1991 OSWORD 90 calls &80 and &81 added to read/write sectors without having to know if it's an internal or external drive. Doesn't check for screen selection at &FFFExxxx and &FFFDxxxx yet. 0.29 20/06/1991 OSARGS extended to return version number, and last drive used. Also reading workspace info. 0.30 07/07/1991 Lots of random access stuff rewritten. Close works for all channels, though no update for output buffers yet. BGET/BPUT check fully the channel (Not open for read/update, etc.). Openin gets file info (D/W/R). The *OPT5 setting obeyed correctly, Close#0 correct. OSARGS 5 reads allocated space. Starting to write output routines. OSFILE &FD returns full sector start (sector start + drive number). 'Disk Error' messages correctly show side two, 'Sector error' correctly shows which sector. Accessing tracks 160+ now possible. (They map onto trk 80 side 0, trk 80 side 1, etc.) Major modification: if a disk error occurs on a floppy, which is not a write error, a retry occurs. This cleans up almost every disk error message. Error &18 (sector not found) does a seek to track 0, then retries. 0.31 20/07/1991 OSFILE access to '$' returns more information. Removed bug that *CATted a file. General tidying up. 0.32 02/11/1991 *FORM command written. Data disk !Boot file reprompts for a system disk. System disk !Boot file runs *ReBoot if no sideways RAM found. Allows another program to be called instead. 0.33 20/12/1991 *FORM command correctly formats DFS disks. Loading while file open flags the input buffer. System !Boot files retries reading in ROM image if loading fails. This helps with 3.5" drives. Fixed OSGBPB 1/3 with supplied PTR. 0.34 01/01/1992 Moved parts of workspace around to make workable with Watford DFS.... open routines.... 0.35 01/02/1992 \ - I accidently lost this part of this file. 0.36 08/03/1992 / In general, *FORM debugged, various things tidied up. 0.37 15/03/1992 OSWORD 90 now uses the general purpose multiple sector disk access routine used by load and save. This means it correctly steps over track boundaries, and so can access more than 10 sectors at once. It also does better re-tries on errors. Tidied up and re-written load routine. Now a bit faster, and I will be able to use it to speed up OSGBPB reads. Stopped corrupting location &10FF (chn25 alloc high byte) when reading disk name. 0.37a 06/04/1992 *RENAME now written and works. Can rename files and directories. CAUTION: Circular rename not yet checked for!! This means you can hide whole chunks of disk by doing something like *RENAME FRED FRED.JIM. 0.38 10/04/1992 Circular rename checking fully implemented in *RENAME. Also, can do *RENAME FRED Fred changing the case of an entry. All OSARGS entries re-written, and OsBput written so that output files will work. Haven't completed the close routine for output files yet, so OPENOUT and OPENUP are disabled. 0.39 20/04/1992 OPENOUT and OPENUP written! Delete won't delete open files, and directory checking is tidier. *Run of FFB-filetyped files bootstraps BASIC. 0.40 26/04/1992 All random access routines work properly. Extend to following free space works. Drive numbers extended to 0-9, A-V. Pathname searching tidied up, and checking for changed disks, especially when saving, etc. OSFILE 5 on "JIM.FRED" where JIM doesn't exists returns A=0 instead of Not found. BASIC bootstrap only allowed with null name. Disk access routines tidied up considerably, preserving registers so the calling routines don't have to preserve them. 'Drive not ready' error never returned - it just retries. 'Drive not present' error changed. *OPT5 temporarily disabled. 0.41 01/05/1992 Fixed two bugs that appeared in v0.40 - Master forgot to reselect on Break, and loading last sector to second processor was ignored. 0.42 01/06/1992 Tidying up - routine that finds a free slot for a filename. OPENIN used to fail if file was at EOF. *RENAME checks full path of new filename. Can write to disks with Master MOS 3.50. 0.43 12/07/1992 *OPT5 now works again. Tidied up *OPT routines, and removed bug from CMOS routine that inverted *OPT6 setting. Temporary selection of HADFS now works, HADFS works fully in the Master temporary filing system handler. 0.44 02/08/1992 *INSTALL routine rewritten and tidied up. Accepts more varieties of size parameter, including size in K and number of tracks. No longer need to do *INSTALL twice to install new ROM image, and removed 16-character disk-name problem. General hex/dec number reading routine replaces separate hex and decimal routines. *INFO $ displays size in K if between 128k and 959k. Split disk displayed as number of tracks, eg as 40/2. *FORM uses new routines. 0.45 27/09/1992 *TIME and *CLOSE commands added. *STATUS displays current time if set. *SETDATE with no parameters disables HADFS CMOS clock function. *MOUNT can take a drive parameter, selecting that drive. *CAT routines tidied up - no longer checks disk twice. Started writing Archimedes HADFS Reader application. 0.46 15/11/1992 EXT not set to zero when overflows at &7FFFF. User number displayed as three digits. *FORM formats better and skews sectors. Completed RISC OS HADFS Reader application. 0.47 06/12/1992 Time routine (OSWORD 14) returns time. This can be set using TIME=((hours*60)+minutes)*60*100. OSWORD 14/2 supported (convert BCD time to text string). Compact displays 'No date' if no date. *FX90,6,2 and *FX90,6,3 select HADFS with *fx143,18,16. 0.47a 12/11/1993 Tidied up Serv7 and system !Boot files; !Boot on Compact doesn't clear memory. Osbyte 90,6,64 to 90,6,127 ignored, to be claimed by other ROMs. 0.48 25/11/1993 Tidied up disk errors. All errors report sector as d:ssss, instead of d:tt/s. TIME remembered over Ctrl-Break. Usernumber extended to 12 bits. CSDNUM/LIBNUM replaced by OWNER, PRIV extended to PRIV and OPTNUM. FindLib routine checks for external libraries. *I AM routine tidied up. *INSTALL <cr> sometimes replaces disk title. *FORMnn sometimes sets incorrect disk size. OSGBPB correctly returns CS on EOF. TreeCopy correctly allows disk swapping in same drive. *COPY command supplied on disk. *SETUSER only sets 8 bits. 0.48a 20/12/1993 *INSTALL correctly puts year>1997 and *INFO $ reports it, all dates after 1999 correctly handled, HADFS is fully Y2K compliant! *FORMnn disk size not corrupted by date. *RUN and */ with no name gives Bad filename. Occasional problem with joining last two entries in FSM. VisCompact checks for sector allocation clashes. TreeCopy rewritten to be fully error trapped and to read as much as possible before writing. 0.49 07/01/1994 *MOUNT, *I AM and context checking rewritten. If *MOUNT with no drive given, context checking checks Osbyte 90,6,64..65 for default drive. The word 'Version' removed from version string. 0.4A 17/01/1994 OSGBPB completely rewritten to speed up using direct sector access. OSGBPB 8 will return more than one entry. OSGBPB 9, 10 and 11 return directory information. Cannot currently do OPENIN("$") yet, though. *INFO $ displays a split disk as 40*2, *INSTALL accepts *2 as well as /2. /2 and old =<nn> removed from *INSTALL ? help text; =<nn> not recognised, &<nn> should be used. *INSTALL ? help text temporarily removed to save a bit of space. 0.4B 02/08/1994 File running completely re-written; much tidied up. HADFS as a libfs now implemented. *INSTALL ? help text restored. OSGBPB correctly reads zero bytes if at EOF; extending past EXT correctly decrements by 256; *SRSAVE in MOS/DFS works. OSGBPB 5 works. Version byte in ROM header now holds 10*version number (ie 4). Default language code removed; ROM now service-only. Language entry points to service 3 boot routine. *FORM remembers drive number (important!). 0.4C 12/01/1995 Unused boot options 4 to 7 removed. *TITLE command added, alias for *INSTALL. Disk name on *CAT correct. Oddity: *FORM leaves *ENABLE set on. *INSTALL no longer accepts /2, must be *2. 0.4D 25/05/1995 *HADFS # option and error message removed. OSGBPB 9,0 returns command line parameters. <drv> added to *TITLE help text. HADFS selection checks for OS 3.50 again. 0.4E 10/08/1996 Sector addresses tidied up. Sector Error is now Sector Not Found. *SETUSER renamed to *ACCOUNT. *ACCOUNT sets full 12-bit account number, and will accept and ignore auxilary account as (nnn). Ctrl-Caps-H-Break turns off HADFS. 0.4F 09/09/1996 OSFILE massively tidied up. Access to root directory corrected, so OPENIN("$") fully implemented. Extended directories reduced when removing entries. Screen selection routines tidied up. Control block can be in screen memory while accessing shadow memory. Cataloguing extended directories no longer displays a blank line between chunks. Directories auto-extend. *RENAME no longer looses temporary information when dealing with moving entries in extended directories. OSFILE &FD returns user number. *SHUT reselects old FS if called while HADFS not current. *\name implemented, matches to FS commands via FSCV3 only, without passing it to disk files. Slight problem with *MAP and *FREE occurs if FSM terminator not followed by another terminator. 0.4Fa 09/01/1997 Unbalanced stack bug in *RUN and *FORM fixed. 0.4Fb 04/06/1997 Calls to &FFE4 corrected to be OSNEWL at &FFE7, *Info $ displays system disk version correctly. *COPY in ROM on Master series by using *MOVE, BBC runs from disk. Loading last sector to second processor corrected. Full date in version string (try using */ROMS V to see). Drive x not present error incorrectly returned as Not an HADFS disk. Commands don't need to be terminated with a space if followed by a non-letter, previously all characters from 'A' onwards were treated as letters. This allows, for example, *DIR^. 0.50 01/09/1997 FSM loading correctly clears channel 26 buffer flag so BGETs correctly restore from disk. Drive x not present correctly given instead of Not an HADFS disk. Extending an output file updates correct directory entry by looking for non-zero length, and length correctly set to alloc size. 'X' error no longer caused by trying to access sectors>=&A00. If no clock on Compact, reads date as 00/00/00. Close checks for disk changed, if error happens on close, channel abandoned. Drive not present returned instead of DFS OSWORD &7F not available. *FREE output altered slightly. 0.51 01/02/1998 Displays 'E' attribute correctly, EXT#c=n stack imbalance corrected. Reading RTC on Master corrected and stored correctly on B and Compact. Extending directories no longer wrongly sets FIRST in first chunk; reducing directories now works correctly. Disk CRC error messages changed slightly. OSGBPB 9/10/11 correctly returns count=0 if no filename returned; OSGBPB 10/11 can scan current directory if XY+0=0. Still problems with: *RENAMEing on disk separate to CSD; Using BPUT to extend zero-length file; saving after reading date from fileserver; *COPY -net-file -hadfs-file sets 'E' incorrectly. 5.20 01/06/1998 Version numbers displayed as binary version / 10 (ie, 5.20) instead of / 100 (ie 0.52). Drive1 flag stored in startup byte instead of being copied internally. Command word termination with a a non-letter works again, allowing, for example, *DIR^. 5.21 01/07/1998 Reading RTC corrects year overflow in date. OSGBPB 9/10/11 routines temporarily removed to save space. Drive 1 status checked directly in OSBYTE 255 instead of double-copying it. 5.22 01/08/1998 Patched to prevent memory corruption when reading RTC from NetFS on Compact. MOS350 flag cleared. 24/02/1999 Fixed bug in GetEnv in ProgLib that didn't skip enough spaces on Arc. 5.23 31/03/1999 Ensures absent keyboard checked for even if HADFS is disabled. 5.24 01/05/1999 Source code reformatted as text. RTC patch preserves more workspace so OPENOUT(nf) doesn't lose handle. 5.25 5.26 / / *INSTALL uses same boot code for data and system disks, *INSTALL and *FORM routines rewritten with full source comments. All code can cope with 4Gb disk sizes. OSGBPB9/10/11 will fit in again. 5.27 / / Floppy access code considerably tidied and speeded up. Access to external drives cleaner. *OPT7 used to select external drivers. *OPT40 and *OPT80 allowed, but do nothing. 5.28 5.29 / / Integrated GoMMC driver for drive M. 5.30 16/09/2004 Integrated IDE driver for drives 4 to 7, commas used in *FREE output, checks disk flags for default drives. IDE driver doesn't work across Tube. Relinquishes workspace if another filing system takes over as DFS 2.xx doesn't pass service call &0A on. 5.31 03/09/2005 Transitional version, only works on Masters. Workspace rearranged to create space for 24-bit random access. All core routines pass and return 24-bit sector addresses. Channel information still holds 16-bit information. 5.32 06/09/2005 24-bit channel information laid out. 5.33 08/09/2005 Workspace rearranged to accommodate DFS. *CAT blank lines on BBC fixed. *OPT2/3 is offset to myfs/auxfs. GrabAbs does ClearDIR, SetDate tidied. IDE drivers work with Tube and uses 24-bit access (4G drives), OSGBPB 5/6/7 does CheckNames on CSD drive. HEdit displays 24-bit sectors. !Boot program updated. IDE result codes need translating to 8271 codes, *FORM removed to save space. 5.40 12/09/2005 IDE error codes translated, accessing MMC doesn't blank out VFLG. *BACKUP can use fs: prefix. *CAT doesn't emit extra blank line if a directory holds 4n+2 entries. HUtils has option to set drive boot options. 5.41 / / Workspace moved to &E00 to avoid being corrupted by DFS on BBC B+. 5.42 12/05/2007 Tidied up source code. 5.50 17/05/2007 Full 'Acorn Era' 7-bit year range storable, extending date range from 1981-2012 to 1981-2108, though dates after 2099 not displayed correctly. Utils G� ��������DMap H?PuBxNHDIni N?�أ^HEdit N?<][wHUtil J?S=@)xAInter/s L?`M(pvMCat @?�4#0sRescu C?�rHSetDae H?�.tw`VisCopacH?]vx����������������8Ш0` X  LHADFSROM  Press BREAK�No SRAM �Not a system disk��`��_�NullKeyboard�0.12 (01 Aug 1998)�a�`��4�SoftRTC�0.10 (23 Nov 1992)�(Untitled_Disk) �(C)JGH�������������������������������������������������������������� D?�5%MCode �r��_z��g$MDump � ?0 �-Mouse = ?I 5/pc8s L?Tv@q1PrLis ? 3Repai �r��y��=p6Repea jq���{��x q?ROMS � ?� JScrLod ?@LScrol ^���{��6O �  > DMap 1.30a 12-Aug-1998 � Visual compaction program �+23,128,&88,&11,&22,&44,&88,&11,&22,&44 �()23,129,&3F,&40,&4F,&50,&4F,&40,&3F,0 �2#23,130,&FF,0,&FF,0,&FF,0,&FF,0 �<)23,131,&FE,&01,&F9,&05,&F9,&01,&FE,0 �F)23,132,&7F,&41,&41,&41,&41,&41,&7F,0 �P)23,133,&7F,&40,&40,&40,&40,&40,&7F,0 �Z23,134,&FF,0,0,0,0,0,&FF,0 �d23,135,&FF,1,1,1,1,1,&FF,0 �n23,136,&FF,0,0,0,0,0,0,0 �x#23,137,&88,0,&22,0,&88,0,&22,0 �)23,138,&3F,&40,&40,&4F,&40,&40,&3F,0 �!23,139,&FF,0,0,&FF,0,0,&FF,0 �)23,140,&FE,&01,&01,&F9,&01,&01,&FE,0 �7&80:"HADFS Disk Map ";:OSGBPB=&FFD1:OSFILE=&FFDD �DA%=132:(&FFF4 &FFFF00)256<P+&400:"- Not enough memory.": � *HADFS �""Drive: "drv$:"DIR :"+drv$: �(dv%=8-(ver>&4D):nm%=dv%+1:ct%=dv%+2 �V"HADFS Disk Map - Dir. - File - Free space - Unallocated" �80,"_");0,12);80,136) �%0,13);80,"_");0,24);80,136) �0,25);80,"_") �> ctrl% 20,ctrl2% 20,FSM% 256,name% 20:total%=&200:flen%=0 BX%=&70:Y%=0:E%=0:A%=5:&FFDA:free%=!&70:A%=4:&FFDA:used%=!&70 NA%=&FE:drive%=(&FFDA)&FF:tot%=(used%+free%)256-1:sz%=2:tot%>&7CF sz%=1 @"MOUNT "+drv(drive%):l%=0:l2%=79:l%+l2%>tot% l2%=tot%-l% "tot%>=l% fill(l%,137) ,#l2%>0 l2%,137);:l%=l%+l2%+1 6 l2%<>79 @0,2);"**";:$(name%+1)="$":A%=info:(ctrl%!8 &8001)=0:"##< - - - - - - - - S y s t e m F i l e s - - - - - - - >":total%=70*256 J fill(70,64):esc%=0:*FX229,1 ^Dflen%=total%:!name%=&2401:_DoFile(0):clash%=flen%-total%:*FX229 h esc%: r0,29);(used%+free%)/1024;"K disk ";total%/1024;"K used ";free%/1024;"K free ";clash%/1024;"K clash ";:x%=:tot%=total% |$total%=0:dk(&80,70):Fptr%=&20: Ml%=(FSM%!Fptr%)&FFFF:s%=l%l%+(!(FSM%+Fptr%+2)&FFFF)-1:fill(s%,128): )Fptr%=Fptr%+4:((FSM%!Fptr%)&FFFF)=0 ]x%,29);(free%-total%)/1024;"K FSM clash ";(used%-tot%+(free%-total%))/1024;"K unused" 90,30)20"(M)ake new FSM"8"(S)ave current FSM";:13 A$=(&DF):"MS",A$) (159);13; A$="M":MakeFSM: A$="S":SaveFSM:  : _DoDir(level%)  A%,X%,Y%,index%,ret% index%=0: X%=ctrl%:Y%=X%256:A%=8 3ctrl%!1=name%:ctrl%!5=1:ctrl%!9=index%: OSGBPB 0ret%=ctrl%!5:index%=ctrl%!9:(-1):esc%==27 & ret%=0 _DoFile(level%) 0ret%<>0 esc% : D_DoFile(level%) N% file$,A%,X%,Y%,sect%,length%,l% X2?(name%+?name%+1)=13:file$=$(name%+1):A%=info bLlength%=(ctrl%!10+255)&7FF00:sect%=(ctrl%!14)&FFFF:flen%=flen%+length% lu A%=2 fill(sect%,129):fill(sect%+1,130):fill(sect%+2,131):chk_ext:"DIR "+file$:_DoDir(level%+2):"DIR ^": vlength%=0 $length%<&101 fill(sect%,132): fill(sect%,133) Clength%>&200 l%=sect%+1 sect%+length%256-2:fill(l%,134): $fill(sect%+length%256-1,135): Cݤinfo:!ctrl%=name%+1:X%=ctrl%:Y%=X%256:A%=&FD:=( OSFILE)&FF 3fill(sect%,char%):A%=135:sect%>=2600-sz%*2: l31,sect%80,2+sect%80-sz%*(sect%>799)-sz%*(sect%>1599):A%=(&FFF4 &FF00):A%=&8900:total%=total%+&100  char%:  chk_ext *dk(&80,sect%):sect%=(FSM%!14 &FFFF) Rsect%:fill(sect%,138):fill(sect%+1,139):fill(sect%+2,140):flen%=flen%+&300 sect%=0: dk(op%,sect%) ;!ctrl%=&600:ctrl%!2=FSM%:ctrl%!6=sect%:ctrl%?dv%=drive%  ?ctrl%?nm%=1:ctrl%?ct%=op%:X%=ctrl%:Y%=X%256:A%=90:&FFF1: :  MakeFSM:0,0)(80) *)Dptr%=&20:s%=2 (used%+free%)256-1 4tfill(s%,0):A%=&8900 A%=&8000:Dptr%=Dptr%2:FSM%!Dptr%=FSM%!Dptr%+1 Dptr%=((Dptr%+2)&FFFC):FSM%!Dptr%=s%+1 >>2.5*(Dptr%31),Dptr%32-1);"000"+~(FSM%!Dptr%),4);" "; HDptr%>&E0:s%=999999 R:dk(&81,70):0,30);: \: f SaveFSM p'Dptr%=&20:X%=ctrl%:Y%=X%256:A%=7: z($name%="FSM_"+~((FSM%!Dptr%)&FFFF) A!X%=name%:X%!2=0:X%!6=0:X%!10=0:X%!14=(!(FSM%+Dptr%+1))&FF00 1&FFDD:Dptr%=Dptr%+4:(FSM%!Dptr% &FFFF)=0: :ݤver:A%,X%,E%,Y%:X%=&70:A%=&FD:&FFDA:=?&73+256*?&72 ݤdrv(A%)=(48+A%-7*(A%>9)) HDInit N���W; �  > HDInit �!&87:O:B$="1.11":Q%=:Q%= �Q%:L%=F:L%<>8:"FADFS" �Q%:"MOUNT 0" �L%<>8:"FX143,18,"+L% �Z%=:Z%= �Z%:L%=F:L%<>16:"HADFS" �  > HDInit �!&87:O:B$="1.11":Q%=:Q%= �Q%:L%=F:L%<>8:"FADFS" �Q%:"MOUNT 0" �L%<>8:"FX143,18,"+L% �Z%=:Z%= �Z%:L%=F:L%<>16:"HADFS" �L%<>16:"FX143,18,"+L% �L%=16Q%:D%=4 �H:N: �&87:G:N:  N:: ݤH:::A%=100:=-1 ,fO:l%31,B%511,C%512:X%=l%:Y%=X%256:F%=0:D%=0:H%=:R%=256:M%=:A%=05114:C%!A%=0::Q:*FX219,9 T hݤG::" BBC IDE Hard Drive Initialiser "B$'38,"="):E:'"D: Select drive I: Investigate drive":"S: Scan for size Z: Set drive size":"F: Format drive W: Wipe data (";"on",H%);"off",H%);")" /M%:"R: Randomise data <TAB> Toggle width" w'6"Press a key or X to exit:";:A$=:9+"*DdIiFfWwRrSsXxZz",A$):13;32;13;:A$="*""*"A$:A$:A$="":A$="*" A$=(A$&DF):A$="D":M:=0 A$="F":J:=0 A$="I":F:=0 A$="S":P:=0 A$="W":H%=H%:=0 A$="R":K:=0 A$="Z":I:=0 A$=9:符-1:R%=768-R% A$=9:-1:M%=M% & =A$="X" :GE:" Current drive: ";~D%;:D%<4:_%=D%2:" (IDE device ";_%;")"; X*D%>3:_%=D%8:" (IDE device ";_%;")"; vV'" Device width: ";R%32;" bits":M%:" Model: "B(C%+54,20)'12;B(C%+74,20) !M%:" Firmware: "B(C%+46,8) "M%:" Serial: "B(C%+20,20) '" Total sectors: &";D(F%,8)" (";(F%/(51.2*((D%4)+4)))/10;"M)":" Physical size: C:&";D(C%!&02,4);" H:";d(C%?&06,2);" S:";C%?&0C:" Logical size: C:&";D(C%!&6C,4);" H:";d(C%?&6E,2);" S:";C%?&70 [" 8-bit Size: ";d(F%4,8);"K (";(F%/409.6)/10;"M)":D%<4:L(D%,14,&200000,"ADFS") "D%>3:L(D%,12,&10000,"HADFS") 38,"="): KL(d%,m%,n%,C$):d%=d%m%:" ";C$;" drives:";:O%=F%:A%=n%:O%<A%:A%=O%  B16);~d%;": ";(A%/409.6)/10;"M";:O%=O%-A%:A%=n%:O%<A%:A%=O%  P27);~d%+1;": ";(A%/409.6)/10;"M":O%=O%-A%:d%=d%+2:d%=2d%=4d%=8d%=12: H=M:"Enter logical drive (0-B) :"A$:A$>"`":A$=(A$-32) \@"0123456789AB",A$):D%=("&"+A$):F%=0:A%=05114:C%!A%=0: f zF:Y%:A%=05114:B%!A%=0::!U%=B%:Y%=_%*16:c%?1=R%256-1:o%:A%=0255:C%?(A%*2)=B%?A%:C%?(A%*2+1)=B%?(A%+256)::C%?3+C%?109+C%?115=0:C%?109=C%?116:C%?115=C%?108:A%=(256*C%?109+C%?108)*C%?110*C%?112:C%?3=(A%((C%?6)*(C%?12)))256 F%=C%!&72: ԃP:"Scanning drive ";D%:G%=&800:G%=G%+G%:C(G%)<>0G%>&1FFFFF:V%=G%2:e%=-1:G%=G%+V%*e%:A%=C(G%):V%=V%2:A%=0:e%=1e%=-1 V%<1:F%=G%-1:: .LݤC(G%):13;"Drive size: ";G%4;"K ";:Q%:=A(&08,B%,&100,G%-1,D%)=-1 L_I:"Enter drive size, use <size>, &<size>, <size>K or <size>M :"A$:A$,1)="&":F%=A$: j%A$,1)="K"A$,1)="k":F%=A$*4: t(A$,1)="M"A$,1)="m":F%=A$*4096: ~F%=A$256: J:F%<1:F `%=&200000:D%>3:`%=&10000 I%=F%:(D%5)=1:I%=I%-`% I%>`%:I%=`% 1I%<0:"No space on for drive ";D%;:C(200): ,I%<&1000:"This appears to be a floppy" Θ"Format ";"H",(D%5)=4);"ADFS drive ";D%;" to ";I%4;"K (";I%4096;"M)":A$="":(D%3)=0D%=2:"Leave space for ";"H",D%<4);"ADFS system? ";:""A$ gf%=A$,1)="Y"A$,1)="y":"Format? Enter YES to confirm: "A$:A$<>"YES":"Not formatted";:C(200):  D%<4:H � D%>3:G   QG:!X%=1:A%=14:&FFF1:A%=06:X%?A%=~X%?A%::?X%<81:?X%=19+?X%?X%=?X%-81 F;i%=(?X%16)+8*X%?2+256*X%?1+4096*(?X%15):J%=2:f%:J%=7 Z!a%=(65535):B:H%:D(&46,D%) $B%="IDEDISK"+D%+" ":$(B%+16)=0+"(C)JGH"+0:B%!24=a%:B%!26=i%:B%!28=&411DFFFC:B%!32=J%:B%!34=&46-J%:B%!36=&4A:B%!38=&FFFC-&4A:B%!40=0:A(&46,D%):B:H%:D(&47,D%) U$B%="$ ":B%!10=&47:B%!14=0:B%!16=a%:B%!20=0:A(&47,D%):B:H%:A(&48,D%) @H%:A(&49,D%) T9"Drive ";D%;" initialised to 16383K (16M)":C(200): rH:J%=7:f%:J%=&40000 B:B%!0=J%:B%!252=I%:B%?255=0:B%?255=E:A(0,D%):B:B%!0=I%-J%:B%!251=(65535):B%?253=0:B%?254=3:B%?255=1:B%?255=E:A(1,D%):B:H%:D(2,D%) 03$(B%+1)="Hugo":B%?5=0:A(2,D%):B:H%:A(3,D%) bH%:A(4,D%) lH%:A(5,D%) B:H%:D(6,D%) $(B%+204)="$":B%!214=2:$(B%+217)="$":$(B%+227)="":$(B%+251)="Hugo":B%?255=0:A(6,D%):"Drive ";D%;" initialised to ";I%4;"K (";I%4096;"M)":"**WARNING** You *MUST* reset ADFS to"'"prevent disk corruption.":C(200): B:A%=02554:B%!A%=0::  HݤE:S%:S%=255:A%=2540-1:S%=(S%+S%256)255:S%=S%+B%?A%::=S%255 4rK:"Randomise contents of drive ";D%;"?":"Enter YES to confirm: "A$:A$<>"YES":"Not randomised";:C(200): Rp"Press ESCAPE to terminate ";:G%=0:6,8);D(G%,6);:A%=0255:B%?A%=(255)::A(G%,D%):G%=G%+1:0: A(G%,K%):b%=p% lD(G%,K%):b%=q%:!U%=B%:g%?2=G%:g%?1=(G%&FF00)256:?c%=1:c%?1=0:K%<4:g%?0=((G%&FF0000)65536)(K%*32)  K%>3:g%?0=(K%3)((K%8)*8) A%=b%:A%=0 'R(G%,K%):A%=A(&0A,B%,&100,G%,K%) HS(G%,K%):A%=A(&08,B%,&100,G%,K%):A%:"Disk error &";~A%;:C(200)  C(T%):T%=+T%:>T%: 1ݤA(b%,U%,k%,W%,K%):L%:L%=F:L%<>8:"FADFS" $X%?0=0:X%!1=U%:X%?5=b%:X%?6=K%*32+((W%&1F0000)65536):X%?7=((W%&FF00)256):X%?8=W%:X%!9=k%256:X%!11=k%:A%=114:&FFF1:A%=?X%:L%<>8:"FX143,18,"+L% B=A% VݤF:A%,Y%,E%:=(&FFDA)&FF j"ݤD(A%,N%)="0000000"+~A%,N%) t"ݤd(A%,N%)=" "+A%,N%) ~2ݤB(A%,N%):A$:A%?1>31:A$=A$+A%?1A$=A$+"." ?A%>31:A$=A$+?A%A$=A$+"." A%=A%+2:N%=N%-2:N%<1:=A$ Q:j%=j%:j%: th%=0:j%511:U%=&80:g%=&85:c%=&88:K=&FC40:Z=&FC41:_=&FC42:X=&FC43:U=&FC44:S=&FC46:M=&FC47:L=&FC47:!K<>K!8:R%=512 P=01:P%=j%:[OPTP*2:.o%:LDA&FF:BMIO:LDAM:BMIo%:TYA:#16:STAS:LDA#&EC:STAL:LDY#0:LDX#1:STXc%:CLC:JMPE:.O:RTS:.G:LDA&FC47:#8:BEQG:LDA&FC47:RTS:.C:PHP:JSRR:#&80:BNEC+1:PLP:BIT&CC:RTS:.R:PHP:LDA&FC47:STA&8D:LDA&FC47:CMP&8D:BNER+1:PLP:RTS .q%:LDA#&08:STA&84:CLC:BCCF:.p%:LDA#&0A:STA&84:SEC:BCSF:.F:LDA#&7F:STA&8E:LDA#0:STA&8F:PHP:JSRI:PLP:.J:LDX#2:.V:JSRN:LDY#0:.E:JSRG:#&21:BNED:BIT&CD:BCCT:.`:LDA(&80),Y:STA&FC40:LDAc%+1:BEQB:INC&81:LDA(&80),Y:STA&FC48:DEC&81:JMPB:.T LDA&FC40:STA(&80),Y:LDAc%+1:BEQB:INC&81:LDA&FC48:STA(&80),Y:DEC&81:JMPB:.B:LDA&FC47:#8:BEQD:INY:BNEE:LDA&FC47:#&21:BNED:DEX:BNEV:INC&87:BNEH:INC&86:BNEH:INC&85:.H:DEC&88:BNEJ:LDA#0:TAX:RTS:.D:LDA&FC47:LDX&FC41:RTS:.I:JSRC NLDA#64:STA&FC42:STA&FC43:LDAg%:LSRA:LSRA:A#3:#&13:STA&FC46:LDA#&91:STA&FC47:RTS:.N:PHP:JSRC:LDY#8:LDA#1:STA&FC42:CLC:LDA(&8E),Y:#63:ADC#1:STA&FC43:DEY:LDA(&8E),Y:ADC#h%:STA&FC44:DEY:LDA(&8E),Y:PHA:#&3F:ADC#0:STA&FC45 PLA:ROLA:ROLA:ROLA:ROLA:INY:INY:(&8E),Y:#&02:(&8E),Y:JSRQ:DEY:DEY:DEY:LDA(&8E),Y:.W:#2:PHA:#2:LSRA:LSRA:PLA:ASLA:ASLA:ASLA:A#&20:STA&FC47:PLP:RTS:.Q:ROLA:ROLA:ROLA:#&13:STA&FC46:RTS:]: �HEdit turns time. �  >HEdit v1.17 31-Aug-2006 �<C&87:23;2,53;0;0;0:U%30,N%256:A$=B:E$="1.17":C$=""::G:J �FP:G:K:J �PW:Q:K:J �d!J:C$=""C$=42:C$:C$: �xW:*FX4,2 �*FX225,160 � � K:*FX4 � *FX225,1 � �&ݤG:R%::R%=0:K%=200:12,26:=-1 �/0,19)::(38-);0,21);:=199:V%=:=-1 � =17:A �==17:0,21);14"Exit? ";:A%=H:0,21);30;0,21);:=A% =100*0+-1 ݤJ:A%,E%,Y%:=(&FFDA)&FF ,*P::R%=0:c%=&81:C$="":*K.10O.|MRUN|M 6s"7```Disk Sector Editor ";E$;"````k"'"uppppp(C) 2006 J.G.Harstonppppppz"0,22)""39,",");:*FX219,9 @dH%256,Z%256:X%=U%:Y%=X%256:O%=N%:T%=0:Q%=0:W%=0:V%=0:R%=0:I%=A$,"-q"):I%:C$=A$,I%+A$," ")) T7G%=70:A%=5:X%!1=O%:&FFD1:P%=O%?(2+?O%):P%>31:P%=0 ^_B$=B$,B$-1):".:",B$,1)):p$="":p$=l(B$):F%=J:F%=16:p$=l(":I."):p$=l(":I.*.")G%=0 r1p$=l("%.1."):F%=16:C(":"+D(P%),5)=0:P%=0 |23;10;0;0;0;:*FX226,128 *FX227,144  ݤl(A$):p$<>"":=p$ 2A$,1)=":":A$,3,1)=".":C(A$,2),5)<>2:=""  C(A$+"HUtils",5)=1:=A$="" wL:0,23)"Cursors move, Copy selects, Ctrl-H(elp)f1-f4 select sector TAB - ";:W%=0"hex/ASCII";"HEX/ascii"; (38-);: D:0,4);40;:23,1;0;0;0;0:l%=T%T%+1278:" "A(l%,2);": ";:m%=l%l%+7:A(H%?m%,2);" ";::" ";:m%=l%l%+7:b(H%?m%);::::23,1,1;0;0;0;: 0<ݤb(A%):(A%127)=127:=255(A%127)<32:=46=(A%127) DB:Q%=0:G%=G%&FFFFFF:R(H%,P%,G%):0,2)c%"Drive: ";D(P%);" Sector: &";A(G%,6);" Trk/Sct: ";I(G%10,3);"/";G%10;:""39,","):L:T%=0:J%=0:D:6,5);: Q:X%=U%:Y%=X%256:V%:B X():0: C:x%=:y%=: E:x%,y%);: $X(K%):K%=9:W%=W%1:C:L:E: K%=4:I(0):B:  K%=171:C:G:J%=J%&80:E: K%=172:S: K%=173:H: K%=174:T: K%=175:Y: (K%&EF)=140G%>0:F(-1): (K%&EF)=141:F(1):  (K%&EF)=142:F(10):  (K%&EF)=143G%>9:F(-10):  ?K%=&A1:8,2)""D$:A:P%=D$+7*(D$>"@")-48+32*(D$>"`"):B: *6K%=&A2:19,2)6:19,2)""A$:A:G%=("&"+A$):B: 4;K%=&A3:35,2)" ":35,2)""K%:A:G%=G%10+K%*10:B: >0K%=&A4:39,2)""K%:A:G%=10*(G%10)+K%:B: HHK%=&A6p$<>"":1,21);"Calling HUtils program"15;:K:p$+"HUtils" RK%=6:U: \K%=7:A:M: fK%=8:C:V:D:E: pKK%=15:R%=:C:28,0,21,39,5,12:"*"A$:A$:A$="":12,26:R%=0:D:E: z)K%=18:A%=02554:H%!A%=Z%!A%::D: K%=19:C:A:E: K%=21:A:N: &K%=23:A%=02554:Z%!A%=H%!A%::  K%>127: BW%=0:H%?J%=K%:C:A(K%,2);30+(-5)3,);b(K%):E:Q%=:H: K%>96:K%=K%-32 r(K%>47K%<58)(K%>64K%<71):K%=16*((H%?J%)15)+("&"+K%):H%?J%=K%:C:A(K%,2);30+(-5)3,);b(K%):E:Q%=  F(b%):A:G%=G%+b%:B: G:T%=T%128:D: H:J%=&FF: J%=&7F:G:0,4); &9,9,9:J%=J%+1:(J%7)=0:6,+1);  $S:J%=0: .J%=&80:G:27,21); 8'J%=J%-1:8,8,8:(J%7)=7:27,-1); B LT:J%>&F7: V (J%&F8)=&78:C:G:x%,4); `J%=J%+8:10: jY:J%<8: t!(J%&F8)=&80:C:G:x%,21); ~J%=J%-8:11: A:Q%: -14,4);"Save? ";:笤H:Q%=0:14,4)10: "Z(H%,P%,G%):Q%=0:14,4)10: U:p%=H%+(J%&F8):C:A$="":l%=09:A$=A$+b(p%?l%)::1,23)"File: ";A$;" ";A(p%!10,8);" ";A(p%!14,8)" ";:1,24)"Length: "A(p%!18&7FFFF,6);" Sec Start: 00"A(p%!22,4);" ";:E: �XM:p%=H%+(J%&F8):G%=p%!22&FFFF:1,23);"Going to sector &";A(G%,4);(40-);:B: LN:G%=H%!10&FFFF:1,23);"Going Up to sector &";A(G%,4);(40-);:B: <PݤH:"(Y/N)";:A%=&DF:A%=89A%=78:5,8);:A%=89:"Yes ":="No ":=0 PR(B%,D%,S%):O(): ZZ(B%,D%,S%):O(): d>O(`%):0,21);39;13;:c%=&82:M%=E:M%=&FF:M%=F:c%=&81 xV%=M%<>0:V%: x0,21);8"";:M%=&12:"Write protected ";M%=&FE:"Drive "D(D%)" not present ";"Disk error &";~M%;" "; (38-);1,21);: jݤE:C%=(`%1)&80:!X%=&600:X%!2=B%:X%!6=S%:X%?9=D%:X%?10=1:X%?11=C%:A%=90:&FFF1:X%?11=C%:=&FF=X%?11 |ݤF:_%=5:?X%=D%:X%!1=B%:X%?5=3:X%?6=&53(`%&18):X%?7=S%10:X%?8=S%10:X%?9=&21:X%?10=0:X%?7>79:X%?7=X%?7-80:?X%=?X%2 4X%?7>79:?X%=(?X%1)((2*X%?7)2):X%?7=40+X%?72 =A%=127:&FFF1:X%?10=&18_%:_%=_%-1:R(O%,D%,0):X%?10=&10 X%?10<>&10:=X%?10 "ݤA(A%,D%)="0000000"+~A%,D%) "ݤI(A%,D%)="00000000"+A%,D%) !ݤD(A%):A%<10:=A%=(55+A%) "6ݤC(A$,A%):?X%=O%:X%?1=O%256:$O%=A$:=(&FFDD)&FF 6I(s%):p%,L%:s%:G%=s%+1 @1,4)"Searching for directory: ":G%=G%+1:19,2);A(G%,6);35,2);I(G%10,3);"/";G%10;:L%=:R(H%,P%,G%):p%=09:H%?p%>127H%?p%<32:L%= h:?H%<33:L%= rBp%=10:p%=p%-1:p%=-1H%?p%<>32:p%>-1p%=p%-1:H%?p%=32p%=-1 L%L%=(p%=-1) *p%=09:"""#%&^|@*:.",H%?p%)>0 L%= :L%:0,4);40;: ^V:0,5);:"Cursors move around this sector"8"Shift-Cursor move to another sector"43 ̈"f1Select drive"23:"f2Select absolute sector"13:"f3Select track"23:"f4Select sector"22:p$<>"":"f6Call HUtils"24 39:"^D: Search for start of dir"11:"^F: Show file info"20:"^G: Goto file's start"17:"^O: OS Command"24:"^R: Read from buffer"18:"^S: Save this sector"18:"^U: Go up from this dir"15:"^W: Write to buffer"19 XK%=:11;39: lhݤB:A$,A%,X%,Y%:A%=0:X%=1:a%=((&FFF4)&FF00)256:a%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ")) a%=32:A$=$&100 -A$=0:?(P-3):A$=$&600A$=0:A$=$&3800 3A%=A$+" "," "):B$=A$,A%-1):B$<>"":=A$,A%+1) ZX%=U%:Y%=X%256:A%=9:?X%=0:X%!1=N%:!N%=0:&FFD1:!N%?N%+N%?2<>8:N%?(1+N%)=13:=$(N%+1) ="" �HUtils 00,"ADFS") "D%>3:L(D%,12,&10000,"HADFS") 38,"="): KL(d%,m%,n%,C$):d%=d%m%:" ";C$;" drives:";:O%=F%:A%=n%:O%<A%:A%=O%  B16);~d%;": ";(A% � > HUtils v1.38 15-Jul-2001 � 7:N �(:L$="1.38":R:N �<X%=t%:Y%=X%256:P: �PݤN::BA%:*HADFS �Z=100*0+(-1) �dݤV:A%,E%,Y%:=(&FFDA)&FF �nݤP:C("HADFS Utils Program")::B:131" 1 : Initialise a new HADFS disk":B:131" 2 : Alphabetically sort a directory":B:131" 3 : Convert a DFS disk to HADFS":B:131" 4 : Set drive boot options":B �)p$<>""131" 9 : Use Disk Editor":B �}131" H : HADFS Info "148"j"131" D : Disk info":B:131" 0 : Exit":B:"Press a key:";:C$=:C$="*"W:":";:C$="?" �1"DdHh0123456789"+13,C$):C$:"HADFS":*DIR@ � C$<>"0" �C$="1":F C$="2":P C$="3":I C$="4":J " C$="5" ,C$="9":p$+"HEdit" 6C$="H"C$="h":Q @C$="D"C$="d":L J =C$="0" TR:*Key10O.|MCLOSE#0:RUN|M ^23;2,52;0;0;0:BA%=:M$=0+"!Set up !Boot"+0:B&300,C 256,u%31:F%256,t%31:X%=t%:Y%=X%256:D=&FFF1:E=&FFF4:v%=&FFFF:p%=&10000:K>&4D:v%=&FFFFFF:p%=&1000000 D%(31),E%(31),A%(31),B%(31),C%(31),A$(31),B$(31):A%=031:A$(A%)=10," "):B$(A%)=10," ")::F=&FFDD:G=&FFD1:K$="D"+160+"I"+160+"S"+160+"K":D$="Day,00 Mon 0000.00:00:00":J$="MonJanFebMarAprMayJunJulAugSepOctNovDec" ;V=16:C(":I",5)=2:C(":I.HEdit",5)=1:p$=":I."p$=""  H="":K DA%=0:AA%=0: ^K:C("HADFS Utils Program"):"Enter today's date: (dd/mm/yy) "T$:T$,2,1)="/"T$="0"+T$ %T$,5,1)="/"T$=T$,3)+"0"+T$,4) .T$=""(T$,3,1)="/"T$,6,1)="/"):T$="" *(Q(90,6,255)&FF)<128"HSETDATE "+T$ WD$="Day,"+T$,2)+" "+J$,T$,4,2)*3+1,3)+" ":T$=8 D$=D$+"19"+T$,2)D$=D$+T$,7) D$=D$,15)+".00:00:00": 0C(T$)::132;157;135;141;(16-T$/2);T$'132;157;135;141;(16-T$/2);T$'135;157;132;"(C)1991-98 J.G.Harston. Version ";L$: :B:148;39,",");8: D.ݤA:A%:"Press SPACE";:A%=:=(A%(A%=3)) NW:C$:"*"C$:C$: X%ݤH:?X%=0:A%=14:&FFF1:?X%=0:="" bX%?25=13:X%?15=13:A%=$X%,5,2)>31:$(X%+11)=($(X%+11)-16*A%-100*($(X%+11)<1981)):A%:X%?6=13:$(X%+4)="0"+($(X%+4)-32),2):X%?6=32 lX%?15=46:=$X% vzݤE:A$,A:A$=H:A=A$,5,2)*8+J$,A$,8,3))3*256:A$,12,4)<1981:=AA=A+4096*(A$,12,4)-1981):=(A&FFF8)+(A&10000) 'ݤQ(A%,X%,Y%):=(&FFF4&FFFF00)256 "ݤD(A%,D%)="0000000"+~A%,D%) )ݤC(F$,A%):F$>31"Name too long":=0 ,X%?0=u%:X%?1=u%256:$u%=F$:=(&FFDD)&FF  ݤK:A%:A%=O:=?&73+256*?&72 0ݤO:A%,X%,Y%,E%:A%=&FD:X%=&70:=(&FFDA)&FF ݤR(A%):A%:="Yes"="No " NݤL:A:"(Y/N)";:A=&DF:A=89A=78:5,8);:A=89"Yes ":="No ":=0 cݤT(A$):B$,l%:B$=10," "):B$="":l%=1A$:A$,l%,1)>"_"B$=B$+(A$,l%,1)-32)B$=B$+A$,l%,1)  :=B$ D(g%,_%,V%,W%):M(&80):  A(g%,_%,V%,W%):M(&81): *[M(x%):L%:X%!0=&600:X%!2=g%:X%!6=V%:X%?9=_%:X%?10=W%256:X%?11=x%:A%=90:D:X%?11=0: >,X%?11:_%>1:"Disk error &";~X%?11'A: Ha(V%10)+(W%&100)>10:L%=10-(V%10):N(g%,_%,V%,&100*L%):N(g%+&100*L%,_%,V%+L%,W%-&100*L%): RN(g%,_%,V%,W%): \FN(B%,D%,S%,N%):X%?0=D%:X%!1=B%:X%?5=3:X%?6=&53:x%=&81:X%?6=&4B MX%?7=S%10:X%?8=S%10:X%!9=(N%256)&20:X%?7>79:X%?7=X%?7-80:X%?0=X%?02 6X%?7>79:X%?0=(X%?01)((X%?7*2)2):X%?7=40+X%?72 $A%=127:D:X%?10<>&10:X%?10=0: #"FDC disk error &";~X%?10'A: CݤF:"Which drive? (0/1) ";3,8);:""I%:11:I%=0I%=1:=I% TݤG:"Disk size: (40/80/160) "H%:11:H%<165H%>34((H%40)<5(H%40)>34)::=H% F:C("Disk Initialisation"):'"This will create a blank HADFS disk withan optional DFS partition."::I%=F::H%=G:((H%=40H%=80H%=160)K<&44)K>&43:H%<100:K%=(H%*10-70)*256K%=(H%*5-70)*256 `%=H%*10-74:R%=0:U%=0:"Partition? ";:z%=L:"Disk name:"17"#";17,8);:""H$:11:H$<>""H$<17H$," ")=0:H$=H$+15," "),16):'"Put a blank formatted disk in drive ";I%;"."'A BGl%=12+(K>&42):"ENABLE":"INSTALL "+I%+" $ "+H$+" "+H%::z% L$B="HADFS"+0+" D"+K$+"$ROM $SPARE $HADFS $"+0+"(C)JGH"+0:B?15=200:B?23=164:B?31=164:B?39=164:A=B+48B+2554:!A=0:A!256=0::G:$(B+256)="ISK "+0+32:B?262=&1-2*(H%>79):B?263=&20-&70*(H%=40) jB!&108=-1:B!&10A=-1:B!&10C=K%:B?&10E=&CC+(K%&1000&F0):B?&10F=70:B!&110=&8000:B!&112=&8000:B!&114=&4000:B?&116=&00:B?&117=6:B!&118=&900:B!&11A=&900:B!&11C=&200:B?&11E=&CC:B?&11F=4:B!&120=&900:B!&122=&900:B!&124=&200:B?&126=&CC:B?&127=2 `A(B,I%,0,512):D(B,I%,70,256):`%<>0:B!32=74:B!34=`%:B!36=R%:B!38=U%B!32=R%:B!34=U%:B!36=0 bB?&1E=B?&1E12:A(B,I%,70,256):s2%:$B="Side Two":$(B+256)=" "+0+0+0+2:A(B,I%,800,512)  G:s2%=:"Enter the start sector and sector lengthof the 'hole' in the HADFS disk that"'"will be the reserved partition:":'"To reserve all of side 0 for DFS, use"'"start sector 74, length ";K%256-4;" or ";K%256-2' "Start sector: (74-";H%*10-2;:") "O%:O%>73O%<H%*10-1:"Recommended sector length: ";K%256-O%+70:"Sector length: (";K%256-O%+70;"-";H%*10-O%;:") "P%:P%>(K%256-O%+70)-1P%<H%*10-O%+1:P%=0 P%=K%256-O%+70 Js2%=(O%=74P%=K%256-2):(H%<100O%<H%*10)H%>99O%<800 K%=(O%-70)*256 (B`%=O%-74:B!40=0:B!44=0:O%+P%<H%*10H%>160 R%=800:U%=1600-R%: <%O%+P%<H%*10 R%=O%+P%:U%=H%*10-R% F Z#ݤI(E$):E$;:": "E$:E$="":="" d3C(E$,&FD)<>2E$;" is not a directory."'A:="" nZ%=X%!14:=E$ ݤS(d%):= 9ݤM(A%):(A%&E0):"Unsupported directory type"'A:= = !P:E$=I("Sort dir"):E$="" S(Z%p%): ID(B,Z%p%,Z%v%,&300):J%=B?1231:J%=0"No files in directory."'A: M(B?12): ,G%=0:C%=B+&18:?C%=0:C%=C%+&18:?C%<>0 vD%(G%)=C%!10:E%(G%)=C%!14:A%(G%)=C%!18:B%(G%)=C%!20:C%(G%)=0:l%=90-1:C%(G%)=C%(G%)*2:C%?l%>127 C%(G%)=C%(G%)+1 T:!C%=!C%&7F7F7F7F:C%!4=C%!4&7F7F7F7F:C%!6=C%!6&7F7F7F7F:C%?10=13:A$(G%)=$C%:B$(G%)=T(A$(G%)):G%=G%+1:C%=C%+&18:G%=J%:"Sorting...";:S(J%-1)::C%=B+&18:G%=0J%-1:A$(G%);" ";D(D%(G%),8);"+";D(A%(G%)&7FFFF,6);" ";D(E%(G%),8) i$C%=A$(G%):C%!10=D%(G%):C%!14=E%(G%):C%!20=B%(G%):C%!18=A%(G%):l%=09:(C%(G%)1)<>0 C%?l%=C%?l%+128 :C%(G%)=C%(G%)2::C%=C%+&18::A(B,Z%p%,Z%v%,&300): S(q%):i%,j%,Q%:q%<1 ]l%=q%:f%=0:T%=(l%-f%+1)2:j%=f%+T%l%:i%=j%-T%f%-T%:Q%=i%+T%:B$(i%)>B$(Q%)T(i%,Q%) Ni%,j%:T%=T%2:T%=0: lT(i%,Q%):I$,M%:I$=A$(i%):A$(i%)=A$(Q%):A$(Q%)=I$:I$=B$(i%):B$(i%)=B$(Q%):B$(Q%)=I$:M%=D%(i%):D%(i%)=D%(Q%):D%(Q%)=M%:M%=E%(i%):E%(i%)=E%(Q%):E%(Q%)=M%:M%=A%(i%):A%(i%)=A%(Q%):A%(Q%)=M%:M%=B%(i%):B%(i%)=B%(Q%):B%(Q%)=M% 'M%=C%(i%):C%(i%)=C%(Q%):C%(Q%)=M%: I:C("Convert DFS to HADFS")::I%=F::h%=G*10:"Convert side two as well? ";:r%=L:'"Insert the disk to convert in drive ";I%'"Then "A:D(B,I%,0,512):!B=&46444148B!4=&44200053"This is already an HADFS disk."'A: zk%=&FFFF:w%=B?263+256*(B?2623):F%!32=&440002:F%!36=77-3*(r%):F%!40=0:F%?38=h%-F%?36:F%?39=(h%-F%?36)256:E(0):J H$B="Side0 G"+0+J%+0+0+0+k%+(k%256)+6,0):O:A(B,I%,74,&300):n%=0J%-1:H::r%D(B,I%,800,512):E(1):n%=0J%:B%(n%)=B%(n%)+800::$B="Side1 G"+0+J%+0+0+0+k%+(k%256)+6,0):O f,r%A(B,I%,77,&300):J%>0n%=0J%-1:H: pA$B="$ G"+5,0)+k%+(k%256)+6,0):B?12=1:r%B?12=2 z$(B+24)="Sid0 "+160+" "+9,0)+3+0+0+74+0:$(B+48)="Sid1 "+160+" "+9,0)+3+0+0+77+0:A(B,I%,71,256):$F%="ConvertedDisk "+0+"(C)JGH"+0:F%!24=k%:F%!26=E:F%!28=h%:F%?30=1:A(F%,I%,70,256):"INSTALL "+I% "Disk converted. ";A: 9H:O%,P%,a%,b%:O%=B%(n%):P%=(A%(n%)+255)256:P%=0 Tm%=&1C:m%=m%+4:a%=F%!m%&FFFF:b%=F%!(m%+2)&FFFF:a%=0(O%>=a%O%<a%+b%):a%=0 a%=O%U: 8O%+P%=a%+b%b%=b%-P%:F%?(m%+2)=b%:F%?(m%+3)=b%256: c%=&FC:F%!c%=F%!(c%-4):c%=c%-4:c%=m%:a2%=O%-a%:a3%=O%+P%:a4%=(a%+b%)-(O%+P%):F%?(m%+2)=a2%:F%?(m%+3)=a2%256:F%!(m%+4)=a3%:F%?(m%+6)=a4%:F%?(m%+7)=a4%256: .IU:a%=a%+P%:b%=b%-P%:b%=0F%!m%=F%!(m%+4):m%=m%+4:m%>255F%!m%=0: B,F%!m%=a%:F%?(m%+2)=b%:F%?(m%+3)=b%256: LO:n%=1J%:$(B+n%*24)=A$(n%-1)+10," "),10):!(B+n%*24+10)=D%(n%-1):!(B+n%*24+14)=E%(n%-1):!(B+n%*24+18)=A%(n%-1):?(B+n%*24+22)=B%(n%-1):?(B+n%*24+23)=B%(n%-1)256:: ݤJ:n%=0J%-1:P%=(A%(n%)+255)256:(B%(n%)>69B%(n%)<80P%>0)(B%(n%)<70B%(n%)+P%>69)V:n%=n%-1:y%'"Can't move file. (Track 7 needs to be available for HADFS - Try COMPACTing)"'A:= :=0 NV:"Moving "A$(n%);" ";:y%=:e%=B%(0)+(A%(0)+255)256:e%+P%>w%y%=: l%=0P%-1:8,8,8:D(P%-l%,3);:D(C,I%,B%(n%)+l%,256):A(C,I%,e%+l%,256)::M%=B!(n%*8+8):B!(n%*8+8)=B!(J%*8):B!(J%*8)=M%:M%=B!(n%*8+12):B!(n%*8+12)=B!(J%*8+4):B!(J%*8+4)=M%:M%=B!(n%*8+264):B!(n%*8+264)=B!(J%*8+256):B!(J%*8+256)=M% (M%=B!(n%*8+268):B!(n%*8+268)=B!(J%*8+260):B!(J%*8+260)=M%:B?(J%*8+256+7)=e%:B?(J%*8+256+6)=(B?(J%*8+256+6)&FC)+e%256:A(B,I%,0,512):E(0):: nCE(s%):n%,C%:J%=B?2618:J%=0"No files on side ";s%;". "A: }C%=B+8:n%=0J%-1:!C%=!C%&7F7F7F7F:C%!4=C%!4&7F7F7F7F:E$=C%?7:C%?7=13:A$(n%)=$C%:C%?7=E$:E$<>"$"A$(n%)=E$+"/"+A$(n%) A$(n%)=A$(n%)+10," "),10):o%=C%?262:D%(n%)=(C%!256&FFFF)+U((o%&C)4):E%(n%)=(C%!258&FFFF)+U((o%&C0)64):A%(n%)=(C%!260&FFFF)+4096*(o%&30):C%(n%)=0:B%(n%)=C%?263+256*(C%?2623):B$(n%)=T(A$(n%)):C%=C%+8:: &ݤU(A%):A%=3:=&FFFF0000=A%*65536 2ݤB:"Which drive:"G$:G$,1)<>":":G$=":"+G$ -C(G$,5)<>2"Drive not present. "A:= "N11,32:"INFO "+G$:11,11,32:"INFO "+G$:n%=X%!8&FFFF::l%=116:A$::= J)J:C("Set Disk Boot Options"):B: TG$=G$,2):A$,A$:n0%=n%::l%=13:A$:5);A$;28);": ";R(n%8192):n%=((n%*2)&FFFF)::n%=0:l%=13:34,l%+5);:n%=n%*2+(L2048)::'" Write to drive ";G$;"? ";:笤L: |2n%=(n0%&C7FF)n%:I%=G$:G$>"@":I%=(G$31)+9 >D(B,I%,70,256):B?30=n%:B?31=n%256:A(B,I%,70,256):'A: Q:C("HADFS Information")::!&70=0:CA%=O:" Version returned: ";CA%/100'" Version bytes: ";~?&72;".";D(?&73,2):" Capability bytes: ";D(?&70,2);",";D(?&71,2)':!&70=0"This is not HADFS. ";A: ln%=?&71:l%=10-1:m%=70-1:A$:" b";l%*8+m%;5);A$;32);": ";R(n%128):n%=n%*2::n%=?&70::" "A: I FRED/JIM ramdisk support,Hard disk support,13,Mouse driver supplied  11,10,9,8 $ Random access output,Fast GBPB 9 Full *INSTALL routine,Date supported,Time supported  *COMPACT/*BACKUP in ROM  Passwords used & *COPY in ROM :$L:C("Disk Information"):B: DJ" Disk flags: &";:(n%32768):l%=116:A$::D(n%256,2)'D(n%,4) Xcl%=15(n%32768)4096-1:A$:" b";l%;5);A$;32);": ";R(n%32768):n%=((n%*2)&FFFF)::'A: v[ 24-bit Free Space Map,Disallow INSTALL $,Mount for CSD,Mount for LIB,Mount for URD,10  9,8,7,6,5,4,3 + Partitioned disk,Split disk,Data disk [ 24-bit Free Space Map,Disallow INSTALL $,Mount for CSD,Mount for LIB,Mount for URD,10  9,8,7,6,5,4,3,2,1,0 �Intern/s 143,18,16. 0.47a 12/11/1993 Tidied up Serv7 and system !Boot files; !Boot on Compact doesn't clear memory. Osbyte 90,6,64 to 90,6,127 ignored, to be claimed by other ROMs. 0. � ! >Intern/s v1.11 12-Aug-1998 � HADFS files in Rom �E fx90,6,64/5/6; Four-byte sectors; Runnable; (Drives selectable) �(( 11-08-1998 v1.10 JGH: Date Checked �2. 12-08-1998 v1.11 JGH: Drive offset fixed �<(&87:ver$="1.11":dirsz%=2:mapsz%=128 �F? ctrl%30,name%80,mcode%&3FFF:X%=ctrl%:Y%=X%256:ProgID%=13 �P=4"Create an HADFS rom-disk ";ver$':DrvNum%=18: Drive I �Z3CsdDrv%=DrvNum%:LibDrv%=DrvNum%:UsrDrv%=DrvNum% �dE"Drive number ("drv(DrvNum%);:"): "d$:d$<>"":DrvNum%=Drv(d$) �nRDskName$="InternalDrive":"Disk name (";DskName$;:"): "d$:d$<>"":DskName$=d$ �x-SetCsd%=Set(""):SetCsd%:CsdDrv%=GetDrv �5SetLib%=Set("library "):SetLib%:LibDrv%=GetDrv �2SetUsr%=Set("user "):SetUsr%:UsrDrv%=GetDrv �:BootOpt%=0:"Boot option (0): "d$:d$<>"":BootOpt%=d$ �;"Make files runnable? "d$:run%=d$,1)="Y" d$,1)="y" � DskID%=(65535):DskDt%=date �)OSWORD=&FFF1:OSBYTE=&FFF4:oscli=&FFF7 �7OSWRCH=&FFEE:OSNEWL=&FFE4:OSASCI=&FFE3:OSRDCH=&FFE0 �*OSFILE=&FFDD:OSFIND=&FFCE:OSARGS=&FFDA �2GSINIT=&FFC2:GSREAD=&FFC5:FILEV=&212:FSCV=&21E �assem:files:save: �: �FݤSet(A$):"Set default "A$;:"drive? "A$:=A$,1)="Y" A$,1)="y" �DݤGetDrv:=DrvNum%:"Enter drive number ("drv(DrvNum%);:"): "d$  d$<>"":=Drv(d$) =DrvNum% : Bݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF ":ݤver:A%,X%,E%,Y%:A%=&FD:X%=&70:&FFDA:=?&73+256*?&72 ,:ݤdate:A%=14:?X%=1:&FFF1:?X%=~?X%+((~X%?2)&E0)2 6#?X%=?X%-100*(?X%<81):?X%=?X%-81 @<=(256*~X%?1+8*((~X%?2)31)+&1000*?X%+(?X%16))&FFFF Jݤdrv(A%)=(48+A%-7*(A%>9)) T$ݤDrv(A$)=(A$+7*(A$>"@")-48)31 ^: h assem rdv%=9:nm%=dv%+1:ct%=dv%+2 | P=0 1:p%=P*2+4 O%=mcode%:P%=&8000  [OPTp% BRK:BRK:BRK  JMP serv  EQUB &80 EQUB copyright-&8000  EQUB 100*ver$-100:\ Version $EQUS "HADFS files":BRK:EQUS ver$ .copyright BRK:EQUS "(C)1993 JGH":BRK \ Service part  .serv CMP #8:BEQ serv8 ] Hrun%:[OPTp%:CMP #4:BNE P%+5:JMP serv4:CMP #9:\BNE P%+5:\JMP serv9:] 6SetCsd%SetLib%SetUsr%:[OPTp%:CMP #7:BEQ serv7:] &[OPTp%:RTS:] 0#SetCsd%SetLib%SetUsr%:serv7 : [OPTp% D .serv8 N TYA:PHA XLDA &EF:CMP #90:BEQ serv8go b.serv8exit lPLA:TAY:LDA #8:RTS v .serv8go $LDY #0:LDA (&F0),Y:BNE serv8exit (INY:LDA (&F0),Y:CMP #6:BNE serv8exit 3LDY #dv%:LDA (&F0),Y:CMP #DrvNum%:BNE serv8exit -LDY #ct%:LDA (&F0),Y:CMP #2:BEQ serv8read CMP #1:BNE serv8exit &LDA #&12:BNE Serv8Finished:\ ROnly .serv8read &LDY #7:LDA (&F0),Y:BEQ serv8for_me 2SEC:SBC #1:STA (&F0),Y:DEY:\ Point to next rom 5LDA (&F0),Y:CLC:ADC #16:STA (&F0),Y:JMP serv8exit .serv8for_me LDX #7:.serv8lp1 "LDA &A8,X:PHA:DEX:BPL serv8lp1 )LDY #nm%:LDA (&F0),Y:STA &AE:\ Number  6LDY #6:LDA (&F0),Y:SEC:SBC #70:STA &AF:\ Sector-70  .serv8lp2  1DEY:LDA (&F0),Y:STA &A6,Y:CPY #2:BNE serv8lp2 *\ Get addr 47LDA #Start% 255:STA &AC:LDA #Start% 256:STA &AD >\ Now find start sector H LDX &AF:BEQ SectFound:LDX #0 R .FindSect \%LDA Lengths,X:SEC:ADC &AC:STA &AC fLDA &AD:ADC #0:STA &AD pINX:CPX &AF:BNE FindSect z.SectFound !LDY #0:BIT &27A:BPL Serv8Loop 'LDA &AA: &AB:CMP #&FF:BNE TubeLoad .Serv8Loop -LDA (&AC),Y:STA (&A8),Y:INY:BNE Serv8Loop  JSR UpdateAddr:BNE Serv8Loop .Serv8Pull LDX #0:.serv8loop2 PLA:STA &A8,X:INX:CPX #8 BNE serv8loop2:LDA #0 .Serv8Finished LDY #ct%:STA (&F0),Y .ServFinished PLA:LDA #0:RTS  .TubeLoad LDA #&C0+7:\ Caller ID !JSR &406:BCC TubeLoad:\ Claim $5LDX #&A8:LDY #0:LDA #7:JSR &406:\ Write 256 bytes .LDY #0:.TubeLp 8LDA (&AC),Y:STA &FEE5 BNOP:NOP:NOP:NOP LINY:BNE TubeLp VLDA #&80+7:\ Caller ID `JSR &406:\ Release j-JSR UpdateAddr:BNE TubeLoad:BEQ Serv8Pull t: ~.UpdateAddr LDX &AF:LDA Lengths,X SEC:ADC &AC:STA &AC LDA &AD:ADC #0:STA &AD INC &A9:INC &AF:DEC &AE RTS ] run%:serv4  [OPTp% :  .Start% EQUS DskName$+15," "),16) 1BRK:EQUS "(C)JGH":BRK:EQUW DskID%:EQUW DskDt% �.DiskSize%  !EQUD &85:EQUW 0:EQUW 0:EQUW 0 : .Lengths:\ 'Hidden' in FSM (,EQUB mapsz%-1:\ Sector 70 = mapsz% bytes 2/EQUS mapsz%-71+32,0):\ Sector 71 onwards <: F\ Sector 71, '$' dir P].DirStart%:EQUS "$ ":EQUW 71:EQUD (SetLib% 1):EQUW DskID%:EQUW BootOpt%:EQUD 0:] ZTSetLib%:[OPTp%:EQUS"Lib"+242+"ary "+160+" ":EQUD 0:EQUD 0:EQUD &300:EQUW 72:] dSSetLib%:[OPTp%:.DirStart%:EQUS"Library ":EQUW 71:EQUD 0:EQUD DskID%:EQUD 0:] n: x:  serv4  [OPTp%  .serv4 DLDA #(DirStart%+24) 255:STA &A8:LDA #(DirStart+24) 256:STA &A9 LDA DirStart%+12: #31:TAX  .ServLp0 "TYA:PHA:STA &AA:LDA #0:STA &AB  .Serv4Lp1 &LDA (&F2),Y:CMP #".":BEQ Serv4Dot CMP #"A":BCC Serv4Found ALDY &AB:LDA (&A8),Y: #127:LDY &AA:CMP (&F2),Y:BEQ Serv4Match $ #32:CMP (&F2),Y:BEQ Serv4Match .Serv4Next LDA &A8:CLC:ADC #24:STA &A8 LDA &A9:ADC #0:STA &A9 PLA:TAY:DEX:BNE ServLp0 ".Serv4Exit ,LDA #4:LDX &F4:RTS 6 .Serv4Dot @INC &AA:BNE Serv4Got J.Serv4Match TEINC &AA:LDY &AA:INC &AB:LDA &AB:CMP #10:BNE Serv4Lp1:BEQ Serv4Got ^.Serv4Found h6LDY &AB:LDA (&A8),Y: #127:CMP #"!":BCS Serv4Next r .Serv4Got |$\ This needs a bit more thought: #LDY #4:LDA (&A8),Y:BPL Serv4Run %LDY #0:LDA (&A8),Y:BMI Serv4NoRun -LDA #0:TAY:JSR &FFDA:CMP #16:BEQ Serv4Run .Serv4NoRun PLA:TAY:JMP Serv4Exit  .Serv4Run PLA:LDY &AA .Serv4Skip /LDA (&F2),Y:INY:CMP #"!":BCC Serv4Skip:DEY *TYA:CLC:ADC &F2:PHA:LDA &F3:ADC #0:PHA /LDY #14:LDA (&A8),Y:PHA:INY:LDA (&A8),Y:PHA 9LDY #10:LDA (&A8),Y:STA &102:INY:LDA (&A8),Y:STA &103 GLDY #19:LDA (&A8),Y:STA &10A:DEY:LDA (&A8),Y:BEQ Serv4Run2:INC &10A .Serv4Run2 FLDY #22:LDA (&A8),Y:STA &106:LDA #6:STA &101:LDA #DrvNum%:STA &109 ELDX #&FF:STX &104:STX &105:INX:STX &100:STX &107:STX &108:STX &F0 &=INX:STX &F1:INX:STX &10B:LDA #90:STA &EF:JSR serv8:LDX #3 0.Serv4Pull :#PLA:STA &A8,X:DEX:BPL Serv4Pull D%LDA &214:STA &AC:LDA &215:STA &AD NJLDA #Serv4Line 255:STA &214:LDA #Serv4Line 256:STA &215:JSR CallAA X.Serv4Restore bDLDA #0:TAY:JSR CallAC:TAY:LDX #18:LDA #143:JSR OSBYTE:LDA #0:RTS l.CallAA:JMP (&AA) v.CallAC:JMP (&AC) .Serv4Line 4LDA &A8:STA 0,X:LDA &A9:STA 1,X:JMP Serv4Restore ]: :  serv7  [OPTp%  .serv7 "PHA:LDA &EF:CMP #90:BNE NoServ LDA &F0:CMP #6:BNE NoServ  LDA &F1:] *SetCsd%:[OPTp%:CMP #64:BEQ Serv7Drv:] *SetLib%:[OPTp%:CMP #65:BEQ Serv7Drv:] *SetUsr%:[OPTp%:CMP #66:BEQ Serv7Drv:] [OPTp%:.NoServ  PLA:RTS  .Serv7Drv  LDA #DrvNum%:STA &F0 *PLA:LDA #0:RTS 4]: >: H save R<"*SAVE IntRom ";~mcode%;" ";~here%;" FFFF0000 FFFBBC00" \ f: p files zADiskSize%=DiskSize%-&8000+mcode%:Lengths=Lengths-&8000+mcode% !dir%=DirStart%-&8000+mcode%: ?here%=dir%+&100*dirsz%:ptr%=dir%+24:Sect%=71-SetLib%+dirsz% ELengths!1=-1:Lptr%=Lengths+1+dirsz%-SetLib%:SetLib%:Lengths?1=47 0"Enter filenames, terminated with RETURN": h"Space left: &";~mcode%+&4000-here%;"/";(dir%+dirsz%*256-ptr%)24;" (";mcode%+&4000-here%;" bytes)" "File: "f$: f$<>"" load :f$="" here%>mcode%+&3FFF ptr%+23>=dir%+dirsz%*256 !DiskSize%=Sect%: load: L% f$,1)="*" f$: #file(f$,5)<>1:"Not a file": 5ctrl%!10>(mcode%+&4000-here%):"File too long": k"New filename: "f2$:f2$="":f2$=f$:I%=f2$,"."):I%:f2$=f2$,I%+1):I%=f2$,"."):I%=0:11;14,9)f2$ "LOAD "+f$+" "+~here% f2$=f2$+10," "),10) 3A%=(ctrl%?14+16*(ctrl%?15 &E0))&33:z%=1 10 $6(A%1):f2$=f2$,z%-1)+(128+f2$,z%))+f2$,z%+1) .!:$ptr%=f2$:dir%?12=1+dir%?12 8:ptr%!10=ctrl%!2:ptr%!14=ctrl%!6:L%=ctrl%!10:ptr%!18=L% BJptr%?20=8*ctrl%?15:ptr%?21=ctrl%?16:(ctrl%?15 32):ptr%?9=ptr%?9 &80 L#ptr%?22=Sect%:ptr%?23=Sect%256 V9ptr%=ptr%+&18:here%=here%+L%:Sect%=Sect%+(L%+255)256 ` L%=0: j9?Lptr%=L%-1 (L%>255):L%=L%-256:Lptr%=Lptr%+1:L%<1 t MCat @�4#��Ws� �  >MCat 1.00 � Multiple CAT program � (C) J.G.Harston �( �  >MCat 1.00 � Multiple CAT program � (C) J.G.Harston �( �25 buff% 20,data% 100:total%=0:up%=(_INFO("^")=2) �<:"Path to dump: "path$ �FE up% path$,"$")=0 "Needs a reference to root ($)":path$="" �PJ path$<>"" _INFO(path$)<>2 path$;" is not a directory":path$="" �Zpath$<>"" �dI"CATalog or EXamine? "f$: (f$,1)&DF)="E" cat$="EX" cat$="CAT" �n@"Printer? (Y/N) "f$: (f$,1)&DF)="Y" prt%=:2 prt%= �x8"DIR "+path$:total%=cat:up(path$,path$,".")+1)) �."Total disk space used: ";total%;" bytes" � prt% 12,3 � �1ݤcat: end%,index%,total%::index%=0:total%=0 �"Directory ";path$ � cat$ �: �*buff%!1=data%:buff%!5=1:buff%!9=index% �#X%=buff%:Y%=X%256:A%=8: &FFD1 �.index%=buff%!9:end%=buff%?5: end%=0 file � end%<>0 � =total% �: file: f$,type% ??(data%+?data%+1)=13:f$=strip($(data%+1)):type%=_INFO(f$) Itotal%=total%+buff%!10: buff%?10<>0 total%=(total% &FFFF00)+&100 "4 type%=2 down(f$):total%=total%+cat:up(f$) , 6.down(f$):path$=path$+"."+f$:"DIR "+f$: @:up(f$):path$=path$, path$- f$-1): up% "DIR ^": J"DIR "+path$: TWݤ_INFO(f$): A%,X%,Y%:$data%=f$:!buff%=data%:X%=buff%:Y%=X%256:A%=5:=(&FFDD)&FF ^5ݤstrip(f$): f$,1)=" " :f$=f$,2):f$,1)<>" " hf$=f$,f$+" "," ")-1):=f$ Rescue C�r��W � �  > Rescue � File rescue prog. �57:mem%=(-P-1500)&FFFF00: ctrl% 30,data% mem% �('dv%=8-(vr>&4D):nm%=dv%+1:ct%=dv%+2 �2/"File rescue program V1.02 Buffer &";~mem% �<'"File to rescue �  > Rescue � File rescue prog. �57:mem%=(-P-1500)&FFFF00: ctrl% 30,data% mem% �('dv%=8-(vr>&4D):nm%=dv%+1:ct%=dv%+2 �2/"File rescue program V1.02 Buffer &";~mem% �<'"File to rescue: "F1$ �F"Output file: "F2$ �P5A%=info(F1$,&FD): A%<>1 F1$" is not a file.": �Zxload%=ctrl%!2:exec%=ctrl%!6:length%=ctrl%!10 &7FFFF:sect%=ctrl%!14 &FFFF:drv%=args(&FE,&70): ctrl%?16 also =drv% �d& length%>mem% "File too long.": �n/byte%=-1:"Fill byte: "b$:b$<>"" byte%=b$ �x!d%=data%:l%=(length%+255)256 �1err%=0:X%=ctrl%:Y%=X%256:A%=90:!ctrl%=&600: �"Sector &";~sect%:11 �Lctrl%!2=d%:ctrl%!6=sect%:ctrl%?dv%=drv%:ctrl%?nm%=1:ctrl%?ct%=&80:&FFF1 �Rctrl%?ct%:"Error &";~ctrl%?ct%;" at sector :";drv%;"/";~sect%:x:err%=err%+1 �#sect%=sect%+1:d%=d%+256:l%=l%-1 �/ l%<1:"File rescued with ";err%;" errors" �L F2$<>"" "SAVE "+F2$+" "+~data%+"+"+~length%+" "+~exec%+" "+~load% � �&ݤargs(A%,X%): Y%,E%:=&FFDA &FF �ݤinfo(F$,A%): X%,Y% �;X%=ctrl%:Y%=X%256:!ctrl%=data%:$data%=F$:=(&FFDD)&FF �-x:byte%>-1 z%=d%d%+255:?z%=byte%:: �Rz%=d%d%+255:(?z%<32 ?z%<>13 ?z%<>9)?z%>126 ?z%=64:((z%-d%)31)=0 ?z%=13 &:!d%=&21212121:d%!250=&2A2A2A2A: :ݤvr: A%,X%,E%,Y%:A%=&FD:X%=&70:&FFDA:=?&73+256*?&72 SetDate H�.tw� �  >SetDate 1.03 11-Aug-1998 �# 02-10-97 V1.02 Can force date �- 11-Aug-1998 V1.03 JGH: New command line �(A&87:23;2,53;0;0;0:ctrl%30:A$=OS_GetEnv:X%=ctrl%:Y%=X%256 �24C$="":B$=(0):B$<" " B$<>"":B$="|"+(B$+64) �<%C$=C$+B$:B$="":quit$="":force%= �F8I%=A$,"-q"):I%:quit$=A$,A$," ",I%)):A$=A$,I%-1) �PI%=A$,"-f"):I%:force%= �Z$( &F0)=160:GetDate :: �dT$="":force%:T$=time �nLforce% T$="" T$,5,2)="00" T$="Fri,31 Dec 1999.23:59:59":GetDate �x$C$<>"":"Key0 "+C$:*FX138,0,192 �os(quit$): �: �/GetDate:" Enter the date (DD/MM/YY): "d$ �1d$," ")=0 d$<>"":d$=d$+" "+d(day(d$),2) �"HSETDATE "+d$:d$<>"":y%=y%100:time("SunMonTueWedThuFriSat",d$,1)*3-2,3)+","+d(d%,2)+" "+"JanFebMarAprMayJunJulAugSepOctNovDec",m%*3-2,3)+" "+(1900+y%-100*(y%<81))) �#" Enter the time (HH:MM): "t$ �Bt$<>"":=(60*t$+t$,2))*60*100:time("0"+t$,5)+":00",8)) � �: �0time(A$):A%=15:?X%=A$:$(X%+1)=A$:&FFF1: �: �Kݤday(d$):d%=d$:m%=d$,d$,"/")+1):y%=1900+d$,2):y%<1981:y%=y%+100 �=DayOfWeek(d%,m%,y%) : (ݤtime:?X%=0:A%=14:&FFF1:?X%=0:="" X%?25=13:X%?15=13:A%=$X%,5,2)>31:$(X%+11)=($(X%+11)-16*A%-100*($(X%+11)<1981)):A%:X%?6=13:$(X%+4)="0"+($(X%+4)-32),2):X%?6=32 "X%?15=46:=$X% ,: 6,ݤDayOfWeek(d%,m%,y%):y%<100:y%=y%+1900 @ y%=y%400 Jq=(y%*365.25+m%*30+d%+"120112234455",m%,1)+((y%4)=0)-((y%-1)100)-(m%>2((y%4)=0(y%100)<>0y%=0))+3)7+1 T: ^?ݤOS_GetEnv:A$,A%,X%,Y%:A%=0:X%=1:os%=((&FFF4)&FF00)256 h6os%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ")) ros%=32:A$=$&100 |/A$=0:?(P-3):A$=$&600 A$=0:A$=$&3800 7A%=A$+" "," "):run$=A$,A%-1):run$<>"":=A$,A%+1) uX%=ctrl%:Y%=X%256:A%=9:?X%=0:X%!1=data%:!data%=0:&FFD1:!data%?data%+data%?2<>8:data%?(1+data%)=13:=$(data%+1) ="" : &os(A$):A$=""A$=42:A$: A$ : "ݤd(A%,N%)="00000000"+A%,N%) �VisCompact 02/08/1994 File running completely re-written; much tidied up. HADFS as a libfs now implemented. *INSTALL ? help text rest � >VisCompact v1.30a �(23,128,&88,&11,&22,&44,&88,&11,&22,&44:23,129,&3F,&40,&4F,&50,&4F,&40,&3F,0:23,130,&FF,0,&FF,0,&FF,0,&FF,0:23,131,&FE,&01,&F9,&05,&F9,&01,&FE,0:23,132,&7F,&41,&41,&41,&41,&41,&7F,0:23,133,&7F,&40,&40,&40,&40,&40,&7F,0 �d23,134,&FF,0,0,0,0,0,&FF,0:23,135,&FF,1,1,1,1,1,&FF,0:23,136,&FF,0,0,0,0,0,0,0:23,137,&88,0,&22,0,&88,0,&22,0:23,138,&3F,&40,&40,&4F,&40,&40,&3F,0:23,139,&FF,0,0,&FF,0,0,&FF,0:23,140,&FE,&01,&01,&F9,&01,&01,&FE,0 �i&80:A$=A:A$=" ",A$<>""A$<>32)+A$:"Visual Compact ";:B=&FFD1:A=&FFDD:E$=E(" -q",1):::C() �@E("-?",0):'"Syntax: "F$" (<drv>) (-quit <command>)":C(0) �HA%=132:(&FFF4&FFFF00)256<P+&3800"- Not enough memory.":C(-1) �'A$,1)=" ":A$=A$,2):A$,1)<>" " �$D$=A$:D$="":"Drive: "D$A$="C" D$=D$,1):"DIR :"+D$::j%=8-(F>&4D):q%=j%+1:r%=j%+2:"Visual Compact - Dir. - File - Free space - Unallocated" "80,"_");0,12);80,136):0,13);80,"_");0,24);80,136):0,25);80,"_"):C%20,J%20,K%256,G%20:H%=&200:O%=0:X%=&70:Y%=0:E%=0:A%=5:&FFDA:M%=!&70:A%=4:&FFDA:W%=!&70:A%=&FE:Z%=(&FFDA)&FF:U%=(W%+M%)256-1:k%=2:U%>&7CF:k%=1 ^>"MOUNT "+(48+Z%-7*(Z%>9)):l%=0:g%=79:l%+g%>U%:g%=U%-l% hU%>=l%:A(l%,137) r g%>0:g%,137);:l%=l%+g%+1 |g%<>79:0,2);"**";:$(G%+1)="$":A%=C:(C%!8&8001)=0"##< - - - - - - - - S y s t e m F i l e s - - - - - - - >":H%=70*256 A(70,64):P%=0:*FX229,1 )O%=H%:!G%=&2401:D(0):f%=O%-H%:*FX229 P%:C(27) 0,29);(W%+M%)/1024;"K disk ";H%/1024;"K used ";M%/1024;"K free ";f%/1024;"K clash ";:x%=:U%=H%:H%=0:L(&80,70):S%=&20:l%=(K%!S%)&FFFF:s%=l%l%+(!(K%+S%+2)&FFFF)-1:A(s%,128)::S%=S%+4:((K%!S%)&FFFF)=0 x%,29);(M%-H%)/1024;"K FSM clash ";(W%-U%+(M%-H%))/1024;"K unused":0,30);:o%=(f%<>0(M%-H%)<>0):o%:7"Can't compact with"'9"sector clashes";8;11;9"(C)ompact disk"8; ]"(M)ake new FSM"8"(S)ave current FSM";:13:A$="":A$=(&DF):"MS",A$)(A$="C"o%=0)  159;13;:A$="C"o%:C(-2) $A$="C":FA$="M":GA$="S":H  C(0): 0oK(_%):A%,X%,Y%,L%,T%:L%=0:X%=C%:Y%=X%256:A%=8:C%!1=G%:C%!5=1:C%!9=L%:B:T%=C%!5:L%=C%!9:(-1):P%==27 lT%=0D(_%) vT%<>0P%: D(_%):B$,A%,X%,Y%,B%,F%,l%:?(G%+?G%+1)=13:B$=$(G%+1):A%=C:F%=(C%!10+255)&7FF00:B%=(C%!14)&FFFF:O%=O%+F%:A%=2A(B%,129):A(B%+1,130):A(B%+2,131):I:"DIR "+B$:K(_%+2):"DIR ^":  F%=0 F%<&101A(B%,132): 8A(B%,133):F%>&200l%=B%+1B%+F%256-2:A(l%,134): A(B%+F%256-1,135): 1ݤC:!C%=G%+1:X%=C%:Y%=X%256:A%=&FD:=(A)&FF &A(B%,p%):A%=135:B%>=2600-k%*2: U31,B%80,2+B%80-k%*(B%>799)-k%*(B%>1599):A%=(&FFF4&FF00):A%=&8900:H%=H%+&100  p%: XI:L(&80,B%):B%=(K%!14&FFFF):B%:A(B%,138):A(B%+1,139):A(B%+2,140):O%=O%+&300 4 B%=0: >`L(u%,B%):!C%=&600:C%!2=K%:C%!6=B%:C%?j%=Z%:C%?q%=1:C%?r%=u%:X%=C%:Y%=X%256:A%=90:&FFF1: fF:`%=:P%=0:*FX229,1 zQ%=-P-2000:h%Q%:*DIR$ Wa%=0:B("$",1):B("$",2):A%=D(0,0):A%<&28a%=0P%:0,30);70'70;0,30);:*FX229 )A%=&24"Maximum compaction achieved"  {B(C$,m%):A%,X%,Y%,L%,T%,b%:L%=0:b%=:X%=C%:Y%=X%256:A%=8:C%!1=G%:C%!5=1:C%!9=L%:B:T%=C%!5:L%=C%!9:(-1):P%==27 T%=0E(C$) T%<>0P%:b%P%: .E(C$):0,30);:A%,X%,Y%,c%,d%,F%,e%,R%,B$:?(G%+?G%+1)=13:B$=$(G%+1):!J%=G%+1:X%=J%:Y%=X%256:A%=&FD:A%=(A)&FF:R%=(J%!14)&FFFF:!C%=G%+1:X%=C%:Y%=X%256:A%=5:A%=(A)&FF:A%<>m%: ``c%=C%!2:d%=C%!6:F%=C%!10:e%=C%!14:A%=2"DIR "+B$:B(C$+"."+B$,1):B(C$+"."+B$,2):"DIR ^": t5A%<>10,31);C$;".";B$;" is not a file.";78);: ~2V%=(F%+255)256:D(R%,V%)0,31);C$;".";B$; 6F%>Q%" - too long for buffer.";(78-);0,30);: e" ";B(c%,8);"+";B(F%,4);" ";B(d%,8);(78-);0,30);:(e%8)(e%1)=0A%=&FF"ACCESS "+B$+" R" ol%=R%R%+V%-1:A(l%,128)::"LOAD "+B$+" "+~h%:`%=:a%=a%+1:A(B%,133):V%>2l%=B%+1B%+V%-2:A(l%,134): #V%<2A(B%,132)A(B%+V%-1,135) T"SAVE "+B$+" "+~h%+"+"+~F%+" "+~d%+" "+~c%:b%=:X%=C%:Y%=X%256:A%=4:A:: #ݤD(R%,F%):X%,Y%,A%:`%J:`%= �D%=&1C:D%=D%+4:B%=(K%!D%)&FFFF:i%=!(K%+D%+2)&FFFF:B%=0(B%<R%(B%+i%=R%i%>=F%)):B%<>00,30);"Found: start &";B(B%,4);", length=&";~i%;78);0,30); R%=0:=D%=B%<>0 ((ݤB(A%,N%):=N%-~A%,"0")+~A%,N%) 2ZJ:!J%=&600:J%!2=K%:J%!6=70:J%?j%=Z%:J%?q%=1:J%?r%=&80:X%=J%:Y%=X%256:A%=90:&FFF1: P{G:0,0)80:D%=&20:s%=2(W%+M%)256-1:A(s%,0):A%=&8900A%=&8000:D%=D%2:K%!D%=K%!D%+1D%=((D%+2)&FFFC):K%!D%=s%+1 nE2.5*(D%31),D%32-1);"000"+~(K%!D%),4);" ";:D%>&E0:s%=999999 ':K%!(D%+2)=0:L(&81,70):0,30);: H:D%=&20:X%=C%:Y%=X%256:A%=7:$G%="FSM_"+~((K%!D%)&FFFF):!X%=G%:X%!2=0:X%!6=0:X%!10=0:X%!14=(!(K%+D%+1))&FF00:&FFDD:D%=D%+4:(K%!D%&FFFF)=0: 8ݤF:A%,X%,E%,Y%:X%=&70:A%=&FD:&FFDA:=?&73+256*?&72 _ݤA:A$:A%=0:X%=1:t%=((&FFF4)&FF00)256:t%=6>&8000:ș"OS_GetEnv"A$:A$=A$,1+A$," ")) t%=32:A$=$&100 -A$=0:?(P-3):A$=$&600A$=0:A$=$&3800 +A%=A$+" "," "):F$=A$,A%-1):=A$,A%+1) 'ݤE(l$,n%):l$=32A$<>"":A$=" "+A$ "ZI%=A$,l$):l$="":I%>0n%>0:l$=A$,A$," ",I%+1)+1):A$,I%,1)<>" ":l$=l$,l$," ")-1) ,iI%:A$,I%,1)=" ":A$=A$,2+(A$<>32),I%-1+(A$=32))I%:A$=A$,I%-1)+A$,A$," ",A$," ",I%)+l$)+1) 6n%:=l$=I%<>0 J%M(A$):A$=""A$=42:A$:A$: ^8C(A%)::E$<>"":A$=E$:E$="":M(A$+" "+A%,A%<>0)) r A$=13:  8����� ����W: