10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240 :
250 MODE&87:HIMEM=FNhimem0:VDU23;2,53;0;0;0:A$=FNOS_GetEnv+" ":PRINT SPC13"TreeCopy 1.63a"'SPC13STRING$(14,"="):*FX1
260
270 DIM ctrl% 31,name% 127:X%=ctrl%:Y%=X%DIV256:ON ERROR REPORT:PRINT:Q$=CHR$13:HIMEM=FNhimem2:END
280
290 Q$="":S$="":D$="":pa%=1:cf%=1:rc%=1:ex%=1:fc%=1:all%=1:sub%=1:upd%=FALSE:vb%=FALSE:dst%=FALSE:dbg%=FALSE
300
310 IFLENA$>1:pa%=FALSE:cf%=FALSE:rc%=TRUE:fc%=FALSE:ex%=FALSE:all%=FALSE:sub%=TRUE:upd%=FALSE
320 REPEAT I%=0:IF LEFT$(A$,6)="-quit ":Q$=MID$(A$,7,LEN A$-7):A$=""
330 IF LEFT$(A$,4)="-deb":dbg%=TRUE:A$=MID$(A$,INSTR(A$," ")+1)
340 IF LEFT$(A$,2)="-d":dst%=TRUE:A$=MID$(A$,INSTR(A$," ")+1)
350 IF LENA$:IF S$="" AND LEFT$(A$,1)<>"-":I%=INSTR(A$+" "," "):S$=LEFT$(A$,I%-1):A$=MID$(A$,I%)
360 IF LENA$:IF D$="" AND LEFT$(A$,1)<>"-":I%=INSTR(A$+" "," "):D$=LEFT$(A$,I%-1):A$=MID$(A$,I%)
370 IF LENS$:IF LEND$:I%=LEFT$(A$,1)="~":IF I%:A$=MID$(A$,2)
380 IF LENS$:IF LEND$:IF LEFT$(A$,1)="A":all%=NOTI%
390 IF LENS$:IF LEND$:IF LEFT$(A$,1)="C":cf%=NOTI%
400 IF LENS$:IF LEND$:IF LEFT$(A$,1)="E":ex%=NOTI%
410 IF LENS$:IF LEND$:IF LEFT$(A$,1)="F":fc%=NOTI%
420 IF LENS$:IF LEND$:IF LEFT$(A$,1)="P":pa%=NOTI%
430 IF LENS$:IF LEND$:IF LEFT$(A$,1)="R":rc%=NOTI%
440 IF LENS$:IF LEND$:IF LEFT$(A$,1)="S":sub%=NOTI%
450 IF LENS$:IF LEND$:IF LEFT$(A$,1)="U":upd%=NOTI%
460 IF LENS$:IF LEND$:IF LEFT$(A$,1)="V":vb%=NOTI%
470 IF A$="-? ":UNTILTRUE:PRINT"Syntax: TreeCopy (fs:)src (fs:)dest"'" ACEFPRSUV (-dest) (-quit (*)name)":PROCq
480 A$=MID$(A$,2):
490 UNTIL A$="":maxlength%=((HIMEM-LOMEM-2200)AND-256)+2560*(dbg%ORHIMEM>&FFFF):DIM data% maxlength%
500
510 end%=data%+maxlength%:PRINTSPC10"Buffer length: &";~maxlength%
520 IFLENS$=0:PRINT'"Caution - This program does not check"'"for circular pathnames - Eg Copying"'"$.FRED into $.FRED.JIM will repeatedly"'"create $.FRED.JIM.JIM...etc."
530 IF LENS$:I%=INSTR(S$,":"):IF I%>1:FS1$=LEFT$(S$,I%-1):D1$=MID$(S$,I%+1)
540 ON ERROR REPORT:PRINT:IF INKEY-1:Q$=CHR$13:HIMEM=FNhimem2:END ELSE OSCLI"FX1,"+STR$ERR:PROCq
550 IF LENS$:IF I%<2:FS1$="":D1$=S$
560 IF S$="":PRINT:FS1$=FNinp("Source filing system: "):OSCLI FS1$:D1$=FNinp("Source dir: ") ELSE OSCLI FS1$
570 fs1%=FNfs:at$=LEFT$("@.",FNinfo("@")=2):up%=FNinfo("^")=2:IF FNinfo("$")<>2:fs1%=4
580
590 IF fs1%=4:IFASCD1$=58:IFLEND1$=2:type%=(FNinfo(D1$+".$")) ELSE type%=FNinfo(D1$)
600 one%=type%=1:IF type%=0:IFfs1%>4:PRINT D1$" does not exist.":PROCq
610
620
630 IF pa%>0:PRINT'"Pause to change disks";:pa%=FNyn
640 IF LEND$:I%=INSTR(D$,":"):IF I%>1:FS2$=LEFT$(D$,I%-1):d$=MID$(D$,I%+1)
650 IF LEND$:IF I%<2:FS2$="":d$=D$
660 IF D$="":PRINT':FS2$=FNinp("Dest. filing system: "):d$=FNinp("Dest. dir: ")
670 IF FS2$="":FS2$=FS1$
680 mnt1$="":mnt2$="":d2$="":PROCDest:fs2%=FNfs:d2$=d$
690 IF fs2%>4 AND INSTR(d2$,"$")+INSTR(d2$,"%")+INSTR(d2$,"&")+INSTR(d2$,":")+INSTR(d2$,"@")=0:PRINT"Dest. dir must be an absolute pathname, must contain one of $,%,&,@ or :":PROCq
700 IF fs1%<>fs2%:IFASCD1$=58:IFASCMID$(D1$,3)=46:IFLEFT$(D1$,3)=LEFT$(d2$,3):pa%=TRUE
710 IF fs1%=fs2%:FS1$="":FS2$=""
720 IF fs1%<>fs2% AND fs1%=8:mnt1$="Mount"
730 IF fs1%<>fs2% AND fs2%=8:mnt2$="Mount"
740 IF fs1%=fs2% AND pa% AND (fs1%=8 OR fs1%=16):mnt1$="Mount "+FNdrv:mnt2$=mnt1$:OSCLI mnt2$:IF LEFT$(D1$,1)<>"$" ANDLEFT$(D1$,1)<>":":D1$="$."+D1$
750 IF fs2%>4:IFNOTone%:PROCcd(d2$) ELSE IFfs2%=4:*DIR$
760 IF cf%>0:PROCpr:PRINT"Confirm";:cf%=FNyn:PRINT
770 IF rc%>0:rc%=FALSE:IF fs1%>4 PRINT"Recurse";:rc%=FNyn:PRINT
780 IF fc%>0:PRINT"Force overwriting";:fc%=FNyn:PRINT
790 IF fs1%=5:mask%=&FFFFFF3B ELSE mask%=TRUE
800 IF ex%>0:ex%=FALSE:IF fs2%=4 PRINT"Expand into DFS dirs";:ex%=FNyn:PRINT
810 IF ex%ANDRIGHT$(d2$,2)=".$":d2$=LEFT$(d2$,LEN d2$-2)
820 dcd%=FALSE:dest$=d2$+".":ddir$="":dpfx$=""
830 ::
840 ::
850 ::
860 ::
870 PROCSrc:olddir$="":::
880 IFall%>0:all%=FALSE:IF FNfs=4:PRINT"Do all DFS dirs";:all%=FNyn:PRINT:IF all%:IFsub%>1:PRINT"Put in subdirs";:sub%=FNyn:PRINT
890 IF sub%:sub$="." ELSE sub$="/"
900 IFNOTone%:PRINT'"Dir. ";D1$:OSCLI"DIR "+D1$:d2$=d2$+"."
910
920 out$="":Z%=0:Ptr%=data%:done%=FALSE:?Ptr%=0:F$="":index%=0:level%=0:dir%=33:IF all%:*DIR !
930 ON ERROR IF FNerr:OSCLI"FX1,"+STR$ERR:PROCq
940 X%=ctrl%:Y%=X%DIV256:IFone%:PROCrd:F$=D1$:out$=d2$:PROCGBPB:PROCq
950 ::
960 REPEAT PROCDo:UNTIL done% AND Z%=0:PRINT:PROCq
970 :
980 DEFPROCq:IF dst%:PROCDest
990 HIMEM=FNhimem2:IF Q$="":Q$=CHR$13:END
1000 IF LEFT$(Q$,1)="*":OSCLI Q$:Q$=CHR$13:END
1010 CHAIN Q$
1020 :
1030 ::
1040 ::
1050 ::
1060 ::
1070 ::
1080 :
1090 DEFFNinp(A$):REPEAT PRINT A$;:INPUT LINE""B$:IF LEFT$(B$,1)="*":OSCLI B$
1100 UNTIL LEFT$(B$,1)<>"*":=B$
1110 :
1120 DEFFNerr
1130 IF ERR=195:IF(Z%AND&C)=4:IFfc%:OSCLI"ACCESS "+d$:=FALSE
1140 PROCpr:VDU11:REPORT:IF ERR<128:PRINT:=TRUE
1150 IF ERR=198:IF(Z%AND12)=12:CLOSE#c2%
1160 IF ERR=198:IFNOTdst%:PROCSrc
1170 IF ERR=198:PRINT:=TRUE:
1180 IF ERR=195 AND(Z%AND&C)=4:PRINT". Overwrite";:IFNOTFNyna(1):Ptr%=P%+length%:=FALSE ELSE IF ERR=195 AND(Z%AND&C)=4:OSCLI"ACCESS "+d$:PRINT:=FALSE
1190 IF ERR<128:IFERR<>17:PRINT" at line ";ERL;
1200 PRINT". Skip";:sk%=FNyn:IF sk% AND Z%=0:PRINT
1210 IF Z%=0 AND NOTsk%:F$=file$:T%=A%:=FALSE
1220 IF(Z%AND&C)=4:PRINT:IF sk%:Ptr%=P%+length%:=FALSE
1230 IF(Z%AND&C)=12 ANDsk%:PRINT:Ptr%=data%:?Ptr%=0:F$="":PROCErrGBPB
1240
1250
1260 F$="":=ERR<128 OR INKEY-1
1270 :
1280
1290
1300 DEFPROCErrGBPB
1310 IF(Z%AND&100):CLOSE#c2%:PROCSrc ELSE CLOSE#c1%
1320 Z%=0:ENDPROC
1330 :
1340
1350
1360
1370
1380
1390
1400
1410
1420
1430
1440 :
1450 DEFPROCDo:IF Z%=0:PROCRead:ENDPROC
1460 IF(Z%AND&C)=0 AND ?data%=0:Z%=Z%+12
1470 IF(Z%AND&C)=0:PROCwr:Z%=Z%+4:Ptr%=data%:PRINT
1480 IF(Z%AND&C)=4:PROCWrite:IF Z%<8:ENDPROC
1490 IF(Z%AND&C)=8:PROCrd:Z%=Z%+4:Ptr%=data%:IF NOTpa%:PRINT
1500 IF(Z%AND3)<>1:Z%=0:?Ptr%=0:ENDPROC
1510 IF(Z%AND&C)=12:PROCGBPB:Z%=0:F$="":Ptr%=data%:?Ptr%=0
1520 ENDPROC
1530 :
1540 DEFPROCRead:IF LENF$:file$=F$:A%=FNinfo(at$+file$):F$="":PROCDoFile2:ENDPROC
1550 REPEAT:X%!1=name%:X%!5=1:X%!9=index%:A%=8:CALL &FFD1
1560 ret%=X%!5:index%=X%!9:IF ret%=0:PROCDoFile1
1570 UNTIL ret%<>0 OR Z%<>0:IF ret%=0:ENDPROC
1580 IF NOTall%:A%=3:file$="":X%!10=0:PROCDoFile2:ENDPROC
1590 index%=0:dir%=dir%+1:IF dir%=34 OR dir%=ASC":" OR dir%=ASC"*" OR dir%=ASC"|":dir%=dir%+1
1600 IF dir%=ASC"a":dir%=ASC"{"
1610 IF dir%<127:OSCLI"DIR "+CHR$dir% ELSE A%=3:file$="":X%!10=0:PROCDoFile2:*DIR $
1620 ENDPROC
1630 :
1640 DEFPROCDoFile1
1650 ?(name%+?name%+1)=13:file$=$(name%+1)+" ":file$=LEFT$(file$,INSTR(file$," ")-1):IFASCfile$=46:ENDPROC
1660 A%=FNinfo(at$+file$):IF A%=2 ANDNOTrc%:ENDPROC
1670 PROCpr:IFA%=2:PRINT"Dir. "; ELSE PRINT"File ";
1680 PRINTD1$;:IFLEND1$:VDU46
1690 IF all% ANDdir%<>ASC"$":VDU dir%,46
1700 PRINT file$;:
1710 IF cf%:IF NOTFNyna(0):PRINT:ENDPROC
1720 A%=((A%-1)AND1)+1:PROCDoFile2:ENDPROC
1730 :
1740 DEFPROCDoFile2:type%=A%
1750 IF type%<>3:PROCReadAttr ELSE IF LENat$:A%=FNinfo("@"):PROCReadAttr:length%=0 ELSE length%=0
1760
1770 IF FNdiff:ENDPROC
1780 IF length%+2+LENfile$>maxlength%-48:F$=file$:T%=type%:Z%=1:ENDPROC
1790 :
1800
1810 $(Ptr%+1)=FNin(file$):P%=Ptr%+2+LEN$(Ptr%+1):IF P%+length%+48>end%:F$=file$:T%=type%:Z%=2:ENDPROC
1820 IF type%=3 AND end%=data%+maxlength%:done%=TRUE:Z%=2:VDU11:ENDPROC
1830 IF type%=3:PROCDirUp:index%=!end%:end%=end%+4:level%=level%-1
1840
1850 !P%=load%:P%!4=exec%:P%!8=length%:P%!12=attr%:P%!15=mtime%:P%!18=cdate%:P%!20=ctime%:P%=P%+24
1860 IF type%<>3:PROCpr ELSE length%=0
1870 IF type%=1:OSCLI"LOAD "+at$+file$+" "+STR$~P% ELSE IF type%=2:OSCLI"DIR "+file$:end%=end%-4:!end%=index%:index%=0:D1$=D1$+"."+file$:level%=level%+1
1880
1890 ?Ptr%=type%:Ptr%=P%+length%:?Ptr%=0:IFupd%:Z%=3
1900 ENDPROC
1910 :
1920 DEFFNin(F$):IF fs1%>4:=F$
1930 IF all% ANDdir%<>ASC"$":=CHR$dir%+sub$+F$ ELSE:=F$
1940 :
1950 DEFPROCDirUp:REPEAT:D1$=LEFT$(D1$,LEN D1$-1):UNTIL RIGHT$(D1$,1)=".":D1$=LEFT$(D1$,LEN D1$-1)
1960 IF up%:OSCLI"DIR ^" ELSE OSCLI"DIR "+D1$
1970 ENDPROC
1980 :
1990 DEFPROCDest:IF pa% PROCpr:PRINT"Insert dest. and press SPACE";:REPEAT UNTIL GET<65:PRINT
2000 IF LENFS2$:OSCLI FS2$
2010 IF LENmnt2$:OSCLI mnt2$:IF LENd2$:IFNOTone%:OSCLI"DIR "+LEFT$(d2$,LEN d2$-1)
2020 IF(mnt2$<>"" AND d2$<>"")OR(FS1$+FS2$="" AND NOTup%):IFNOTone%:OSCLI"DIR "+LEFT$(d2$,LEN d2$-1)
2030 ENDPROC
2040 :
2050 DEFPROCSrc:IF pa%:PROCpr:PRINT"Insert source and press SPACE";:REPEAT UNTIL GET<65:PRINT
2060 IF LENFS1$:OSCLI FS1$
2070 IF LENmnt1$:OSCLI mnt1$:IFNOTone%:OSCLI"DIR "+D1$
2080 IF mnt1$<>"" OR (FS1$+FS2$="" AND NOTup%):IFNOTone%:OSCLI"DIR "+D1$
2090 ENDPROC
2100 :
2110 DEFPROCWrite:IF?Ptr%=0:Z%=Z%+4:ENDPROC
2120
2130 A%=?Ptr%:file$=$(Ptr%+1):P%=Ptr%+2+LENfile$
2140
2150 load%=!P%:exec%=P%!4:length%=P%!8:attr%=P%!12:mtime%=P%!15:cdate%=P%!18:ctime%=P%!20:P%=P%+24
2160 IF A%=3:file$="@":PROCSetAttr:PROCDUp:Ptr%=P%:ENDPROC
2170 IF A%=2:PROCDDir:Ptr%=P%:ENDPROC
2180 PROCCheck:PRINT "Save ";d2$;file$;:IF dpfx$="":d$=d2$+file$ ELSE d$=dpfx$+file$
2190 OSCLI"SAVE "+d$+" "+STR$~P%+"+"+STR$~length%+" "+STR$~exec%+" "+STR$~load%:A%=1:PROCSetAttr:Ptr%=P%+length%:PRINT:ENDPROC
2200 :
2210 DEFPROCReadAttr:
2220
2230 load%=X%!2:exec%=X%!6:length%=X%!10 AND (A%=1):X%!17=0:X%!20=X%!15
2240 IF fs1%=5:$(name%+8)=file$:PROCoswD(&14,&12000A00+256*LENfile$,&40000000):IF name%?3=0:X%!15=name%!10:X%!17=name%!12:X%!20=name%!5:X%!22=name%!7:
2250 attr%=X%!14:IF fs1%=16:!X%=name%:$name%=LEFT$(at$,2+(file$=""))+file$:A%=&FD:CALL &FFDD:X%!17=X%!6:X%!21=X%!10:
2260 mtime%=X%!17:cdate%=X%!20:ctime%=X%!22:ENDPROC
2270 :
2280 DEFPROCSetAttr:IF fs2%<4:ENDPROC
2290 IF fs2%=8:OSCLI mnt2$
2300
2310 A$=d2$+file$:IF file$="@":A$=LEFT$(A$,LENA$-2):
2320 $name%=A$:!X%=name%:X%!2=load%:X%!6=exec%:X%!14=attr%ANDmask%:A%=1+3*(A%<>1)*(fs2%=5):CALL &FFDD
2330 IF fs2%=16:A%=&FD:CALL &FFDD:X%!6=mtime%:X%!9=cdate%:X%!11=ctime%:A%=&FC:CALL &FFDD:ENDPROC:
2340 IF fs2%<>5:ENDPROC
2350 IF fs1%<>16 AND fs1%<>5:ENDPROC
2360 name%!7=attr%:$(name%+10)=A$:PROCoswD(&14,&13000C00+256*LENA$,&05000000):
2370 attr%=(attr%AND&FFFF00)DIV256:name%!8=cdate%:name%!10=ctime%:name%!13=attr%:name%!15=mtime%:$(name%+18)=A$:PROCoswD(&14,&13001400+256*LENA$,&40000000):ENDPROC:
2380 :
2390
2400
2410 :
2420
2430
2440
2450
2460 :
2470
2480 DEFFNdiff:IF upd%=0 OR type%=2 OR file$="":=FALSE
2490 PROCDest:A%=FNinfo(d2$+file$):PROCSrc
2500 IF A%=type%:IF X%!2=load%:IF X%!6=exec%:IF X%!10=length%:=TRUE
2510 =FALSE
2520
2530
2540
2550
2560
2570 :
2580 DEFPROCCheck
2590 IF ex%ANDMID$(file$,2,1)="/":file$=LEFT$(file$,1)+"."+MID$(file$,3)
2600 IF fs1%=4:attr%=(attr%OR3)EOR(attr%DIV4)AND15:attr%=attr%OR((attr%AND7)*16)
2610 IF fs2%=4:file$=LEFT$(file$,7-2*(MID$(file$,2,1)=".")):attr%=attr%AND8
2620 IF fs2%<>16:IF(attr%AND5)=5:attr%=attr%AND-5
2630 IF all%ANDsub%ANDdcd%<>ASCfile$ANDMID$(file$,2,1)=".":PROCcd(d2$+LEFT$(file$,1)):dcd%=ASCfile$
2640 ENDPROC
2650 :
2660 DEFPROCDUp:REPEAT d2$=LEFT$(d2$,LEN d2$-1):UNTIL RIGHT$(d2$,1)="."
2670
2680 ENDPROC
2690 :
2700 DEFPROCDDir:PRINT"CDir ";:IF dpfx$="":PRINTd2$;file$;:PROCcd(d2$+file$) ELSE PRINTdpfx$;file$;:PROCcd(dpfx$+file$)
2710 A%=2:d2$=d2$+file$:
2720 d2$=d2$+".":PRINT:ENDPROC
2730 :
2740 DEFPROCGBPB:file$=FNin(F$):in$=F$:
2750 A%=FNinfo(at$+in$):max%=(end%-data%-48)AND&FFFF00:IFmax%>X%!10:max%=X%!10DIV2
2760 PROCReadAttr:IFLENout$:d2$=out$:file$="":dpfx$=""
2770 IFFNdiff:ENDPROC
2780 c2%=0:c1%=OPENIN(at$+in$):IF c1%=0:PRINT"No input available.":ENDPROC
2790 PROCgbpb(4,c1%,max%):CLOSE#c1%:PROCwr:Z%=Z%OR&100:PROCCheck:IF dpfx$="":d$=d2$ ELSE d$=dpfx$
2800 PRINT'"Copy ";d2$;file$;:d$=d$+file$:$name%=d$:!X%=name%
2810 A%=5:A%=(USR&FFDD)AND&FF:IFfc%=0:IFA%:IF(X%?14)AND8:PRINT'"Entry locked. Overwrite";:IFNOTFNyna(1):ENDPROC
2820 IFA%:X%!14=(fs2%>4)AND&33:A%=4:CALL&FFDD :
2830 X%!2=load%:X%!6=exec%:X%!10=0:X%!14=length%:IFX%?17:X%!14=&400000
2840 A%=7:CALL&FFDD :
2850 X%?14=(fs2%>4)AND&33:A%=4:CALL&FFDD :
2860 IF(X%!10>length%)ORX%!10=0:c2%=OPENOUT(d$) ELSE c2%=OPENUP(d$):
2870 IFc2%=0:PRINT'"No output available.":PROCSrc:ENDPROC
2880 PROCgbpb(2,c2%,max%):ptr%=max%:b%=max%:PRINT:CLOSE#c2%
2890 REPEAT:PROCrd:Z%=Z%AND&FF:c1%=OPENIN(in$):PTR#c1%=ptr%
2900 IF ptr%+max%>length%:b%=length%-ptr%
2910 PROCgbpb(4,c1%,b%):CLOSE#c1%:PROCwr:Z%=Z%OR&100:c2%=OPENUP(d$):PTR#c2%=ptr%
2920 PROCgbpb(2,c2%,b%):PRINT:ptr%=PTR#c2%:CLOSE#c2%
2930 UNTIL ptr%>=length%:A%=1:PROCSetAttr
2940 PROCrd:Z%=Z%AND&FF:PRINT:ENDPROC
2950 :
2960 DEFPROCgbpb(A%,c%,b%):?X%=c%:X%!1=data%:X%!5=b%:CALL &FFD1:ENDPROC
2970 :
2980 DEFPROCcd(F$):IF FNfs>4:IF FNinfo("$")=2:IF FNinfo(F$)<>2:OSCLI"CDIR "+F$:
2990 ENDPROC
3000 :
3010 DEFFNinfo(F$):?X%=name%:X%?1=name%DIV256:$name%=F$:A%=5:=(USR&FFDD)AND&FF
3020 :
3030 DEFPROCrd:PROCSrc:PROCpr:PRINT"Reading...";:ENDPROC
3040 DEFPROCwr:PROCDest:PROCpr:PRINT"Writing...";:ENDPROC
3050 DEFPROCpr:IF POS:PRINT
3060 ENDPROC
3070 :
3080 DEFFNyn:LOCAL A%
3090 PRINT"? (Y/N)";:REPEAT:A%=GET AND&DF:UNTIL A%=89 ORA%=78
3100 PRINT STRING$(5,CHR$8);:IF A%=89:PRINT"Yes ";:=TRUE ELSE PRINT"No ";:=FALSE
3110 :
3120 DEFFNyna(B%):LOCAL A%
3130
3140 PRINT"? (Y/N/A)";:REPEAT:A%=GET AND&DF:UNTIL A%=89 ORA%=78 ORA%=65
3150 PRINT STRING$(7,CHR$127);:IF A%=89:PRINT"Yes ";:=TRUE ELSE IF A%=78:PRINT"No ";:=FALSE
3160 PRINT"All ";:IF B%=0:cf%=FALSE ELSE IF B%=1:fc%=TRUE ELSE IF B%=3:sk%=TRUE
3170 =TRUE
3180 :
3190 DEFFNfs:LOCAL A%,E%,Y%:=(USR&FFDA)AND&FF
3200 :
3210
3220
3230
3240
3250
3260
3270
3280
3290
3300
3310
3320
3330
3340
3350
3360 :
3370 DEFFNdrv:A%=6:X%!1=data%:CALL &FFD1
3380 ?(data%+1+?data%)=13:=$(data%+1)
3390 :
3400 DEFPROCoswD(A%,D%,E%):LOCAL X%,Y%:X%=name%:Y%=X%DIV256:!X%=D%:X%!4=E%:CALL&FFF1:ENDPROC
3410 :
3420 DEFFNOS_GetEnv
3430 A%=(HIMEM>&FFFF)AND&900:A%=((PAGE>&9FFF)ANDA%)OR((&1400-PAGE)AND(A%=0)):IF?(TOP-3)ELSEA%=&B00
3440 A$=$(PAGE-&E00+A%):IFA%=0:run$=A$:SYS16TOA$,,A%:SYS72,"",A%:A$=MID$(A$,1+INSTR(A$+" "," ",1+INSTR(A$," "))):IFLENA$=0:A$=run$
3450 FORY%=-1TO0:A$=" "+A$:REPEATA$=MID$(A$,2):UNTILASCA$<>32
3460 IFY%:IFASCA$=34:A%=INSTR(A$,"""",2)+1 ELSE IFY%:A%=INSTR(A$+" "," ")
3470 IFY%:run$=MID$(A$,1-(ASCA$=34),A%-1+2*(ASCA$=34)):IFrun$<>"":A$=MID$(A$,A%+1)
3480 NEXT:=A$
3490 :
3500
3510
3520
3530
3540 :
3550 DEFFNhimem0:IFHIMEM=&B800 OR HIMEM>&FFFF:=HIMEM
3560 A%=130:IF((USR&FFF4)AND&FFFF00)=&FFFF00 OR ?&FFF7<>&6C:=HIMEM
3570 IFPAGE=&C000:LOMEM=&800:=&8000
3580 FORA%=0TOTOP-PAGE+3STEP4:A%!&C000=A%!PAGE:NEXT:PAGE=&C000:HIMEM=&F800:RUN
3590 DEFFNhimem1:IFHIMEM<PAGE:=&F800 ELSE =HIMEM
3600 DEFFNhimem2:IFHIMEM<PAGE:PAGE=&800:?&801=-1:=HIMEM ELSE =HIMEM
3610 :