9000 REM Initialise file interface 9010 REM Sets drive=current device, int1=Interface 1 present 9020 LET a$="":LET drive=CODE"0"+PEEK 23766:CLOSE#0:LET int1=(PEEK 23734<>244) 9030 IF driveCODE"8" OR int1=0 THEN LET drive=CODE"T" 9040 IF int1 THEN IF PEEK 23769=66 THEN LET drive=CODE"S" 9050 IF int1 THEN CLEAR#:OPEN#9,"b":POKE 23769,drive-17:POKE 23766,drive-CODE"0" 9060 RETURN 9100 REM Save data 9110 REM drive=default drive, f$=filename, start+length=>data, int1=Interface 1 present 9120 LET a$="":IF f$="" THEN RETURN 9130 IF f$(2)<>":" THEN LET f$=CHR$drive+":"+f$ 9140 IF f$(1)>"0" AND f$(1)<"9" THEN SAVE*"m";VALf$(1);f$(3 TO)CODE start,length:RETURN 9150 IF f$(1)<>"S" THEN SAVE f$(3 TO)CODE start,length:RETURN 9160 IF int1=0 THEN RETURN 9170 INPUT#9;"S";(f$(3 TO))'a$;#2;(a$(2 TO))':IF a$<>"" THEN RETURN 9180 SAVE*"b"CODE start,length:RETURN 9200 REM Load data 9210 REM drive=default drive, f$=filename, start=-1 or load address, int1=Interface 1 present 9220 LET a$="":IF f$="" THEN RETURN 9230 IF f$(2)<>":" THEN LET f$=CHR$drive+":"+f$ 9240 IF start<0 THEN IF f$(1)>"0" AND f$(1)<"9" THEN LOAD*"m";VALf$(1);f$(3 TO)CODE:RETURN 9250 IF f$(1)>"0" AND f$(1)<"9" THEN LOAD*"m";VALf$(1);f$(3 TO)CODE start:RETURN 9260 IF start<0 THEN IF f$(1)<>"S" THEN LOAD f$(3 TO)CODE:RETURN 9270 IF f$(1)<>"S" THEN LOAD f$(3 TO)CODE start:RETURN 9280 IF int1=0 THEN RETURN 9285 INPUT#9;"L";(f$(3 TO))'a$;#2;(a$(2 TO))':IF a$<>"" THEN RETURN 9290 IF start<0 THEN LOAD*"b"CODE:RETURN 9295 LOAD*"b"CODE start:RETURN 9300 REM Catalogue 9310 REM drive=default drive 9320 LET a$="":IF CHR$drive>"0" AND CHR$drive<"9" THEN CAT VALCHR$drive:RETURN 9330 IF CHR$drive="S" THEN IF int1=0 THEN RETURN 9340 IF CHR$drive="S" THEN INPUT#9;"C"'a$;#2;(a$(2 TO)):RETURN 9350 REM If a tape catalogue routine available, call it here 9360 REM Eg: LET bc=USR cat 9370 RETURN 9400 REM Set default drive 9410 REM f$=drive character 9420 IF f$<>"" THEN LET drive=CODE f$(1) 9430 RETURN