Program renumbering routine.
Appears on
Library tape of the Indiana Sinclair Timex User’s Group.
Source Code
9958 STOP 9959 LET T$="": LET X=23635 9960 DEF FN A(X)=PEEK X+256*PEEK (X+1) 9961 DEF FN B(S)=256*PEEK S+PEEK (S+1) 9962 LET S=FN A(X) 9963 LET LINE=FN B(S): IF LINE>=9958 THEN GO TO 9976 9964 LET LENGTH=FN A(S+2) 9965 IF PEEK (S+4)=234 THEN GO TO 9969 9966 FOR I=S+4 TO S+LENGTH+2 9967 IF PEEK I=236 OR PEEK I=237 THEN GO SUB 9971 9968 NEXT I 9969 LET S=S+LENGTH+4 9970 GO TO 9963 9971 IF PEEK (I+5)=14 THEN GO TO 9974 9972 PRINT "NON-STANDARD COMMAND, LINE ";LINE 9973 STOP 9974 LET T$=T$+STR$ I+CHR$ PEEK (I+1)+CHR$ PEEK (I+2)+CHR$ PEEK (I+3)+CHR$ PEEK (I+4) 9975 RETURN 9976 LET BASE=2000: LET X=23635 9977 LET S=FN A(X) 9978 LET LINE=FN B(S): IF LINE>=9958 THEN STOP 9979 LET LENGTH=FN A(S+2) 9980 FOR I=1 TO LEN T$ STEP 9 9981 IF VAL T$(I+5 TO I+8)=LINE THEN GO SUB 9990 9982 NEXT I 9983 POKE S,INT (BASE/256) 9984 POKE S+1,BASE-256*INT (BASE/256) 9985 LET BASE=BASE+10 9986 LET S=S+LENGTH+4 9987 GO TO 9978 9990 FOR J=1 TO 4 9991 POKE (VAL T$(I TO I+4)+J),CODE (STR$ BASE)(J) 9992 NEXT J 9993 LET BYTE1=128+INT (LN BASE/LN 2+1) 9994 LET BYTE2=BASE*65536/(2^(BYTE1-128)) 9995 LET MEMORY=VAL T$(I TO I+4) 9996 POKE MEMORY+6,BYTE1 9997 POKE MEMORY+7,INT (BYTE2/256)-128 9998 POKE MEMORY+8,BYTE2-256*INT (BYTE2/256) 9999 RETURN