This is the second in a series of tutorials designed to give TS2068 users some guidance on using the various TOOLKIT options. This article will focus on those functions using the Diverted Interrupts feature. These are Disable New, Autoline Number, Constant Memory, Trace and finally Return Interrupts to Normal. It will also cover the INFORMATION functions.
Once again, it is very wise to SAVE your work many times as you proceed, for as Murphy is quoted, “If something CAN go wrong, it WILL”. If you have the interrupts turned ON (ie, diverted), do not try to make a LARKEN AUTOSTART SAVE of any listing you are working on. Check toolkit option I; if the interrupts are diverted, press the X option on the menu to make them normal. Then go ahead with the AUTOSTART SAVE.
Before going into the “Interrupt” options, let’s cover the INFORMATION or STATUS routines: INFORMATION, LIST VARIABLES, HEX & DEC conversions.
[I] INFORMATION
This will reveal some useful information:
Amount of memory left: Note this is five bytes off the mark by virtue of the different TS2068 ROM being used.
Interrupts Status: Diverted or Normal. These could be referred to as ON or OFF respectively.
User Defined Graphics display. These can be completely garbled but can be restored to their normal status by using the UDG Designer. More on this in a later article.
Plus some others: Program length & Variables length which added to Memory left = User RAM available. A command can be entered without returning to the menu.
[V] LIST VARIABLES
Displays, in the order declared, all simple variables with their values except that CHR$ 0 to 31 in strings are printed as (?) (thus z$=”??text??” would imply some attributes included in the string to give colour to text). FOR-NEXT variables are shown in CAPITALS. DIM variables are printed with their dimensions but no values.
The variables shown will be those in the VARS area. Just because variables are shown in the listing does not mean that they are alive. It is best to check this option when all or most of the variables in any program have been exercised, or at the very least be aware that all variables in the listing may not be displayed.
[H] HEX & DEC
Very useful display of both hex and decimal values for any number (0-65535); you can keep on entering values and exit to the menu by pressing ENTER.
By way of explanation, it is helpful to understand the ROM “collect number routine” which uses the ROM editor to allow input up to five bytes; these must be positive whole numbers. If the first character is (#), the characters A-F or a-f are treated as digits and a hex number is evaluated.
Now the INTERRUPT OPTIONS:
[W] DISABLE NEW
This is the key routine for Diverted Interrupts. Functions (N), (Q) and (T) are all routed through here so that when THEY are ON, the (W) function is ON too.
Pressing (A) in the K Mode will give STOP and not NEW, a safety feature when programming. If you press Symbol Shift and A in the L Mode, nothing appears to happen; but the next key pressed will be taken as K Mode. Symbol Shift A followed by just A will give STOP. This is useful when using Search and List or Search and Replace as it avoids having to THEN (keyword) (backspace) DELETE (forward space), bad enough in Spectrum but a gigantic pain in the neck with the TS2068. More on this when we come to those options in a later article.
[N] AUTOLINE ON
This is best used when you are developing a new program. You decide on the increment (usually 10 but not more than 100). Once this option is activated and each time the ENTER key is pressed, a line number will be inserted in the EDIT line. This line number will be the sum of the current line and the increment. You may change the line number at any time by DELETING it and inputting a new one less the increment (eg, if you want to start numbering lines at 9000 and the increment is 10, input 8990).
It will very rarely append to a line after a syntax error and you will have to delete such an error.
This routine will be turned OFF if Constant Memory, Trace, Disable New or Interrupts Normal routines are turned ON. Use RANDOMIZE USR 60000 to get to the menu and then press (x).
[Q] DISPLAY MEMORY
This will display Memory Left in the upper right hand corner of the screen. The value will alter as the free memory changes.
This routine will be turned OFF if Autoline Number, Trace, Disable New or Interrupts Normal routines are turned ON.
[T] TRACE ON
This gives a constant display of the current program line. First you set the speed (max 100 is close to normal running speed). Reducing the number will slow down the response time so that you can get a rough idea why a program is going wrong and at what line. You can override the speed set by using (ENTER and K together) or freeze the program by holding down (ENTER and L together).
This routine will be turned OFF if Autoline Number, Constant Memory, Disable New or Interrupts Normal routines are turned ON.
[X] N/Q/T/W OFF (Interrupts NORMAL)
Switches off any and all the interrupt options. You can now use NEW if you wish!
This is a sample Status Report using (I). Note: interrupts are diverted, even though no interrupt options may have been activated; also that memory left is five bytes over the PRINT FREE value.
STATUS REPORT MEMORY LEFT: 28042 bytes PROGRAM LENGTH: 10401 bytes VARIABLE FILE: 332 bytes USER RAM: 38775 bytes INTERRUPTS DIVERTED
A sample Variables List prepared for this article by saving it to a RND/SEQ file using the Larken command: (RANDOMIZE USR 100: OPEN #2, “name OUT”). Stream 2 had previously been OPENed to channel “p” ready for this.
p0=1 oz=8200 oy=110 oo=0 oa=1 p$=Put in Drive 0, then press a key" d=2 N=5 h$="" d$(12) n$="e" g$="??PICA?? "