Crash


IS And FP Compilers
By Softek
Spectrum 16K/48K

 
Published in Crash #5

IS And FP Compilers

These are compilers for the 16K and 48K Spectrum - the 'IS' being an integer compiler, and the 'FP' being a full floating point compiler. As these are similar in many ways, they will both be covered in this one review.

Each of the compilers contains 16K and 48K versions on the same tape and comes in a large video case. They are supplied with a short but informative instruction leaflet. While the packaging looks very game-like, any more than a cursory glance will show that they are in fact very comprehensive and useful utility programs.

To load the compiler you simply type LOAD"". The program loads in two parts, a Basic loader then the compiler itself. When fully loaded, you will be asked whether RAMTOP at 40000 is OK, and given the option to change this if necessary - your Basic will be compiled immediately above RAMTOP.

IS Compiler

Once RAMTOP is set, you are told that you can NEW and Basic loader.

When the compiler is loaded, you can type in your Basic program, or load it from tape or microdrive in the usual way. As you may expect, the 'FP' version will handle more of the Basic than the 'IS', and your Basic program will have to be written bearing in mind the list of allowed commands. Both compilers are quite comprehensive, in the string handling, for instance, strings are totally flexible and can be any length. String slicing is allowed, as are LEN, STR$, CODE, CHR$, INKEY$, SCREENS$, "+" (for concatenation) Strings can be compared, as in Basic... this is far more powerful than the string handling in the Mcoder compiler (reviewed elsewhere). When compiling programs from magazines and so on, then obviously some modification is usually needed, but both compilers handle most Basic commands and it is usually quite easy to make the required changes to programs.

When your Basic is loaded and ready to be compiled, you simply type RAND USR 59300 (26600 for 16K).

Various messages appear as the compiler passes twice through your Basic - these are:

  1. Start Address.
    This is always one byte above RAMTOP.
  2. End Address.
  3. Variables End.
    This message appears when your program contains strings or arrays. These are stored immediately after your compiled Basic.
  4. First Pass/Second Pass.
  5. Error/No Errors.

After a successful compilation, the message "No Errors" appears. If the compiler finds an error then the "Error" message will appear, compilation will stop and the offending line is displayed with a question mark after the error. If this occurs then pressing EDIT will bring down the erroneous line for correction.

If compilation is successful, your program can be run using RAND USR START ADDRESS (given in 1 above).

Error reports use standard Sinclair error codes.

Your Basic program remains in memory after compilation. This allows modifications to be made if the machine code does not run as planned.

If all is well, your compiled program can be saved as CODE in the normal way. Note, however, that the compiler must be saved along with the compiled code as it contains several runtime routines needed for efficient programs. As with the Mcoder compiler, programs can be stacked in memory and used as subroutines; this is done by carefully setting and resetting RAMTOP.

Special Features

REM statements are used in both Softek compilers to obtain facilities not available from Basic. These include:

IS Version

  1. REM B
    Checks to see if BREAK is pressed
  2. REM S,a,x,y
    PRINTs a character (ASCII code 'a') on to the screen at PLOT position x,y

FP Version

  1. REM O,a,n,n...
    This simulates the Basic function ON a GOTO n,n...
  2. REM E,n
    If an error occurs, jump to line n

In Use

Both compilers proved very easy to use and the speed improvements are immediately noticeable. There seemed to be some problem when trying to use READ and DATA statements within a program loop - the program in question worked under Basic but gave an "Out Of Data" message when compiled. Also, if a variable was assigned within a FOR...NEXT loop an "Out Of Memory" error was sometimes encountered during compilation. This seemed to be intermittent and, if it did occur, using CLEAR cured it. These minor irritations aside, both compilers worked OK.

Applications

Both compilers take up about 6K of RAM. The FP compiler is obviously capable of more accurate results in scientific and technical applications but also, as it uses time consuming (accurate) floating point notation. The 'IS' compiler is more suitable for such things as games.

Softek claim in their advertisement, 'Superfast games involving hi-res graphics and movement are now possible, even if you are only knowledgeable in Basic.' This is, to some extent, true, but the hi-res movement (using REM S) ranges from not particularly fast to downright slow. It is just not fast enough for fast-moving games. Both compilers would be ideal for use alongside other machine code subroutines with, for example, an interrupt-driven sprite-moving routine. This would obviously need some knowledge of machine code, so it wouldn't be quite fair to say that compilers are the complete alternative.

Conclusion

At £9.95 for the 'IS' compiler, and £19.95 for the 'FP' version, these programs represent excellent value for money. If you are looking for a compiler, these two are probably the best on the market at the moment. The 'IS' compiler is far superior to the Mcoder from PSS, with the added bonus of (slow) mini-sprite graphics.

Please note, however, the copyright notice on the compilers - that the use of Softek's compiler must be clearly acknowledged on packaging, advertisements and on the initial screen title display if it is used for creation of commercial software.

Steven Wetherill