home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug037.ark
/
PASSWORD.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
2KB
|
79 lines
10 REM THIS PROGRAM CHANGES A 'BASIC' COMMAND WORD TO A USER-DEF COMAND WORD
20 REM FROM INTERFACE AGE FEB 1980 PAGE 20
30 Z9$=CHR$(12):REM Z9$ CLEARS SCREEN
40 PRINTZ9$
50 REM
60 REM * CONVERT HEX TO DECIMAL FOR LOOP *
70 REM
80 DIM A(4)
90 G1=0
100 PRINT
110 INPUT "WHAT IS BEGINNING HEX ADDRESS OF 'BASIC' ";N$
120 IF LEN(N$)=4 THEN 160
130 PRINT
140 PRINT "MUST BE A 4-DIGIT NUMBER, RE-ENTER"
150 GOTO 100
160 J=1
170 L=LEN(N$)
180 FOR I=1 TO 4
190 A(I)=ASC(MID$(N$,J,1))-48
200 IF A(I)>9 THEN A(I)=A(I)-7
210 J=J+1
220 NEXT I
230 AA=4096*A(1)+256*A(2)+16*A(3)+A(4)
240 IF G1=1 THEN 310
250 A1=AA:REM A1=BEGINNING DECIMAL ADDRESS OF 'BASIC'
260 PRINT
270 PRINT
280 INPUT "WHAT IS ENDING ADDRESS OF 'BASIC' ";N$
290 G1=1
300 GOTO 160
310 A2=AA:REM A2=ENDING DECIMAL ADDRESS OF 'BASIC'
320 REM
330 REM * INPUT OLD AND NEW WORD FOR SEARCH *
340 REM
350 PRINT
360 PRINT
370 INPUT "WHAT IS WORD TO LOCATED ";W$
380 PRINT
390 PRINT
400 PRINT "WHAT IS NEW";LEN(W$);"-LETTER WORD ";
410 INPUT T$
420 IF LEN(T$)=LEN(W$) THEN 520
430 PRINT
440 PRINT
450 PRINT
460 PRINT
470 PRINT"MUST BE";LEN(W$);"-LETTERS LONG"
480 GOTO 380
490 REM
500 REM * NOW LOOK FOR MATCH IN BASIC *
510 REM
520 PRINTZ9$
530 PRINT
540 PRINT"THIS MAY TAKE A WHILE, SO BE PATIENT"
550 FOR J=A1 TO A2
560 B=PEEK(J)
570 FOR K=1 TO LEN(W$)
580 IF CHR$(B)<>MID$(W$,K,1) THEN 660
590 B=PEEK(J+K)
600 NEXT K
610 PRINT
620 PRINT
630 PRINT
640 PRINT "MATCH IS FOUND AT ADDRESS";J;"DECIMAL"
650 GOTO 730
660 NEXT J
670 PRINTZ9$
680 PRINT"NO MATCH WAS FOUND"
690 END
700 REM
710 REM CHANGE OLD TO NEW WORD *
720 REM
730 FOR I=1 TO LEN(W$)
740 B=ASC(MID$(T$,I,1))
750 POKE J,B
760 J=J+1
770 NEXT I
780 END