A&B Computing


The BBC Micro Toolbox

Categories: Review: Software
Publisher: BBCSoft/BBC Publications
Machine: BBC Model B

 
Published in A&B Computing 1.11

The BBC Micro Toolbox

This is a release from earlier this year, full of utility programs to assist in the writing, testing and debugging of your own BASIC programs.

Some of the routines are embedded within BASIC programs. The intention is that you extract the routine from the program to use in your own. For example, there is a BASIC program that demonstrates the two main ways of plotting a circle, and then fills it with the new horizontal fill command (PLOT 77,x,y). All three parts are separate procedures easily separated, or rewritten for personal use.

Included with the package are nine machine code utilities providing a wealth of programming genius. The programs vary in length from &100 to &300 bytes, and so are easily locatable below PAGE. These are also co-resident, i.e. they can exist in memory at the same time as the BASIC program you are working on.

Cross Referencer is the first of these utilities. It enables the user to obtain a list of all the lines in which a specified string or command appears. You have the option of either listing out just the line numbers or the line numbers plus the program line.

Packer is next on the list. It will test the length of each of your program's lines and crunch them together if possible. It calculates the number of bytes on the line, then calculates the number on the second and, if below the maximum, makes the two lines into one. This rule continues until the end of the program. It will not act on lines beginning with DEF or REM.

For REMs there is REM stripper. References to lines within the program are changed to "live" lines. It looks for the REM BASIC token and therefore will not remove comments in assembler.

Space Remover is of the same ilk. Another shrinker, the idea is to actually remove all the unwanted spaces between the text which, under normal circumstances, make the program readable. One thing I found about using this program was that it encourages the correct use of BASIC, since if you use certain lazy shortcuts, especially with regard to variables, you end up with a syntax error because of using the space remover. For example:

IF A = SPAC E = 8
where A, SPAC and E are all variables. This line becomes:

IF A=SPAC=8

This results in an error. A THEN is needed. The utility tokenises the keywords (identified and marked in position). For example:

IF A = X THEN PRINTTAB(8); "Hello"

After passing through the cruncher, the line appears on the screen as:

IFA=XTHENPRINTTAB(8)"Hello"

which is exactly the same as the previous line except that no spaces are visible. But in essence they are still there, thus maintaining the correct grammar. If you were to copy this line for some reason, the line would take on an entirely different meaning where two variables would be made equal to each other, A and XTHENPRINTTAB(8)!

Replacer allows one word to be swapped with another anywhere in the program. Good for changing variable and procedure names.

Resequencer will allow you to move a block of code around a program to save having to retype it again. This is achieved by the single command line, detailing the lines to be copied, and then the destination line number.

Spacer puts the spaces back in to give a neat and readable appearance to your listings (for submission to A&B). To avoid syntax errors the program is written to look at the keyboard "tokens" and ignore some of them. One of these codes to be ignored is that Keyword PROC, since to put a space around this would cause an error. The call could not be executed. Nor are spaces inserted at the start or end of lines (since these take up valuable memory in BBC BASIC). The reverse of Packer reads lines, encounters colons and invents new lines.

Variable Dump is also very useful if you are writing programs for publication. It sends all the used variables in your program to the screen and, if you wish, printer.

All the above utilities are written in assembler, listings of which are in the manual along with detailed explanations and step by step "how to use" sections. Amongst the other BASIC programs on the cassette are Character Generator, Graphics Dump and Disassembler. The latter provides a clear and readable memory dump and shows absolute addresses, so you can tell exactly where the next pointer is.

Other programs include a large number of sorting routines, a RAM test program, a procedure for writing the character set sideways, a speech chip number generator and a double size characters routine for use in any mode.

All the programs are very well written but some might be considered just "stocking fillers". There are plenty of similar utilities around and the user will have to decide on how much use he or she will make out of such an expensive package.

This article was converted to a web page from the following pages of A&B Computing 1.11.

A&B Computing 1.11 scan of page 71

Page 71

A&B Computing 1.11 scan of page 72

Page 72