ZX Computing
1st August 1984
Author: Tim Pickford-Jones
Publisher: Interactive Software People
Machine: Spectrum 48K
Published in ZX Computing #14
Scope Computer Graphics Language
For those handy souls wishing to write arcade-ish games to run at phenomenal speed with slick graphics and dynamic sound there is really no alternative yet to joining the ice-cool whizz kids whose daily diet of DJNZs and EX (SP), HLs send shivers of incomprehension down the computer corridors. However, with the Scope, a small step towards a human interface with the machine has been made.
What you have to do, after perusing the 48 page instruction book-cum-dictionary of Scope terms, is to type a lot of single statement REM lines are per Basic, then type in the magic command PRINT USR 60450 and hey presto (if you've done it all OK) the Scope compiles wads of unseen code which will certainly run a lot faster than the equivalent Basic. The Scope system uses 31 key words, deliberately unlike their Basic counterparts, such as "PUT" instead of "PRINT AT" which nearly all have certain arguments like line and column numbers, colour numbers, pitch and duration etc.
If, however, you need to know the value of PI to 16 places or the 1,000th prime then stop here. The Scope has a very limited arithmetical vocabulary; only increase and decrease on 1-byte integers and add for the 2-byte integers intended for scores. What you do get is a system for producing chunks of code which could be used as a complete progrmme or part of a hybrid. Passing values on from Basic to Scope and vice-versa is not mentioned in the book, nor is it all obvious how it could be done. Suffice it to say that you will have to search around until you find the Scope variable store and do some nifty PEEKing and POKEing from Basic.
The tape loads easily in 35 seconds and produces a suite of subroutines (one of which is the compiler itself) from address 60000 to the end of the computer. It then NEWs the Basic area with the RAMTOP set at 59999. So, naturally, you would write the eventual code at some point below this. Having successfully compiled some code, the clever programme tells you the next free byte after the chunk it has just done. One slight drawback here is that the whole of the Scope programme has to be in the computer as well as the code you have written. This is because the resulting code calls the many subroutines contained in the Scope. This is not really all that bad as the routines have to exist somewhere, but there are other compilers that provide copies of the required routines in the compiled code and don't bother with the ones you haven't used, so the finished article is independent of the compiler.
A word to those who have managed to bust the bank (not to mention Uncle's waiting list) and have Microdrives. The Scope as it stands wil encounter problems compiling your Basic if it does not begin at 23755, which of course it will not if you have recently used your drives. All is not lost, however, and three quick POKEs into the Scope and re-recording of the code before use will solve the problem once and for all. First, load the Scope then, as direct commands, enter the following: POKE 60459,42:POKE 60460,83:POKE 60461,92. This now tells the Scope to find the beginning of the Basic from the Spectrum's system variables instead of slavishly imagining that all Basic must start at 23755. Now SAVE "Scope" CODE 60000,5535 to a new piece of tape and there you have it. A simple and very useful modification. You will need to make a copy of the Scope Basic loader, or write one yourself, remembering to set the RAMTOP to 59999 before loading "Scope" CODE.
Negative aspects of the Scope are that text printing leads to some rather long winded code, the Fine-scroll (by one pixel) works in all directions, but leaves the attributes behind, and coarse scoll only works upards, but does include the attributes. There is a need to end each Basic statement with a colon, which to my mind is redundant as Sinclair lines have an end of line marker and a two-byte length of line indicator. It is a pity that the Scope writers did not use this instead of requiring the user to put in an additional market. Error trapping is quite good, but having trapped mistakes in the Basic you are not given much of an idea as to where the error is or what is wrong. All you get is "Parameter Error".
On the plus side, use of the Scope can encourage more structure in programming without the user realising it. It may tend towards less spaghetti in future Basic. For the more adventurous it can provide a selection of useful code routines which can be copied or amended for specific purposes, and there are some interesting solutions to the problem of indirect and implied addressing in relocatable code! As for that claim made by the makers that "Scope has one of the great advantages of Forth without the comcomitant disadvantages...", read carefully. They do not mention what these disadvantages are, and the ability to write subroutines which can all other subroutines is not confined to forth; the reference here is a little spacious.
Neatly packaged, well documented, Scope is a slightly friendly bridge between the real world of invaders and galaxians and the innermost workings of the micro. At £11.95 it's rather expensive, but as the blurb says: "Now, unlock your imagination."