image of READY prompt

Wang2200.org

Listing of file='TBO.FIND' on disk='vmedia/toolbox.wvd.zip'

# Sector 458, program filename = 'TBO.FIND'
0010 REM TBO.FIND 11/27/87 Look thru program list for LOAD stmts
0012 REM .COM T$(T9,255)14 created in TBO.SDC1 has catalog data
0014 REM .COM T2$(T9,255)2 has sorted ptrs.
0016 REM #1 is disk ref.
0030 REM %REQUIREMENTS
0032 DIM D9$3,F1$9,T1$(255)2,T3$(255)2,F0$(80)25,P$(999)8, R$(255)3
   : D9$=SELECT #1
0034 REM %.Put file list from SORTCAT into P$()
0035 P9=1
   : FOR A=1TO T9
   : FOR B=1TO 255
   : P$(P9),F1$=STR(T$(VAL(T2$(A,B)),VAL(STR(T2$(A,B),2))),7,8)
   : IF F1$=" "THEN DO
   : A=T9
   : B=255
   : END DO
   : P9=P9+1
   : NEXT B
   : NEXT A
0040 INIT(FF)R$()
   : P9=0
0050 REM %0 #0 System Disk, #1 Program Disk,  /215 Printer
0060 REM %0 '7 Restart point, '12 Type in Program table, '98 Ask Disk surface
0070 DIM K$1,A(1),V1$1
0080 REM %0 V1$ LOAD verb
   : V1$=HEX(A1)
   : REM /.Verb to find is LOAD
0081 REM .A5 SELECT
   : REM .85 SAVE
   : REM .89 DSKIP
   : REM .BB DBACKSPACE
   : REM .A1 LOAD
   : REM .86 LIMITS
   : REM .8E DISK
   : REM .AC SCRATCH
   : REM .AD MOVE
0090 DIM A1$(4)64, B1$(255)1
0100 DIM D$64,D0$1,H1$1,P$16,C$11,C$(124)10,M$2,L$2,B$(255)1,T$1,V$1,Q$4,B$1
   : L,L1,L2,M,C,J,Z=0
   : GOTO 1230
   : REM %LIST LOGIC VARIABLES
0110 REM %0 A( Atom table, A A, J0 J0, T8 T8, W needs flag
0120 REM %0 R Ref ptr, R$( Ref table, T1$( SORT tbl, T2$( SORT tbl
0130 REM %0 B$ B$1, B$( Line Text, C Column ctr, C$ Prt. word, D3 D3, D9 D9
0140 REM %0 C$( Atom table, D$ Date, D9$ Disk, D1$( Disk table, P$( Prog.table
0141 REM %0 E Error code, F1$ $9 text string
0142 REM %0 M$( Menu table, F0$( Func.descriptors, F0 F0$() ptr
0145 REM %0 H$ Header byte, J Ptr, K$ KBD char, T$ T$1 w/a,
0150 REM %0 L Lines/page, L$ Stmt line, L1 L1, L2 L2, M Margin
0160 REM %0 H Hard copy, P$ Program name, P9  P$() ctr, X  B1$() ptr
0162 REM %0 M0 Mode
0170 REM %0 P6 Cur. file #, P7 # files, T8 Ptr from 1, T9 Ptr from 255,
0180 REM %0 Q$ $4 stmt number,  V$ Verb atom, Z Z
0190 REM %^.List logic
0250 GOSUB 1260
   : J=2
   : STR(L$,1,1)=B$(J)
   : STR(L$,2,1)=B$(J+1)
   : J=J+2
0260 GOSUB 420
   : GOSUB 670
   : C=M+6
   : IF M0=2THEN 265
   : PRINT TAB(M);HEXOF(L$);" ";
   : GOTO 280
0265 J=POS(B$()=HEX(0D))
   : RETURN
0270 J=J+2
0275 J=J+1
0280 B$=B$(J)
   : IF B$>=HEX(80)THEN 310
   : IF B$=HEX(0D)THEN 380
0290 IF B$=HEX(22)THEN 390
   : C$=B$
   : GOSUB 430
   : GOTO 275
0310 IF B$<>HEX(FF)THEN 330
   : UNPACK(##)B$(J+1)TO L1
   : UNPACK(##)B$(J+2)TO L2
   : CONVERT L2+L1*100TO Q$,(####)
   : Z=POS(Q$<>"0")
   : IF Z>0THEN 320
   : Q$="0"
   : Z=1
0320 C$=STR(Q$,Z)
   : GOSUB 430
   : GOTO 270
0330 IF B$<>HEX(A2)THEN 360
0340 B$=B$(J)
   : AND (B$,7F)
   : C$=C$(VAL(B$)+1)
   : GOSUB 430
   : PRINT " ";
   : C=C+1
0350 J=J+1
   : B$=B$(J)
   : IF B$>HEX(7F)THEN 340
   : IF B$=HEX(0D)THEN 380
   : IF B$=":"THEN 280
   : C$=B$
   : GOSUB 430
   : GOTO 350
0360 AND (B$,7F)
   : C$=C$(VAL(B$)+1)
   : GOSUB 430
0370 IF Z=1THEN 275
   : IF STR(C$,Z,1)="("THEN 275
   : PRINT " ";
   : C=C+1
   : GOTO 275
0380 IF H>0THEN RETURN
   : PRINT
   : RETURN
0390 PRINT HEX(22);
0400 J=J+1
   : PRINT B$(J);
   : IF B$(J)<>HEX(22)THEN 400
   : GOTO 275
0410 J=J+1
0420 IF B$(J)=" "THEN 410
   : V$=B$(J)
   : IF M0<2THEN PRINT
   : RETURN
0430 IF C$=HEX(00)THEN RETURN
   : Z=LEN(C$)
   : C=C+Z
   : PRINT C$;
   : RETURN
0450 REM %^BUFFER LOGIC
   : REM %BUFFER VARIABLES
0460 REM %0 D0$ HEX(0D), M$ Search result
0470 REM %0 A1$( Disk Read Area
0480 REM %0 A1 Disk Sector, B B
0490 REM %0 B1$( Text area, B1 Text ptr, B2 Ptr to '0D'
0500 IF B1=2THEN 510
   : ON POS(HEX(FDFE)=B1$(B1))GOTO 510,520
   : MAT COPY B1$()<B1,256-B1>TO B1$()
   : B1=2
   : RETURN
0510 B1=2
   : DATA LOAD BA T#1,(A1,A1)A1$()
   : H1$=A1$(1)
   : IF STR(A1$(),,2)=HEX(20FE)THEN 520
   : MAT COPY A1$()<2,255>TO B1$()
   : RETURN
0520 REM .End of File
   : RETURN CLEAR
   : GOTO 1140
0524 REM %^.Search loop
0525 B1=B1+B2+1
0530 GOSUB 500
0540 MAT COPY B1$()TO B$()
0550 SELECT PRINT 005
   : STR(L$,1)=B$(2)
   : STR(L$,2)=B$(3)
0560 MAT SEARCHB1$()<1,255>,=D0$TO M$
   : B2=VAL(M$,2)
   : IF B2=0THEN STOP "Illogical no CR on record "#
   : X=4
0570 REM %.Look for LOAD verb
   : MAT SEARCH B1$()<X,B2-X>,=V1$ TO M$
   : A=VAL(M$,2)
   : IF A>0THEN 590
0580 REM %.LOAD not found
   : IF W=0THEN 525
   : W=0
   : MAT COPY B1$() TO B$()
   : GOSUB 250
   : B1=J+3
   : GOTO 530
0590 REM %.Atom found make sure it is not a stmt ref
   : X=X+A
   : IF B1$(X-3)=HEX(FF)THEN 570
   : IF B1$(X-2)=HEX(FF)THEN 570
0600 REM %.LOAD atom found
   : T$=B1$(X-1)
   : A(1)=A(1)+1
   : W=1
   : IF R>254THEN 570
   : R=R+1
   : R$(R)=T$
   : STR(R$(R),2,2)=L$
   : GOTO 570
0650 REM %^.Set non LOAD stmts to periods
0660 REM %0 D0 pos of CR,  D1 pos of colon, D2 pos of "
0670 REM .Set D0 = pos of CR
   : D1,D0=POS(B$()=HEX(0D))
0680 MAT SEARCHSTR(B$(),,D0),=":" TO T1$()
   : IF T1$(1)=HEX(0000)THEN 710
   : J0=J
0690 REM .Set D1 = pos of colon
   : D1=VAL(T1$(1),2)
   : T1$()=STR(T1$(),3)
   : IF D1=0THEN D1=D0
0700 Z=D1-J0
   : IF POS(STR(B$(),J0,Z)=V1$)=0THEN IF M0>0THEN INIT(HEX(00))STR(B$(),J0,Z)
   : J0=J0+Z+1
   : IF J0<D0THEN 690
0710 REM %.Examine LOAD stmts
   : REM . (DATA) LOAD .. (OPEN) (#d or /hhh) ("FileName"/a$)
   : REM . LOAD (#d or /hhh) ("FileName"/a$)
   : REM
   : REM .1).Set LOAD verb ptrs into T1$()
   : MAT SEARCHSTR(B$(),,D0),=V1$ TO T1$()
0720 REM .2).Set J0 LOAD verb ptr
   : REM .3).Move T1$() up 1 ptr
   : J0=VAL(T1$(),2)
   : IF J0=0THEN RETURN
   : T1$()=STR(T1$(),3)
0730 IF B$(J0-1)<>HEX(97)THEN 740
   : IF B$(J0+2)<>HEX(B4)THEN 720
   : REM .DATA LOAD OPEN
   : C$="D"
   : GOSUB 760
   : J0=T9
   : T9=T9-1
   : GOTO 750
0740 REM .LOAD
   : C$="P"
   : GOSUB 760
   : J0=T8
   : T8=T8+1
0750 IF T8=T9THEN STOP #
   : T3$(J0)=STR(B$(),2,2)
   : GOTO 720
0760 F1$="????????"
   : D3,F0=0
   : D1=POS(STR(B$(),J0,D0-J0)=":")
   : IF D1=0THEN D1=D0-J0
   : Z=POS(STR(B$(),J0,D1)=HEX(22))
   : IF Z=0THEN 762
   : F1$=STR(B$(),J0+Z)
   : D3=POS(F1$=HEX(22))
   : STR(F1$,MIN(9,D3))=" "
0762 F0=F0+1
   : IF F0$(F0)=" "THEN F0$(F0)=STR(F1$,,8)&"="&C$
   : IF STR(F0$(F0),,8)<>F1$THEN 762
   : IF C$="D"THEN RETURN
   : GOTO 764
0764 MAT SEARCH P$(),=STR(F1$,,8) TO M$STEP 8
   : IF M$>HEX(0000)THEN 766
   : P7=P7+1
   : P$(P7)=STR(F1$,,8)
   : GOTO 764
0766 STR(F0$(F0),12)="Function"
0768 IF F1$<>"????????"THEN CONVERT INT(VAL(M$,2)/8)+1TO STR(F0$(F0),21,4),(##
     ##)
   : IF C$<>"P"THEN RETURN
0770 REM .Find if an overlay
   : Z=POS(STR(B$(),J0,D1)=HEX(FF))
   : IF Z>0THEN STR(F0$(F0),12,8)="Overlay."
   : RETURN
0778 REM %^SET-UP
0780 PRINT "Source Program disk -"
0790 J=0
0800 REM .NOTE.List of functions to examine may come 1 of 3 ways
   : REM .via COM P$(J) table from TBO.DMAP
   : REM .DATA stmt list
   : REM .via name entry
0810 H=0
   : IF P$(1)=" "THEN 820
   : PRINT "List of programs is from COMmon P$() array"
   : REM .via COM
   : H=1
   : GOTO 860
0820 P7=0
0830 DEFFN'5
   : P$=" "
   : INPUT "PROGRAM NAME",P$
   : IF P$=" "THEN 870
   : IF P$="DATA"THEN 860
0840 LIMITS T #1,P$,A1,B,Z
   : REM ^ERR 80 KEY S.F. '5 FOR NEW NAME
0850 J=J+1
   : P$(J)=P$
   : IF H=0THEN IF P7=0THEN 830
0860 P7=1
   : IF H=1THEN P$=P$(J+1)
   : ELSE READ P$
   : STR(P$,9)=" "
   : IF P$=" "THEN 820
   : PRINT J+1;P$
   : IF P$="????????"THEN 850
   : GOTO 840
0870 ON P7GOTO 820
   : IF J=0THEN 830
   : P7=J
0880 DEFFN'7
   : REM .Restart point
   : P6,H=0
   : INPUT "KEY 1(EXEC) FOR HARD COPY",H
0890 D$=" "
   : IF H=0THEN 900
   : INPUT "DATE",D$
   : GOSUB 1260
   : PRINT HEX(0D0C0E);"Function analysis of ";D9$
0900 L=55
   : REM /LINES/PAGE
   : M=5
   : REM /MARGIN
0910 IF P6<P7THEN 915
   : STOP "END OF JOB "#
0915 GOSUB 1130
   : P6=P6+1
   : P$=P$(P6)
   : SELECT PRINT 005
   : FOR Z=1TO 15
   : PRINT ". -";
   : NEXT Z
   : PRINT
   : PRINT P$,D$;" ..SELECTED LINES   Prog. ";P6;" of";P7
0916 IF P$="????????"THEN LINPUT "What is unknown file name",P$
   : IF P$=" "THEN 910
   : IF P$="START"THEN IF P6<>1THEN 910
0918 LIMITS T#1,P$,A1,B,Z
   : ERRORE=ERR
   : PRINT "Error ";E,
   : GOSUB 1260
   : PRINT "Error ";E,
   : GOTO 950
0920 IF H=0THEN 924
   : GOSUB 1270
   : PRINT ". - . - . - . - . - . - . - . - . - . - . - . - . - . - ."
   : IF M0<2THEN PRINT P$,D$;" ..SELECTED LINES   Prog. ";P6;" of";P7
0924 REM .T3$(line ptrs)2  (T8)=LOAD  (T9)=DATA LOAD OPEN
   : T8=1
   : T9=255
   : INIT(FF)T3$()
   : INIT(" ")F0$()
0930 D0$=HEX(0D)
   : GOSUB 510
   : IF H1$<>HEX(40)THEN 950
   : GOSUB 510
   : ON POS(HEX(0020)=H1$)GOTO 540,540
0950 PRINT "Unable to examine file ";P$
   : GOTO 910
0960 DATA "LIST","CLEAR","RUN","RENUMBER","CONTINUE","SAVE"
0970 DATA "LIMITS","COPY","KEYIN","DSKIP","AND","OR","XOR"
0980 DATA "TEMP","DISK","TAPE","TRACE","LET","DRAM","DIM","ON"
0990 DATA "STOP","END","DATA","READ","INPUT","GOSUB","RETURN"
1000 DATA "GOTO","NEXT","FOR","IF","PRINT","LOAD","REM","RESTORE"
1010 DATA "PLOT","SELECT","COM","PRINTUSING","MAT","REWIND","SKIP"
1020 DATA "BACKSPACE","SCRATCH","MOVE","CONVERT","PLOT"," STEP"
1030 DATA " THEN"," TO","BEG","OPEN","CI","R","D","CO"," ","OFF"
1040 DATA "DBACKSPACE","VERIFY","DA","BA","DC","FN","ABS(","SQR("
1050 DATA "COS(","EXP(","INT(","LOG(","SIN(","SGN(","RND(","TAN("
1060 DATA "ARC","#PI","TAB(","DEFFN","TAN(","SIN(","COS(","HEX("
1070 DATA "STR(","ATN(","LEN(","RE","#","%","P","BT","G","VAL(","NUM("
1080 DATA "BIN(","POS(","LS=","ALL","PACK","CLOSE","INIT","HEX"
1090 DATA "UNPACK","BOOL","ADD","ROTATE","$","ERROR","ERR","DAC"
1100 DATA "DSC","SUB","LINPUT","VER(","ELSE","SPACE","ROUND","AT(","HEXOF(","M
     AX(","MIN(","MOD("
1110 REM DUMMY ATOMS
1120 DATA "MAT","ON ERROR"
1130 A(1)=0
   : INIT(FF)R$()
   : R=0
   : RETURN
1140 GOSUB 1260
1142 Z=34
   : IF M0<2THEN PRINT HEX(0D0E);P$,"ATOM (";HEXOF(V1$);") = ";A$;" IS USED ";
     A(1);"TIMES"
1143 IF A(1)>0THEN IF H=0THEN KEYIN K$
1146 IF T8=1THEN 1148
   : IF M0>1THEN 1148
   : PRINT "PROGRAM LOAD is at ";
   : FOR Z=1 TO T8-1
   : PRINT HEXOF(T3$(Z));" ";
   : NEXT Z
   : PRINT
1148 IF T9=255THEN 1150
   : IF M0>1THEN 1150
   : PRINT "DATA LOAD OPENs at ";
   : FOR Z=255 TO T9+1STEP -1
   : PRINT HEXOF(T3$(Z));" ";
   : NEXT Z
   : PRINT
1150 R,Z=0
   : MAT SORT R$() TO T1$(),T3$()
1170 IF A(1)=0THEN 1220
   : IF M0<2THEN PRINT "LOAD is at ";
1190 R=R+1
1200 X=VAL(STR(T3$(R),2))
   : IF V1$<>STR(R$(X),1,1)THEN 1215
   : IF M0<2THEN PRINT "--";HEXOF(STR(R$(X),2,2));
   : GOTO 1190
1215 R=R-1
   : IF M0<2THEN PRINT
1220 GOSUB 1300
   : REM /.Print summary
   : GOTO 910
1230 SELECT PRINT 005(80),INPUT 001
   : RESTORE LINE960
   : Z=1
   : PRINT HEX(03);AT(0,33);"Function Analyzer"
1231 READ C$
   : C$(Z)=C$
   : Z=Z+1
   : IF Z<123+2 THEN 1231
   : A$=C$(VAL(V1$)-127)
1232 PRINT "This program examines a system platter for specified atoms -- see
     lines 80+"
1233 PRINT "During execution "
   : PRINT "..PAUSE display by keying any non-SF key."
   : PRINT "..MODE  may be switched during run by SF '0, '1, or '2"
   : PRINT "..RECALL to a program number by SF '15."
1234 PRINT HEX(0E);      "Search for atom ";HEXOF(V1$);" = ";A$
1235 PRINT "Enter Mode"
   : PRINT "0=List all on (searched for atom) stmt lines"
   : PRINT "1=List only (searched for atom) stmts"
   : PRINT "2=List Summary only"
   : INPUT M0
   : IF M0<0OR M0>2THEN 1235
1240 GOSUB 1130
1250 C$="DEFAULT="
   : D$="LOAD"
   : L1=1
   : GOTO 780
1260 IF M0=2THEN SELECT PRINT 000
1270 IF H=0THEN RETURN
   : SELECT PRINT 215(80)
   : RETURN
1300 SELECT PRINT 005
   : IF H=0THEN 1310
   : SELECT PRINT 215(80)
1310 PRINT
   : PRINT HEX(0E);P$;TAB(30);"Function ";P6
   : FOR Z=1TO 80
   : IF F0$(Z)<>" "THEN PRINT STR(F0$(Z),10,15);"  ";HEX(0E);STR(F0$(Z),,8)
   : NEXT Z
   : SELECT PRINT 005
   : KEYIN K$,1320,1330
   : RETURN
1320 KEYIN K$,,1330
   : RETURN
1330 IF K$=HEX(0F)THEN 1340
   : Z=POS(HEX(000102)=K$)
   : IF Z=0THEN RETURN
   : M0=Z-1
   : PRINT "Switch to mode ";M0
   : RETURN
1340 PRINT "Recall to item between 1 and ";P7
   : Z=P6+1
   : INPUT Z
   : IF Z<0OR Z>P7THEN 1340
   : P6=Z-1
   : RETURN
4000 DEFFN'12
   : PRINT HEX(03);"Manually set P$() program table"
   : FOR P=1 TO 80
   : LINPUT -P$
   : P$(P)=P$
   : NEXT P
   : RETURN