10REM"
20REM"
40REM"
60REM" This program will print out
70REM" Basic programs from disc. This
80REM" may be a useful search tool.
90REM" Characters below ASCII 32 are
100REM" turned into @, remove line 510
110REM" to change this. Use SHIFT+CTRL
120REM" to slow down the output. Use
130REM" ESCAPE to read another file.
140REM" ------------------------------
150REM" This program is P.D.
160REM" Please do not alter it in any
170REM" way. If you use any part of it
180REM" please mention me in the
190REM" the titles. Thankyou, CJR.
200REM" ------------------------------
210DEFFNS="Basread"
220O%=&200:Z%=TOP+O%:LOMEM=Z%+O%+&100:
REM O%=CODE LENGTH. &9C FREE
230PROCass
240P%=Z%+2:?(Z%+1)=&D:REPEAT:READA$:$P
%=A$:P%=P%+LENA$+1:UNTILA$="OSCLI"
250ONERROR:CLOSE#0:IFERR<>17 REPORT:PR
INTERL:END
260REPEAT:REPEAT:MODE7
270PROCd("Basic program reader."):PROC
d("By C.J.Richardson")
280*.
290PROCd("File to read? RETURN Or * co
mmand."):INPUTF$:IFLEFT$(F$,1)="*" OSCLI
F$:PROCd("Press a key"):REPEATUNTILGET
300IFF$=""PROCme:F$="*"
310UNTILLEFT$(F$,1)<>"*":F%=OPENIN F$
320MODE0
330?&70=F%:!&77=&0064000A:!&7B=&271003
E8
340CALLstart:CLOSE#F%
350PRINT"End of file press a key":REPE
ATUNTILGET:UNTILFALSE
360DEFPROCd(A$):PRINTTAB(18-LENA$/2)"
C
370DEFPROCass
380FORL%=0TO2STEP2:P%=Z%-O%:[:OPTL%:.s
tart:LDA#0:STA&72:STA&73 ½ Setup
390.B%:LDY&70:JSR&FFD7:STA&71:CMP#&D:B
NEl15:JSRnl:LDA&81:BEQB%:RTS:.l15 ½ Newl
ine?
400CMP#34:BNEl9:LDA&72:CMP#0:BNEl8:INC
&72:INC&72:.l8:DEC&72:LDA&71 ½ " found
410.l9:CMP#&F4:BNEl10:INC&73:LDA#82:JS
R&FFEE:LDA#69:JSR&FFEE:LDA#77:JSR&FFEE:J
MPB% ½ REM found
420.l10:LDA&73:BNEl2 ½ REM is on
430LDA&72:BNEl2 ½ " are on
440LDA&71:CMP#&8D:BNEC%:JSRl12:.C% ½ C
alculate target
450LDA&71:CMP#&80:BMIl2:CLC:SBC#&7E:ST
A&71: ½ Keyword if above &7F
460.l13:LDX#0:.l3:JSRl5 ½ Search data
470CMP#&D:BNEl3 ½ New keyword?
480DEC&71:LDA&71:CMP#0:BNEl3 ½ Keyword
found?
490.l4:JSRl5:CMP#&D:BEQl7:JSR&FFEE:JMP
l4:.l7:LDA#Z%DIV256:STAl6+2:JMPB% ½ Keyw
ord
500.l2:LDA&71
510CLC:CMP#32:BCSok:LDA#64:.ok ½ Check
and remove low code
520JSR&FFEE:JMPB% ½ Print ASCII code
530.l5:INX:CPX#0:BNEl6:INCl6+2:.l6:LDA
Z%,X:RTS ½ Search data
540.nl:JSR&FFEE:LDA#10:JSR&FFEE:LDA#0:
STA&72:STA&73 ½ Reset
550JSRl16:LDA#32:STA&7F
560.l14:LDA&81:BEQl29:RTS:.l29:LDA#0:S
TA&76:LDX#6:.l20:SEC:LDY#0:.l17:LDA&75:S
BC&77,X
570PHA:LDA&74:SBC&78,X:BCCl18:STA&74:P
LA:STA&75:INY
580JMPl17:.l18:PLA:TYA:ORA&76:BNEl19:L
DA&7F:JMPl21:.l19:TYA:ORA#&30:STA&76
590.l21:JSR&FFEE:DEX:DEX:BPLl20:LDA&75
:ORA#&30:JSR&FFEE ½ Print line number
600RTS
610.l12 ½ GOTO and GOSUB
620JSRl16:LDA#0:STA&7F:LDA&74:PHA
630LDA&75:EOR#&40:STA&75
640LDA&76:EOR#&40:STA&74
650PLA:STA&76:AND#4:BEQl27:LDA&76:EOR#
4:STA&76:JMPl22
660.l27:LDA&74:ADC#&40:STA&74
670.l22:LDA&76:CMP#&40:BEQl25
680.l23:CMP#&70:BNEl24:LDA#&80:JMPl25
690.l24:CMP#&60:BNEl14:LDA#&C0:JMPl25
700.l25:CLC:ADC&75:STA&75:LDA&74:ADC#0
:STA&74:JMPl14
710.l16:LDA#0:STA&81:LDY&70:CLC ½ File
handle
720JSR&FFD7:STA&74 ½ Used by line numb
er and GOTO and GOSUB
730JSR&FFD7:STA&75:BCCl28:INC&81:RTS:.
l28
740JSR&FFD7:STA&76
750RTS
760]:NEXT
770ENDPROC
780DEFPROCme
790L%=PAGE-1:REPEATL%=L%+1
800IF?(L%-1)=&D PRINT'STRING$(5-LEN ST
R$(?L%*256+?(L%+1))," ");STR$(?L%*256+?(
L%+1));:L%=L%+3:I%=0:R%=0:PROCremcheck
810IF?L%=58PROCremcheck
820IF?L%=34:I%=I%EOR1
830IFR%<>1:IFI%<>1:IF?L%>&7F:RESTORE:F
OR IL%=1TO ?L%-&7F:READ A$:NEXT:PRINTA$;
ELSE VDU?L%
840UNTILL%>TOP-3:PRINT:ENDPROC
850DEFPROCremcheck:REPEAT:IF?L%<&80:VD
U?L%:L%=L%+1:IF?L%=34I%=I%EOR1
860UNTIL?L%>&7F OR?L%=13:IF?L%=244:R%=
1:PRINT"REM";:L%=L%+1
870ENDPROC
880DATAAND,DIV,EOR,MOD,OR,ERROR,LINE,O
FF,STEP,SPC,TAB(,ELSE,THEN,,OPENIN,PTR,P
AGE,TIME,LOMEM,HIMEM,ABS,ACS,ADVAL,ASC,A
SN,ATN,BGET,COS,COUNT,DEG,ERL,ERR,EVAL,E
XP,EXT,FALSE,FN,GET,INKEY,INSTR(,INT,LEN
,LN,LOG,NOT,OPENUP,OPENOUT,PI,POINT(,POS
890DATARAD,RND,SGN,SIN,SQR,TAN,TO,TRUE
,USR,VAL,VPOS,CHR$,GET$,INKEY$,LEFT$(,MI
D$(,RIGHT$(,STR$,STRING$(,EOF,AUTO,DELET
E,LOAD,LIST,NEW,OLD,RENUMBER,SAVE,EDIT,P
TR,PAGE,TIME,LOMEM,HIMEM,SOUND,BPUT,CALL
,CHAIN,CLEAR,CLOSE,CLG,CLS,DATA,DEF,DIM
900DATADRAW,END,ENDPROC,ENVELOPE,FOR,G
OSUB,GOTO,GCOL,IF,INPUT,LET,LOCAL,MODE,M
OVE,NEXT,ON,VDU,PLOT,PRINT,PROC,READ,REM
,REPEAT,REPORT,RESTORE,RETURN,RUN,STOP,C
OLOUR,TRACE,UNTIL,WIDTH,OSCLI