FOLLOW YOUR PROGRAMS STEP BY STEP MAKING YOUR PROGRAMMING QUICKER AND EASIER ZX SPECTRUM TRACE TRACE is a machine coded utility program designed to help you to write, understand and correct programs written in BASIC on the SINCLAIR ZX SPECTRUM. Versions of the program for both the 16K and 48K machines are recorded on opposite sides of the tape. LOADING THE PROGRAM 1) Ensure the connections between the SPECTRUM and the cassette recorder are correctly made as detailed in the SINCLAIR manual. 2) Reserve an area of memory for TRACE to reside in by entering either CLEAR 31839 (16K) or CLEAR 64607 (48K). THIS OPERATION is VITAL! Strange results will occur if this is not done correctly. 3) Type LOAD "TRACE 16K" CODE OR LOAD "TRACE 48K" CODE, depending on which version you require, then start the tape. Alternatively you may use the command LOAD ""CODE (No space between the quotes). You may load the program either before you enter/load a BASIC program, or while a BASIC Program is in memory. USING THE PROGRAM Tracing the BASIC program is started by calling the machine code routine with a USR call (See chapter 26 of the SINCLAIR Manual). We suggest you use the command RANDOMISE USR, rather than PRINT USR as suggested by SINCLAIR. RANDOMISE USR 31840 is used to start tracing in the 16K version. RANDOMISE USR 64608 in the 48K version. The command can be issued from within a BASIC program, or as a direct command (but see note 1 below). Termination of tracing can be achieved from within a program by a USR call to address 31872 (16K) or 64640 (48K). Termination of tracing will occur automatically if any error report is issued. When in "trace mode" each BASIC statement is displayed in the lower screen area. Statements which would exceed one line, and therefore cause the screen to scroll, are truncated to prevent corruption of the upper screen area. Three of the keys on the keyboard are now available for different uses as follows:- 1) The 'CAPS SHIFT' key. Depressing this key will cause the BASIC statement in the lower screen area to be displayed in 'BRIGHT' mode. A short delay follows (about 1 second), and the statement is then executed. The next BASIC statement is then displayed. Holding the 'CAPS SHIFT' key down provides a repeat facility, statements following the first are executed at high speed. 2) The 'SYMBOL SHIFT' Key. Depressing this key causes the BASIC statement in the lower screen area to be copied to the printer (if attached). The statement is then executed and the next statement displayed. Note that this line, when copied to the printer, is not truncated. 3) The 'SPACE' key. Depressing this key causes a 'BREAK' into the program. The statement in the lower screen area is not executed. CONTINUE works normally after this BREAK. NOTES: (in the following lines the letters nnnnn mean either 31840(16K) or 64608 (48K) 1) If the command 'RANDOMISE USR nnnnn' is used alone as a direct command, and not followed by another command on the same line, then 'trace made' will be enabled, the report 'O-O.K.' wiil be issued, and trace will be automatically terminated. To instigate 'trace mode' from a direct command use the construct 'RANDOMISE USR nnnnn' RUN' (or RANDOMISE USR nnnnn: CONTINUE). 2) Programs which contain machine code subroutines will be traced successfully, provided the machine code subroutines do not occupy, or use, the area of memory occupied by TRACE. Unfortunately this includes the HORIZONS cassette supplied with the machine if using the 16K TRACE program. Users of the 48K trace can successfully trace all the programs on the HORIZONS cassette. 3) Variables and other expressions can be printed at any point during the program by 'BREAKING' into the program, and then immediately (i.e. without pressing the ENTER key first) entering the command construct PRINT#0,AT 1,0; variable: PAUSE 0. This will print the variable in the lower screen area. Pressing ENTER will allow continuation, with or without trace (see note 1). 4) INKEY$. This function returns the value of the key being pressed at the instant that the statement executes. In order to provide a value for this function the key(s) required should be held during the time while the lower screen area displays the BASIC statement in 'BRIGHT' mode, or during the time when the line is being passed to the printer. 5) TRACE also introduces the report 'C - NONSENSE IN BASIC' for a new reason, if either a GOTO or GOSUB points to itself, i.e. the statements 10 GOTO 10 or 20 GOSUB 20 will cause error C. The repeat speed obtained when holding the 'CAPS SHIFT' key depressed can be altered to suit your requirements by POKEing a value between 0 and 255 into address 32465 (16K) or 65233(48K), higher values giving slower repeat speeds. The value of this address when the program is first loaded is set to 0. © Copyright 1983 Texgate Computers Ltd. ALL RIGHTS RESERVED. UNAUTHORIZED COPYING, HIRING, LENDING, PUBLIC PERFORMANCE AND BROADCASTING OF THIS CASSETTE IS PROHIBITED. THE PUBLISHER ASSUMES NO RESPONSIBILITY FOR ERRORS, NOR FOR LIABILITY FOR DAMAGE ARISING FROM IT'S USE.