
MASTER TOOL KIT


FOR THE SINCLAIR ZX SPECTRUM
16K AND 48K


 Copyright:
Oxford Computer Publishing Limited 1983
P.O. Box 99, Oxford, England

Written by James Hutchby

Transcribed by Nele Abels. Please help to keep Spectrum software 
usable - convert printed manuals into electronic text.

- Page 4 -

Table of Contents							Page No.

1. Introduction								5
2. Loading								5
3. Invoking the TOOL KIT						5
4. Entering Commands							6
5. Ranges of Lines							6
6 The TOOL KIT Commands							6
	6.1 Real time clock and alarm					6
	6.2 Return to BASIC						7
	6.3 List line(s)						7
	6.4 Merge lines							7
	6.5 Delete line(s)						7
	6.6 Move line(s)						8
	6.7 Copy line(s)						8
	6.8 Find string							9
	6.9 Find and list						9
	6.10 Substitute string						9
	6.11 Check syntax						10
6.12 Free memory							10
6.13 Display memory map							10
6.14 Change RAMTOP							10
6.15 Quash toolkit							10
6.16 Hard copy output							10
6.17 Change to lower case						11
6.18 Change to upper case						11
6.19 Exchange case							11
6.20 Remove REMs							11
6.21 Pack statements							11
6.22 Compress line(s)							12
6.23 Renumber line(s)							12
6.24 Display variables							13
6.25 Trace execution of program						14
6.26 Error trapping							15
6.27 Function keys							15
6.28 Clear Screen							16
7. Appendix								16


- Page 5 -

1. INTRODUCTION

How many times in the past have you wished that your Spectrum 
could find a string of characters, or move a block of lines to a 
new location, or trace the execution of a faulty program, or 
change RAMTOP without losing the variables, or merge two lines 
together, or renumber a program? - well, with Oxford Computer 
Publishing Ltd.'s Master Tool Kit it can. This powerful and 
sophisticated program adds a whole range of new commands and 
features to your Spectrum. Once loaded, Master Tool Kit can be 
forgotten about until the moment it's needed - when it can be 
summoned by the pressing of just two keys.

If you program in BASIC, it is true to say that your programming 
will never be the same again.

2. LOADING

Connect your Spectrum to a television, a power supply, a cassette 
player and a ZX printer (if you own one) and switch on. 
Disconnect the MIC lead from the cassette player and insert the 
Master Tool Kit tape. Type LOAD"", press ENTER and start the 
cassette player running. The program will load in three parts.

There are two versions of Master Tool Kit on the supplied 
cassette tape. Side one contains a version designed to run in a 
48K Spectrum and side two contains a version to run in a 16K 
Spectrum. Make sure you have the right side of the tape when 
loading.

Note that the Tool Kit must be loaded into your Spectrum BEFORE 
any other program. It is suggested that you load it at the 
beginning of a programming 'session' when it will remain in 
memory until needed. Master Tool Kit sits at the top of memory 
(just above RAMTOP) and occupies about 7  Kbytes.

3. INVOKING THE TOOL KIT

Master Tool Kit is summoned or invoked by pressing the SYMBOL 
SHIFT and the SPACE keys simultaneously. The Tool Kit first 
identifies itself by printing ist copyright message at the top of 
the screen and is then ready to accept a command. Note that the 
Tool Kit can only be invoked from normal edit mode (i.e. cursor 
flashing at the bottom of the screen) and not when a program is 
running.

For the technically minded, Master Tool Kit works by 're-
vectorin' the interrupt service routine to include some extra 
instructions. Interrupt mode 2 is used the keyboard is scanned 
fifty times every second to see whether the SYMBOL SHIFT and 
SPACE keys are being pressed as well as to update and display the 
real time clock etc. Note that if NEW is typed then the 
Spectrum's ROM will reset the Z80 to interrupt mode 1 and the 
Tool Kit will no longer be invoked by these keys. Typing RAND USR 
65533, however, will set mode 2 again (RAND USR 32765 for the 16K 
version).

- Page 6 -

4. ENTERING COMMANDS

Tool Kit commands are typed in on the bottom two lines of the 
screen in just the same manner as BASIC program lines and 
immediate commands are entered. As usual, the arrow keys can be 
used to move the flashing cursor to the left or right and the 
delete key can be used to correct mistakes.

Keywords such as FOR, RETURN, DRAW etc. (as might be required 
when 'finding') can be entered into command lines in two ways:

(i) Type a 'THEN' to get the K-cursor, enter the desired keyword, 
backspace the curser and delete the 'THEN'
(ii) Press the keys SPACE and K simultaneously to get the K-
cursor directly.

Note that Tool Kit commands can be entered in either upper or 
lower case.

5. RANGE OF LINES

Most of the Tool Kit commands detailed below act upon a 'range' 
of lines. A range is specified by two line numbers separated by a 
hyphen (-). For instance, the expression 10-50 means all l ines 
between and including the lines 10 and 50. If either of these two 
numbers is omitted, the Tool Kit uses default values of 0 and 
9999 respectively (9999 because this is the highest line number 
allowed in a program). Thus, the expression -20 means all lines 
from the start of a program up to and including line 20 and the 
expression 30- means all the lines from line 30 to the end.

A range which is just one line is also allowd i.e. 60 is 
equivalent to 60-60. If a range is not explicitly stated, a 
default range from the first line to the last rine (i.e. the 
entire program) is assumed.

6. THE TOOL KIT COMMANDS

6.1. Real time clock and alarm

Master Tool Kit features a 'real time' clock - that is to say a 
clock which runs independently of whatever else the computer is 
doing and keeps an accurate recored of the time. This clock can 
be displayed continuously on the screen at the top right hand 
corner (but be warned that this display will take precedence over 
whatever BASIC may print at these locations).

The following commands are used to control the clock: -
CL ON - turns on the screen display of the clock.
CL OFF - turns off the screen display of the clock (but the clock 
keeps counting).
CL - prints the current time.
CL hh:mm:ss - sets the current time (in 24 hour mode). For 
example CL 13:10:00 sets the time 10 ten past one in the 
afternoon.

Master Tool Kit features a real time alarm. When the clock time 
reaches the alarm time (it doesn't matter whether the clock is 
currently ON or OFF) and the alarm is set, the Spectrum beeps 
through ist internal loudspeaker. This beeping will continue 
until turned off.

A similar set of commands is used to control the alarm: -
AL ON - turns on the alarm.
AL OFF - turns off the alarm.

- Page 7 -

AL - prints the alarm time.
AL hh:mm:ss - sets the alarm time (in 24 hour mode).

When the alarm is actually sounding there is a slight degradation 
in processor speed (the Z80, after all, can't do anything else 
while it's 'beeping'). This may be noticeable on automatic 
listings where the display seems to 'freeze' for a moment, but is 
nothing to worry about.

It is very easy to get completely involved when programming a 
computer, to lose all track of time and to inadvertently work 
late into night (not so good when one has to go to work next 
morning). If this happens to you, a possible use for the alarm 
facility is to set a 'bettime' to remind you when to call it a 
day.

N.B. As mentioned above, the real time clock is a background task 
driven by the Spectrum's interrupt facility. Certain BASIC 
commands, specifically those commands where accurate timing is 
importand, disable the interrupt when being executed. 
Consequently, the clock will lose time when programs are SAVE'ed 
or LOAD'ed or when characters are LPRINT'ed etc.

6.2. Return to BASIC - B

This command returns the user to the Spectrum's BASIC interpreter 
- this is the only exit from Master Tool Kit.

6.3. List line(s) - L range

This command lists a line or block of lines. For example, L 10 
lists line ten (if it exists of course) and L 10-100 lists from 
line 10 to line 100. As each screenful of information is 
displayed, the computer stops with the usual "scroll?" message. 
Pressing the keys N, n, SPACE or STOP will abort the listing; any 
other key will allow the listing to continue.

6.4. Merge lines - MER line1, line2

This command 'merges' two lines together to make a single line. 
For example, if a program contains the lines 10 FOR a=1 TO 10 and 
20 NEXT a then command MER 10,20 has the effect of creating the 
composite line 10 FOR a=1 TO 10: NEXT a. The command MER 20,10 
would have produced the line 20 NEXT a: FOR a=1 TO 10.

The form MER line1,line1 is also allowed - this 'doubles up' a 
line.

Note that the Spectrum allows a maximum of 127 statements in a 
single line. Master Tool Kit will signal an "INVALID COMMAND" 
error if you try to exceed the limit.

6.5. Delete line(s) - DEL range

This command deletes a line or block of lines. If an attempt is 
made to delete the whole of a program (i.e. DEL on ist own is 
entered) then Master Tool Kit seeks confirmation before 
proceeding. The message "DELETE WHOLE Y/N" is displayed on the 
bottom line of the screen - pressing Y or y will delete the 
block; pressing N or n will abort the deletion.

As mentioned above, the use of the BASIC command NEW is not 
encouraged because it changes the interrupt mode. As an 
alternative, the DEL command can be used to delete the program 
lines and then CLEAR used (after turning to BASIC) to delete the 
variables.

- Page 8 -

6.6. Move line(s) - MOV range,target,inc

This command moves a line or block of lines defined by 'range' to 
a new location in the program area. The first line in the block 
is given the new line number 'target', the second is given the 
line number 'target+inc', the third 'target+inc+inc' etc. These 
new line numbers mustn't already be in use - if they are, or the 
move operation would be such as to cause the line numbers in a 
program to lose their sequentiality, the error message "NO ROOM 
BETWEEN LINES" is displayed and the block not moved.

For example, consider following program:-

10 REM line1
20 REM line2
30 REM line3
40 REM line4
50 REM line5

The toolkit command MOV 10-20,41,1 would result in:-

30 REM line3
40 REM line4
41 REM line1
42 REM line2
50 REM line5

Note that a command such as MOV 10-30,41,5 would have generated 
the error message "NO ROOM BETWEEN LINES".

If you encounter an "OUT OF MEMORY" error when attempting to move 
a large block of lines, then move the block in smaller pieces one 
at a time. This is because sufficient memory must be available to 
hold both the original block and a copy of the block at ist new 
location (i.e. a block move is effectively a block copy followed 
by a block delete).

6.7. Copy line(s) - COP range,target,inc

This command makes a copy of a line or block of lines (defined by 
'range') at a new location in the program area. Ist syntax and 
operation are similar to the move command described above. Again, 
the copy operation is prohibited if it would cause the line 
numbers of a program to break strict numerical order.

If there is insufficient memory to hold a copy of the block, then 
the message "OUT OF MEMORY" is displayed and the block is not 
copied.

For example, consider following program:-

10 REM line1
20 REM line2
30 REM line3
40 REM line4
50 REM line5

The toolkit command COP 10-20,41,1 would result in

10 REM line1
20 REM line2
30 REM line3
40 REM line4
41 REM line1

- Page 9 -

42 REM line2
50 REM line5

6.8. Find string - F range \ string

This command finds all occurences of the specified string within 
the specified line or block of lines- the toolkit displays the 
line and statement numbers which locate each occurence. The 
string to be searched for can be up to 64 characters in length.

Because the backslash character (\) is used as a string 
delimiter, embedded backslashes in strings must be represented by 
two in succession. For example, the command F\\\ finds all the 
backslash characters in a program; the command F\a\\b finds all 
occurences of the string a\b.

The vertical line character (|, ASCII 124) is used in strings to 
represent ENTER (ASCII 13). Actual vertical line characters must, 
therefore, be represented by two in succession.

If no string is specified (a command of the form F range is 
entered) then Master Tool Kit uses the most recently entered 
string as a default.

For example, if a program contains the lines:-

10 FOR a=1 TO 10
20 PRINT a,a*a
30 NEXT a
40 PRINT
50 FOR a=1 TO 10:PRINT a,SQR a:NEXT a

Then the toolkit command F 10-50\a would produce the following 
output:-

10:1			20:1
20:1			20:1
30:1			50:1
50:2			50:2
50:3

The command F 10-50\PRINT would produce:-

20:1			40:1
50:2

6.9. Find and list - FL range\string

This command is similar to the find command described above, but 
with the distinction that the Tool Kit lists lines that contain 
the specified string rather than just displaying line and 
statement numbers.

6.10. Substitute string - S range\string1\string2

This command finds all occurences of string1 in a line or block 
of lines and replaces each of them with string2. Both strings can 
be up to 64 characters in length, and again, if omitted, the Tool 
Kit uses the most recently entered strings as defaults.

The command S range\string\ deletes all occurences of the 
specified string in a line or block of lines.

- Page 10 -

Examples:-

The command S \ PRINT \ LPRINT will change all the PRINT's in a 
program into LPRINT's; the command S \ STOP \ will delete all the 
STOP commands from a program.

6.11. Check syntax - SYNTAX range

This command checks the syntax of a line or block of lines - if a 
syntax error is fount, the Tool Kit displays a message of the 
form "SYNTAX ERROR IN line:statement". But more importantly, the 
command also adjusts the hidden binary forms in lines (see page 
166 Spectrum programming manual). As an example, suppose a 
program contained the constant 1.23456 in several places. It 
would make sense to save memory by replacing each of these 
constants with a variable, say the variable c, and include the 
line LET c=1.23456 at the beginning of the program. The Tool Kit 
command S \ 1.23456 \ c would indeed do this - but if the program 
was subsequently RUN, "C Nonsense in BASIC" errors would be 
generated each time the variable c was encountered (because the 
hidden binary forms, now reduntant, would still be in the lines. 
The SYNTAX command would correct things.

It is suggested that this command is applied as a safeguard 
whenever the substitute command is used.

6.12. Free memory - FR

This command displays the amount of free memory remaining in the 
Spectrum.

6.13. Display memory map - MAP

This command displays a graphic representation of the Spectrum's 
memory map. The major system variables are displayed alongside 
their current values. Refer to page 165 of the Spectrum 
programming manual for further details.

6.14. Change RAMTOP - RAMTOP address

This command changes the value of the system variable 'RAMTOP' 
without CLEAR'ing the variables. If an argument is specified, 
then RAMTOP takes the value of the argument - if no argument is 
specified, then RAMTOP is set to first byte below Master Tool 
Kit. Note that RAMTOP canot be set to anywhere within the Tool 
Kit itself or below the Spectrum's calculator stack (actually 
STKEND plus 200 bytes for machine stack usage).

6.15. Quash Tool Kit - QUASH

This command deletes some of the less essential commands from 
Master Tool Kits repertoire, specifially the command MAP and the 
commands to control the real time clock and alarm. The memory 
occupied by these commands (around 600 bytes) become available 
for BASIC's use and RAMTOP is adjusted accordingly. Note that 
'quashed' commands subsequently generate "INVALID COMMAND" errors 
if used.

6.16. Hard copy output - P ON and P OFF

The command P ON causes output generated by the Tool Kit to be 
directed to the ZX printer rather than the television screen. 
Conversely, the command P OFF re-directs output back to the 
screen. Note that error reports ("INVALID

- Page 11 -

COMMAND", "NO ROOM BETWEEN LINES" etc.) are always displayed on 
the screen.

6.17. Change to lower case - LC range

This command changes all upper case (capital) letters in the 
specified line or block of lines to lower case letters.

6.18. Change to upper case - UC range

This command changes all lower case letters in the specified line 
or block of lines to upper case letters.

6.19. Exchange case - XC range

This command changes all lower case letters to upper case letters 
and vice versa in the specified line or block of lines.



Commands to minimise program size - REMKILL, PACK, and COMPRESS

Master Tool Kit features three commands to reduce to a minimum 
the number of bytes needed to store a BASIC program, but - most 
importantly - without affecting the logic of the program, i.e. it 
will still RUN properly. Minimising has two immediate benefits:-

a) a program takes less time to SAVE and LOAD.
b) it runs faster.

6.20. REMKILL range - this command removes all REM statements 
from a line or block of lines.

6.21. PACK range - this command 'packs' multiple statements (up 
to 127) into single lines whilst preserving the 'flow' of a 
program.

For example the following program:-

10 GO TO 60
20 FOR a=1 TO 10
30 PRINT a
40 NEXT a
50 RETURN
60 PRINT "Hello"
70 GO SUB 20
80 STOP

would be PACK'ed into:-

10 GO TO 60
20 FOR a=1 TO 10: PRINT a: NEXT a: RETURN
60 PRINT "Hello": GO SUB 20: STOP

Notice how line 60 cannot be packed into line 20 because it's 
referenced by a GO TO instruction in line 10.

6.22. COMPRESS range - this is the most extreme (and most 
efficient) of the three commands. It has the effect of replacing 
explicit numeric constants in a line or block of lines by zeros. 
This may sound strange at first, but if you read page 166 of the 
Spectrum programming manual you will discover that a numeric

- Page 12 -

constant in a program line is followed by 5 bytes representing 
the constant in binary form. During the interpretation of a BASIC 
line, the Spectrum ROM routines simply ignore the explicit form 
of a constant and search for its hidden binary form instead. The 
COMPRESS command works by removing these explicit forms 
(replacing them with dummy zeros, in fact) but leaving the binary 
forms intact.

Note that COMPRESS also REMKILL's and PACK's. Savings of up to 
20% in the length of a program are quite possible with this 
command.

** WARNING ** Care must exercised when using this command since, 
once a program has been COMPRESS'ed, there is no way to recover 
its explicit numeric constant. Therefore, only fully debugged and 
properly working programs should be compressed in this way and, 
as an extra precaution, an uncompressed version should be saved 
on tape beforehand. In addition, the SYNTAX command should never 
be applied to programs that have been compressed and the 
individual lines of a compressed program should never be EDIT'ed 
(this would have the effect of changing the constants to real 
zeros).

For example the following program:-

10 PRINT 9.8765432e10
20 GO SUB 40
30 STOP
40 FOR a=1 TO 10
50 PRINT a,a/10
60 NEXT a
70 RETURN

would be COMPRESS'ed into:-

10 PRINT 0: GO SUB 0: STOP
40 FOR a=0 TO 0: PRINT a,a/0: NEXT a: RETURN

but would still produce the same output as the uncompressed 
version (try it and see).

6.23. Renumber line(s) - R range, start, inc

This command 'renumbers' a line or block of lines (or the entire 
program if a range isn't specified). Both the line numbers at the 
start of each line and any line numbers referenced within a line 
are changed. The first line in the block is given the new line 
number 'start', the second line is given the number 'start+inc', 
the third 'start+inc+inc' etc. If this number exceeds 9999 or the 
renumbering process is such that the line numbers would lose 
their sequentality, then the Tool Kit will abort the operation 
and display the message "LINE NUMBER OVERFLOW".

If 'start' or 'inc' is ommited, the Tool Kit uses the most 
recently specified values as defaults. Both these values are set 
to 10 when the program is first loaded.

Note that the renumber command cannot cope with computed GO TO's 
- that is any GO TO, GO SUB etc. followed by a variable or 
expression rather than just a simple decimal number. Master Tool 
Kit will signal any computet GO TO's it finds with a message of 
the form "CAN'T RENUMBER line:statement". It is up to the user to 
renumber these by hand.

- Page 13 -

Two passes are made through a block that is being renumbered. The 
first pass constructs a list of all the line numbers used while 
the second pass actually changes these line numbers. It may 
happen that there is insufficient memory to store the list 
created during the first pass. If this is the case, the message 
"OUT OF MEMORY" is displayed and no renumbering takes place.

Examples

Consider the following program:-

1 LET a=0
4 GO SUB 100
10 LET a=a+1
25 GO TO 4
100 PRINT a;" squared = ";a*a
105 RETURN

After renumbering with the command R, it would look like:-

10 LET a=0
20 GO SUB 50
30 LET a=a+1
40 GO TO 20
50 PRINT a;" squared = ";a*a
60 RETURN

Alternatively, the command R 1,1, would produce:-

1 LET a=0
2 GO SUB 5
3 LET a=a+1
4 GO TO 2
5 PRINT a;" squared = ";a*a
6 RETURN

Finally, the command R, 5-,100,10 would renumber just the 
subroutine:-

1 LET a=0
4 GO SUB 100
10 LET a=a+1
25 GO TO 4
100 PRINT a;" squared = ";a*a
110 RETURN

6.24 Display variables - V or V letter

The command V displays all the variables defined by a program 
alongside their current values; the command V letter displays 
only those variables whose names begin with the specified letter. 
Numeric variables, character strings, numeric arrays, character 
arrays and FOR-NEXT loop control variables are all displayed by 
this command. Note that the names of variables are printed in 
lower case letters except for loop control variables whose names 
are printed in upper case.

For example, the program:-

10 LET a=9.876543e21
20 LET b$="abcdefgh"
30 FOR n=1 TO 10: NEXT n
40 DIM a(2,3)
50 DIM c$(4,5)
60 DIM d$(8)

after being RUN, would produce the following output in response 
to the Tool Kit command V:-

a= 9.876543E+21	b$="abcdefgh"
N=11
a(1,1)=0
a(1,2)=0
a(1,3)=0
a(2,1)=0
a(2,2)=0
a(2,3)=0
c$(1)="     "
c$(2)="     "
c$(3)="     "
c$(4)="     "
d$="        "

The command V a would produce:-

a= 9.876543E+21
a(1,1)=0
a(1,2)=0
a(1,3)=0
a(2,1)=0
a(2,2)=0
a(2,3)=0


6.25 Trace execution of program - TR range, delay, line:statement

This command 'traces' a BASIC program - as each statement is 
executed, its line and statement number are displayed at the top 
right hand corner of the screen. This is a most useful debugging 
facility as it enables the 'flow' of a program to be studied.

The trace command allows for a variable time delay between the 
execution of each statement, this is specified in 50'ths of a 
second. For example, the command TR 25 traces a program with 1/2 
second delay between each statement. If 'delay' is ommited, a 
program runs at normal speed.

If any key is held down (apart from BREAK or P) while a program 
is tracing, the delay is suspended and it runs at normal speed. 
If BREAK is pressed a program is aborted and if P (or p) is 
pressed a program 'pauses' until another key is pressed, when it 
continues. If P is pressed repeatedly, a program can be 'single-
stepped', i.e. executed one statement at a time.

A range can also be specified (the default being, as usual, the 
entire program). The trace feature then only comes into 
operation, when a statement within the defined range is executed. 
This is a useful feature if one has isolated a bug in a program 
to a few key lines. The trace command can be set to be active 
over only these suspect lines - it is then obvious then they're 
reached and their operation can be studied in greater detail.

- Page 15 -

Finally, the line and statement where execution of the program is 
to begin can be specified. Defaults are zero.

If an error is encountered during the tracing of a program or the 
break key is pressed then the program stops in the normal manner 
with an error report printed on the bottom line of the screen 
(but see the section on error trapping below).

Note that TR is equivalent to GO TO 0 and not RUN 0 - the 
variables area is not CLEAR'ed and a RESTORE is not done. If this 
is important to your program, it can always be done from BASIC.

If the toolkit command P ON is entered before tracing a program, 
line and statement numbers are also sent to the ZX-printer.

The trace command turns the clock off.

6.26. Error trapping - ERROR line:statement and BREAK 
line:statement

During the normal execution of a BASIC program, if an error is 
encountered or the break key is pressed, the program is 
terminated with an error report printed on the bottom line of the 
screen. Master Tool Kit allows the programmer to decide what is 
to happen under these circumstances. The command ERROR 
line:statement causes a branch (i.e. GO TO) to be made to the 
specified line and statement if an error occurs during the 
execution of a program. Similarly, the command BREAK 
line:statement causes a branch to be made if the break key is 
pressed (take care with this command or you could find yourself 
unable to stop your programs). Note that ERROR or BREAK entered 
without an argument or with an argument of zero disables this 
facility.

For example, enter the following program:-

10 LET a=0
20 PRINT AT 0,0;a
30 LET a=a+1
40 IF a>100 THEN STOP
50 GO TO 20
100 PRINT AT 1,0;"Break key pressed"
110 GO TO 20

Set the break key vector with the command BREAK 100, then execute 
the program with the command TR 0-0 (the form TR 0-0 is useful as 
it allows one access to the error trapping facilities without 
line and statement numbers cluttering up the screen). If the 
break key is pressed and released, the program branches to line 
100, prints a message and then continues with the main routine. 
The conditional in line 40 is necessary to stop the program from 
being trapped in an infinite loop.

6.27. Function keys

Master Tool Kit features 10 user-definable function keys. 
Associated with each function key is a string of characters - 
this string is printed on the edit line (the bottom line of the 
screen) when the key is invoked. A function key is invoked by 
pressing the SPACE key and a digit key together (but press the 
SPACE key slightly before pressing the digit key).
 
An implied ENTER can be tagged on to the end of a function key 
string by adding the vertical line character (SYMBOL SHIFT and S 
keys when in E-mode).

- Page 16 -

Invoking the function keys is then as if its associating string 
was typed and ENTER pressed. If the function key holds a valid 
command (valid Tool Kit command or valid BASIC command) then it 
is immediately executed. Note that 256 bytes are available to 
store all the function key strings, but this memory can be 
divided between the ten keys in any proportion.

Commands to control the function keys:-

Kn - displays string associated with function key n(0-9).
K - displays all function key strings.
Kn \ string - sets function key string (the same rules apply 
about embedded backslashes and vertical lines as in the find 
command - see above).

Examples:

K0\hello sets function key 0 to the string "hello". Each time the 
keys SPACE and 0 are pressed, this string is added to the edit 
line.
K1\MAP| sets function key 1 to the string "MAP" followed by 
ENTER. Pressing the SPACE key and the 1 key consequently invokes 
the MAP Tool Kit command.
K2\FOR a=1 TO 10:PRINT a: NEXT a| sets function key 2 to this 
short BASIC program, again followed by an implied ENTER. If the 
SPACE key and the 2 key are presed from BASIC, this program is 
immediately executed.

6.28 Clear screen - CLS

This command is identical in operation to the BASIC command of 
the same name.

7. APPENDIX - SUMMARY OF COMMANDS

SPACE + SYMBOL SHIFT - invokes toolkit.

CL ON - turns on screen display of the clock.
CL OFF - turns off screen display of the clock.
CL - prints current time.
CL hh:mm:ss - sets current time to hours, minutes, seconds.

AL ON - turns on alarm.
AL OFF - turns off alarm.
AL - prints alarm time.
AL hh:mm:ss - sets alarm time to hours, minutes, seconds.

B - returns to BASIC.

L range - liste line(s).
MER line1,line2 - merges two lines.
DEL range - deletes line(s).
MOV range,target,inc - moves line(s)
COP range,target,inc - copies line(s)

F range\string - finds all occurences of string in range.
FL range\string - finds and lists all occurences.
S range\string1\string2 - changes all occurences of string1 in 
range to string2.
S range\string\ - deletes all occurences of string in range.

SYNTAX range - checks syntax in range and corrects hidden binary 
forms.

FR - displays free memory remaining.

- Page 17 -

MAP - displays graphic memory map.
RAMTOP address - changes RAMTOP without CLEAR'ing variables.
QUASH - quashes Tool Kit.

P ON - directs output to ZX printer.
P OFF - directs output to screen.

LC range - changes upper case letters in range to lower case.
UC range - changes lower case letters in range to upper case.
XC range - exchanges case in range.

REMKILL range - removes REM statements in range.
PACK range - packs statements in range into the minimum number of 
lines.
COMPRESS range - removes explicit numeric constants in range (+ 
REMKILL + PACK).

R range, start,inc - renumbers block of BASIC program.

V - displays all variables defined by programm.
V letter - displays only those variables that begin with 
specified letter.

TR range,delay,line:statement - traces execution of BASIC program 
over range with delay/50 seconds between statements.

ERROR line:statement - sets 'on error goto' vector.
ERROR - turns off error trapping facility.
BREAK line:statement - sets 'on break goto' vector.
BREAK - turns off break trapping facility.

Kn - displays string associated with function key n(0-9).
K - displays all function key strings.
Kn\string - sets function key string.
SPACE + digit key - invokes function key.
CLS - clears screen.

Notes.

(i) Ranges can be specified: 10-100, 50, -200, 300- etc. Default 
range is the entire program.
(ii) A vertical line (SYMBOL SHIFT+S when in E-mode) can be used 
in fuction key strings as an implied ENTER.
(iii) Embedded backslashes in strings must be represented by two 
in succession.
(iv) Pressing the keys SPACE and K together obtains the K-cursor.
(v) Tool Kit commands can be entered in either upper or lower 
case.

