Program Stopper for TS-1000

Author(s): Walt Coleman
Publication: LISTing Newsletter
Date: December 1992
Pages: 10

For the 16K T/S-1000

Originally appeared in “T/S Horizons” No. 16, November 1985

Have you ever thought you’d like a backup copy of a valued program but could’nt break into it to save it? Or have you admired a feature of a program and wanted to look at it to see how it’s done? Then this short (12 byte) program is for you.

The 8K Sinclair ROM provides features many more expensive computers lack. Unfortunately, to accomplish this, many M/C routines are intertwined and using them for our own purposes are difficult if not impossible. Many sources will provide the starting addresses of the LOAD (832 dec.) and BREAK (930 dec.) routines. But how can we combine these to load a program and then stop it so we can list or save it?

For you M/C lovers, the first three bytes of the LOAD routine in turn calls another routine whose purpose it is to identify the name of the program to be loaded. If there is no name, as in the case of LOAD”” then the Carry Flag is set and the seventh bit of the D register is set to 1. If the Carry Flag can be set and the D register loaded, this routne can be bypassed and the LOAD routine accessed by a USR call. The first program it comes to on a tape will be loaded. If we follow the load routine call by a break routine call we will have accomplished our purpose of loading and stopping our “unbreakable” tape.

MNEMONIC          COMMENT
LD A, 1 Force Carry
SRA A Flag to 1
LD D, 0 Set D Register
Call 835(dec.) Access LOAD routine 3 bytes in
Call 930(dec.) Access BREAK routine

So much for the technical aspects, let’s get down to the implementation. For the STOPPER to work, the T/S-1000 must be in FAST mode and the program must be outside of RAM so it will not be overwritten by the program we are loading. To do this we will reserve a minimal area above RAMTOP. STEP 1: FAST // STEP 2: POKE 16388, 242 ; POKE 16389, 127 ; NEW ; FAST // STEP 3: Enter the following program: 10 LET S=0 ; 20 FOR I=1 TO 12 ; 30 INPUT A ; 40 POKE(32754 + I), A ; 50 LET S= S + A ; 60 NEXT I ; 70 PRINT AT 0,0; “SUM= “; S // STEP 4: RUN the program and enter this list on numbers: 62, 01, 203, 47, 22, 00, 205, 67, 03, 205, 162, 03. // STEP 5: Your total should be 980. If not, repeat steps 3 and 4. // STEP 6: Now use STOPPER by entering RAND USR 32755 and turning on your tape recorder. If the load has been successful you will view a blank screen with the message D/0. If not, use the “usual” recorder adjustments to correct a normal unsuccessful LOAD and try again from step 6. — Walt Coleman.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.