Crash


MCoder III

Categories: Review: Software
Author:
Publisher: PSS
Machine: Spectrum 48K

 
Published in Crash #20

Mcoder III

Mcoder 3 arrived shortly before this review was finished. It was first published in France last year, by an outfit called Ere Infomatique. Now PSS have bought UK rights and renamed it Mcoder 3, though it has nothing in common with earlier Mcoders. It is an interesting program, which operates quite differently from the others on the UK market.

We looked at a French copy of the compiler, with documentation to match 'Vous venez de transformer un program BASIC en language machine', it chirps in fluent Franglais. The cassette cover features a wonderful Picture of a circuit assembly being sucked through a funnel I hope PSS use this on the UK version. They are working on an expanded English manual, but in fact Meader 3 doesn't need much documentation, since it compiles just about all of ZX BASIC, with very few idiosyncrasies.

Mcoder 3 is a full floating-point compiler, to be compared with BLAST and Softek's (rather more restricting) FP program. The compilation process is more long-winded than Softek's, as the compiler must be loaded in two sections every time a compilation is required. No instructions are provided on how to make a working copy, which is a mistake since the master tape is likely to get quite a thrashing; there is a spare copy on the other side of the cassette.

You can compile programs of up to about 25K with Mcoder 3. The snags are that you can't compile from microdrive or tape (there is no support for Interface 1 commands) and you lose your original program as it is compiled.

The only restrictions from standard ZX BASIC are that arrays must have constant dimensions (rather than dimensions worked out by the program) and they can only be dimensioned once. MERGE and LIST are not allowed in compiled programs, since there's no program text after compilation, and RUN and CLEAR reset variables to null or zero rather than forget them completely.

USING MCODER 3 Before using Mcoder 3 you should load your BASIC as normal. Then type LOAD CODE and play the compiler cassette for about forty seconds. This loads the first part of the compiler, which checks for errors (reporting only one at a time, but leaving your BASIC in memory), deletes comments and generally tidies up before the real work begins. One nice feature is that REMs at the start of a program are retained, in case they contain machine code. Likewise DATA and DEF FN statements are kept in their original form, though they can be called from compiled programs.

A succession of messages flash up as the tidying process takes place - then the compiler prints PLAY and you can load the rest of Mcoder3, which takes about 20 seconds. Mcoder 3 generates code at about the same rate as BLAST; it took a total of twelve minutes to compile a 16K program. As compilation takes place, the line number being analysed is displayed at the bottom of the screen.

When compilation is complete, you are left with a listing containing initial comments, DATA, function definitions and a single REM concealing the compiled code. You can start the program from any line with GO TO (so long as you have the original listing to hand); Break is allowed (unlike Softek's FP compiler) and error messages even contain BASIC line numbers. You can print and alter variables used in compiled programs in the normal way, but CONTINUE doesn't work (you have to use GO TO). RUN, DIM and CLEAR may corrupt the code if used after compilation.

The benchmark timings show that Mcoder 3 produces quite fast code - it gives substantially better results than BLAST and FP, and this is especially noticeable when 'real' programs are compiled.

The bad news is that Mcoder3 seems to have a few bugs:

INK RND*5

gave an error when run in compiled form, presumably because the compiler does not automatically round results to a whole number, as normal BASIC does. This snag was not hard to get around - we just added an INT statement in the line which Mcoder 3 indicated to be the source of the problem - but it is an incompatibility which should not be present.

We also had problems with strings getting corrupted as one compiled game ran. We discussed this by telephone with the publishers in France, but we were unable to work out a fix, or even diagnose the cause. Other string-handling programs worked fine.

Despite these flaws, Mcoder3 is the only compiler we have looked at that has been able to compile 'off the shelf ' programs with a reasonable degree of success. Soften FP compiler restricts the use of GO TO, GO SUB, arrays, functions and logical operators (AND and OR), and this meant that it would only cope with very straight-forward programs. BLAST was a waste of time.

CONCLUSIONS It is surprising how well the old compilers have stood the test of time - perhaps this is because software houses underestimate the task of testing a compiler properly. ZIP still produces the fastest code at the lowest price, though it works slowly and lacks strings. Softek's IS, and Mcoder 2 are still Good value, although Colt provides a lot of extra features for three pounds more. Softek say that they will enhance FP to remove some of the restrictions (already VAL and VAL$ are allowed). but they ' ll have their work cut out to catch up with Mcoder 3. BLAST can only be recommended to masochists.

Serious games writers might do best by using a mixture of two compilers - one to handle the majority of the code, with a few restrictions, and an integer compiler to process high-speed sections. A discounted package offering IS and FP is in the offing, though users should bear in mind that Mcoder 2, IS, FP, and Colt are mutually incompatible since they all use the same memory to store run-time routines.

It is certainly possible to write hit games with a BASIC compiler - Virgin's Sorcery and PSS's Frank N Stein prove that - but there are still times when only machine code can deliver the goods. If you're a hardened hacker, this may come as some relief!

Other Spectrum 48K Game Reviews By


  • Firework Music Front Cover
    Firework Music
  • Diet Master Front Cover
    Diet Master
  • Minder Front Cover
    Minder
  • Mighty Magus Front Cover
    Mighty Magus
  • Pyracurse Front Cover
    Pyracurse
  • Transversion Front Cover
    Transversion
  • Decor Wreckers Front Cover
    Decor Wreckers
  • Apple Jam Front Cover
    Apple Jam
  • It's Only Rock 'n' Roll/The Tomb of Dracula Front Cover
    It's Only Rock 'n' Roll/The Tomb of Dracula
  • Xavior Front Cover
    Xavior