10
20 :
30 DIM ctrl% 31,name% 80,mem% &3FFF:X%=ctrl%:Y%=X%DIV256
40 PROCScan:END
50 :
60 DEFPROCScan:LOCAL i%,n%
70 REPEATf$=FNs(FNgbpb8(i%)):i%=X%!9:n%=LENf$:IFn%:PROCFile
80 UNTILn%=0:ENDPROC
90 DEFPROCFile
100 IFASCf$=46 OR ASCf$=45 OR INSTR(f$,"<"):ENDPROC
110 IFFNfile(f$,5)=2:OSCLI"Dir "+f$:PROCScan:OSCLI"Dir ^":ENDPROC
120 A%=X%!3AND&FFF
130 IFA%=&FAF OR A%=&FFB OR A%=&FFF:ENDPROC
140 L%=X%!10:IFL%>&4000:ENDPROC
150 PRINTf$;:OSCLI"LOAD "+f$+" "+STR$~mem%:PRINTFNcr;
160 :
170 A%=9:title$="":REPEAT:IF mem%?A%>31:title$=title$+CHR$mem%?A%
180 A%=A%+1:UNTIL mem%?A%<32 OR mem%?A%>126 OR A%>63:title$=FNs(title$)
190 ver$="":REPEAT:IF mem%?A%>31:ver$=ver$+CHR$mem%?A%
200 A%=A%+1:UNTIL mem%?A%<32 OR mem%?A%>126 OR A%>127:ver$=FNs(ver$)
210 A%=mem%?7:copy$="":REPEAT:IF mem%?A%>31:copy$=copy$+CHR$mem%?A%
220 A%=A%+1:UNTIL mem%?A%<32 OR mem%?A%>126 OR A%>255:copy$=FNs(copy$)
230 IF LEFT$(copy$,3)<>"(C)":ver$=RIGHT$(f$,4)
240 IF ver$=copy$:ver$=""
250 IF ver$="":A%=INSTR(title$,"."):ver$=MID$(title$,A%-1,4):title$=LEFT$(title$,A%-2)
260 IF ver$="":ver$=LEFT$(STR$~mem%?8+"00",3)
270 IF FNuc(LEFT$(ver$,7))="VERSION":ver$=FNs(MID$(ver$,8))
280 IF FNuc(LEFT$(ver$,1))="V":ver$=FNs(MID$(ver$,2))
290 IF LEFT$(ver$,1)>"9":A%=INSTR(ver$,"."):IFA%:ver$=MID$(ver$,A%-1,4)
300 IF LEFT$(ver$,1)>"9":ver$=MID$(ver$,2)
310 IF MID$(ver$,2,1)="-":ver$=LEFT$(ver$,1)+"."+MID$(ver$,3)
320 IF MID$(ver$,2,1)>"9":ver$=LEFT$(ver$,1)+MID$(ver$,3)
330 ver$=FNs(ver$)
340 IF MID$(ver$,2,1)<>".":ver$=LEFT$(ver$,1)+"."+MID$(ver$,2)
350 IF LENver$<5:ver$=LEFT$(ver$+"00",4)
360 IF MID$(ver$,3,1)<"0" AND MID$(ver$,3,1)>"0":ver$=LEFT$(ver$,2)+"0"+MID$(ver$,3)
370 IF MID$(ver$,4,1)<"0" AND MID$(ver$,4,1)>"0":ver$=LEFT$(ver$,3)+"0"+MID$(ver$,3)
380 copy$=LEFT$(copy$,3)+FNs(MID$(copy$,4))
390 IF LENtitle$<3:title$=f$
400 :
410 A%=mem%:REPEAT:IF FNchk:PRINTFNh0(E%,2)" "FNd(E%,3)" ";:REPEATVDU?A%:A%=A%+1:UNTIL?A%>122 OR ?A%<32 OR (?A%>32 AND ?A%<39) OR (?A%>39 AND ?A%<44):PRINTSPC(40-POS);title$;" ";ver$;FNcr;
420 A%=A%+1:UNTILA%>=mem%+L%
430 PRINTFNcr;:ENDPROC
440 :
450 DEFFNchk:IF?A%=A%?1:=FALSE
460 E%=A%?-1:B%=?A%>64 AND ?A%<91 AND A%?1>64 AND A%?1<122 AND ((A%?2>64 AND A%?2<122) OR A%?2=32)
470 IF B%:IF A%?-3=&20:IFA%?-5=&A9:E%=A%?-4
480 IF B%:IF A%?-3=&CD:IFA%?-5=&3E:E%=A%?-4
490 =B%
500 :
510 DEFFNuc(A$):LOCAL B$:IFA$="":=""
520 REPEATB$=B$+CHR$(ASCA$AND((A$<"@")OR&DF)):A$=MID$(A$,2):UNTILA$="":=B$
530 DEFFNs(A$):IFLEFT$(A$,1)=" ":REPEATA$=MID$(A$,2):UNTILLEFT$(A$,1)<>" "
540 IFRIGHT$(A$,1)=" ":REPEATA$=LEFT$(A$,LENA$-1):UNTILRIGHT$(A$,1)<>" "
550 =A$
560 DEFFNh0(A%,N%)=RIGHT$("0000000"+STR$~A%,N%)
570 DEFFNd(A%,N%)=RIGHT$(" "+STR$A%,N%)
580 DEFFNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
590 DEFPROCgbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:CALL &FFD1:ENDPROC
600 DEFFNgbpb(A%):X%!1=name%:CALL&FFD1:A%=name%+((1+?name%)AND((A%AND-2)=6))
610 A%?(1+?A%)=13:=$(A%+1)
620 DEFFNgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL&FFD1:IFX%!5=1:=""
630 A%=name%:A%?(1+?A%)=13:=$(A%+1)
640 DEFFNargs(A%,Y%,ptr%):LOCAL X%,E%:IF?(TOP-3)=0:E%=Y%:Y%=0
650 IFPAGE<&8000:LOCAL !&70:X%=&70:!X%=ptr%:CALL&FFDA:=!X%
660 SYS"OS_Args",A%,Y%,ptr% TO ,,ptr%:=ptr%
670 DEFFNargsA(A%):IFPAGE<&8000:LOCAL X%,Y%,E%,!&70:X%=&70:=(USR&FFDA)AND&FF
680 SYS"OS_Args",A% TO A%:=A%
690 DEFFNfs:LOCAL A%,Y%,E%:=(USR&FFDA)AND&FF
700 DEFFNcr:PRINTCHR$10;:OSCLI"FX3,16":PRINTCHR$13;:OSCLI"FX3":=""