EXPLODING INTO CODE
Marcus Jeffrey turns the heat on the Blast compiler
IF YOU HAVE ever written a Basic program, or if you have ever owned a Basic program, you can probably find a use for the Blast compiler.
When you run a Basic program it is interpreted by the Spectrum, one line at a time. The advantage of compiling the code is that the entire Basic program is converted into machine code before it is run, giving a much faster execution time.
Blast arrives on cassette with a 30-page user manual. You can also backup Blast onto microdrive. Now to speed up those sluggish programs, though you are not likely to be able to do a lot with less than 3K of memory available!
Unfortunately, in order to create such a sophisticated compiler, the programmers have used nearly all of the available memory. So, if you want to compile a program of any reasonable size, you will have to compile from tape-to-tape - or microdrive.
Compiling on the Spectrum can be very prolonged, especially using tapes. In that case, you first have to load in the toolkit and make a special copy of the program to be compiled onto tape. You then start compilation, and the computer constantly prompts you to change the tapes over.
The main selling points of Blast are its speed and Basic compatibility. We put it through its paces. Programs can be compiled into either pure machine code or the more compact 'p-code'. OCS claims a speed increase of up to a factor of 40. Try as we might we could not get even close to that, whatever instructions we included. Nevertheless, you can expect a minimum speed increase of between five and 10 times for most situations.
Blast is said to be able to compile all Basic programs. That includes those which call user-written machine code routines, and even those using Basic extensions.
We tried out a number of programs, and all but one worked correctly. We have still no idea why that one program posed problems. The assumption must be that Blast is pretty clever and will compile most, but not quite all, programs.
Blast was initially to have included a number of highly optimised Basic- extensions, such as WHILE..WEND, REPEAT..UNTIL, IF..THEN..ELSE and multi-line recursive functions. Unfortunately due to space restrictions those were not included - a great loss. Instead, supposedly as compensation, Oxford Computer Systems has programmed a couple of extra - and in comparison useless - additions to the toolkit, included on the reverse of the cassette. These are shown in figure one.
Blast does have its drawbacks, but its flexibility for such a wide range of programming applications makes it a must for the serious programmer.
Publisher: Oxford Computer Systems, Hensington Road, Woodstock, Oxford OX7 1JR. Tel: 0993 812700
FIGURE 1. TOOLKIT COMMANDS
*E n1 - Edit line n1*J n1 - Joins line n1 to the subsequent line*C n1,n2 - Copy line n1 to n2*C ,n - Copy the range of lines to n onwards*D nl - Delete line nl.*D - Delete the line range.*M nl n2 - Move line nl to n2.*M ,n - Move the range of lines to n onwards.*R ,nl,n2 - Renumber the line range, starting at n 1 with step n2.*F ,string - Find and string in the line range.*S ,sl,s2 - Find and replace string s1 with s2 in the line range.*G - Turn on Global find and search.*A - Turn on Accept find and search (prompts user at eachmatch).*V - Lists a number of useful system variables.*L - Lists all currently defined BASIC variables, including theirvalues.*T - Start BASIC trace. halts execution.*U - Stop BASIC trace.*K - Kill REM statements (other than the special commandREMS).*W , - SAVE the range of lines to cassette.*B - SAVE the current program to cassette in a form suitable for Blast compilation (tape-to-tape).*Q - Quit the toolkit.Note: The toolkit requires approximately 2K of memory, and cannot be used at the same time as Blast.