Finds where a CODE file sits in memory when you don’t know its addresses. After the code is loaded, the program scans upward from 30000 for the first non-zero byte (the start), then down from 65367 for the last one (the end), and prints both addresses and the length. Line 10 asks for a Larken data disk, CATs it and loads the CODE file by name; on a tape system, LOAD the file with LOAD “”CODE yourself and GO TO 20. Unused memory must be clear (zeros) for the scan to work, and the length printed is end minus start, one less than the byte count.
It is one of the LKDOS tools sent to Sinc-Link by Bill Jones from the newsletter UPDATE, printed without an author’s name.
Published in Sinc-Link July-August 1989 (LKDOS Tools by the Half Dozen).
Source Code
5 REM "CODE FINDER"** Adaptable to all TS-2068 systems ** Finds start and end address, and byte length of any CODE program.
10 BORDER 0: PAPER 0: INK 7: CLS : INPUT "Data Disk #?";dd: RANDOMIZE USR 100: GO TO dd: RANDOMIZE USR 100: CAT "",: INPUT "File name";z$: RANDOMIZE USR 100: LOAD z$CODE
20 CLS : PRINT "Searching for Starting Code Adr"''': FOR z=30000 TO 65535
30 IF PEEK z<>0 THEN PRINT "Code Start is ";z: LET aa=z: GO TO 50
40 NEXT z
50 PRINT '''"Searching for END Code Address": FOR z=65367 TO z STEP -1
60 IF PEEK z<>0 THEN PRINT "End address=";z: GO TO 80
70 NEXT z
80 PRINT ''"The byte length is ";z-aa: STOPNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
