10
20
30 :
40 DIM ctrl% 31,mem% 255:X%=ctrl%:Y%=X%DIV256:name%=mem%
50 idx%=0:REPEAT:f$=FNgbpb8(idx%):idx%=X%!9:IF f$<>"":PROCObject
60 UNTIL f$="":END
70 :
80 DEFPROCObject
90 IF FNfile(f$,5)<>1:ENDPROC
100 in%=OPENIN(f$):IF in%=0:ENDPROC
110 PROCgbpb(3,in%,mem%,256,0):CLOSE#in%:in%=0
120 rtype%=mem%?6:rcopy%=mem%?7
130 IF mem%!rcopy%<>&29432800:ENDPROC
140 PRINT"File:";TAB(14);f$
150 PRINT"Type:";TAB(14);"&";FNh0(rtype%,2);" ";
160 IF rtype%AND128:PRINT"S"; ELSE PRINT"-";
170 IF rtype%AND64 :PRINT"L"; ELSE PRINT"-";
180 IF rtype%AND32 :PRINT"R"; ELSE PRINT"-";
190 IF rtype%AND16 :PRINT"E"; ELSE PRINT"-";
200 PRINT" ";MID$("BASICTurbo65x2 68xx CPU4 CPU5 CPU6 PDP11Z80 32000CPU1080x86CPU12ARM CPU14CPU15",(rtype%AND15)*5+1,5)
210 num%=1:ptr%=mem%+9:REPEAT
220 IF ptr%>rcopy%+mem%:PRINT"Copyright:";:num%=3
230 IF num%=1:PRINT"Title:";
240 IF num%=2:PRINT"Version:";
250 A$=FNstr(ptr%):PRINTTAB(14);FNs(A$)
260 REPEATptr%=ptr%+1:UNTILptr%?-1=0:num%=num%+1
270 UNTIL ptr%>rcopy%+mem%+1
280 IF (rtype%AND&60)<>&60:PRINT:ENDPROC
290 count%=1:rtype%=rtype%AND15
300 IF rtype%=7 OR rtype%=9:count%=2
310 FOR num%=1 TO count%
320 IF num%=1:PRINT"Reload:";
330 IF num%=2:PRINT"Entry offset:";
340 PRINTTAB(14);"&";FNh0(!ptr%,8):ptr%=ptr%+4
350 NEXT num%
360 PRINT:ENDPROC
370 :
380 DEFFNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
390 DEFPROCgbpb(A%,ch%,X%!1,X%!5,X%!9):?X%=ch%:CALL &FFD1:ENDPROC
400 DEFFNgbpb8(ptr%):X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL&FFD1:IFX%!5=1:=""
410 A%=name%+1:A%!(A%?-1)=&D20:A%?(INSTR($A%," ")-1)=13:=$A%
420 DEFFNstr(A%):IF?A%<32:=""
430 A$="":REPEAT:A$=A$+CHR$?A%:A%=A%+1:UNTIL?A%<32:=A$
440 DEFFNh0(A%,N%)=RIGHT$("0000000"+STR$~A%,N%)
450 DEFFNs(A$):IFLEFT$(A$,1)=" ":REPEATA$=MID$(A$,2):UNTILLEFT$(A$,1)<>" "
460 IFRIGHT$(A$,1)=" ":REPEATA$=LEFT$(A$,LENA$-1):UNTILRIGHT$(A$,1)<>" "
470 =A$