REVIEWS COURTESY OF ZXSR

MCoder II
by David Threlfall, John Hodgson
PSS
1983
Crash Issue 19, Aug 1985   page(s) 86,87,88

MACHINE CODE WITHOUT TEARS

The Niche takes a first look at Basic Compilers for the Spectrum.

There's a world of difference between ZX BASIC and machine code. Programs in BASIC tend to be slow, with jerky graphics and poor sound effects. Programs in machine code run hundreds of times faster - which doesn't mean that the graphics just jerk around the screen at Warp Factor Ten. No, machine code programming permits smoother movement, '3D' perspectives, simultaneous sound, animation and so on.

Of course, machine code doesn't necessarily make a game playable, and some classic games have been programmed entirely in BASIC - Mined Out, Football Manager and Velnor's Lair for instance. But if you want to write a shoot-em-up game, or a program with sophisticated graphics, you'll almost certainly find BASIC too slow.

Back in the olden days of Spectrum programming, when programmers assembled code in their heads, and the back pages of the old orange manual were the first to fall out, there wasn't much alternative to learning machine code once you'd come up against the limitations of BASIC.

Learning machine code was a traumatic process: before disks and microdrives (which brought their own meaning to the term random access') every programming mistake meant a crash. Teaching yourself machine code was a frustrating process as, after each mistake, it took several minutes to re-load your assembler, debugger and program source from tape in preparation for another crack at the problem.

Predictably it wasn't long before someone figured out that, if the computer was so fiendishly clever, it really ought to be able to make up machine code for itself. In this article we take a look at currently available BASIC to machine code translators, or 'compilers'. Next month we hope to examine Colt and Blast, two new and aggressive-sounding BASIC compilers which are under development. In future Niches we'll blow the dust off other Spectrum languages such as Logo, Forth, C, and Pascal.

Meanwhile, back at the keyboard....

WHY IS BASIC SO SLOW?

BASIC is slow because everything you type is carefully checked to make sure it is correct. This would be fair enough if it only happened once, when the program was entered, but the exhaustive checking continues even while a program is running.

If you write a program in BASIC to add 2 and 2 a hundred times, the computer will take as long to work out the answer the last time as it did the first 99 times. The actual adding is done fairly quickly in machine code (which is the only language the Spectrum's Z80 processor can really understand), but the overall effect is still very slow. This is partly because BASIC checks the syntax of lines over and over again, even after they have been entered (in case some stray POKE or Cosmic Ray has changed the contents of program memory?)

BASIC is also hampered by the need to cope with all sorts of special cases. The routine to add numbers in the Spectrum ROM has to be able to cope with functions, arrays, numbers and variables; these can have almost any value from minus several zillion upwards. The Z80 processor can only cope with a few digits at a time; it has to do all its arithmetic in several steps, just in case. Worse still, it can't multiply and divide at all, so these operations must be performed 'longhand'.

Much of the code in the Spectrum's ROM is taken from the earlier ZX81 BASIC, which was squashed into just 8K. In order to keep the size down, parts of ZX BASIC were written using a leisurely version of the compact Forth language, rather than machine code. A new ROM for the Spectrum is planned (though not by Sinclair), but nothing has materialised yet.

One of the nice features of Spectrum BASIC is the way that it lets you type in new lines of program and scrub out old ones as you test your program. This is hell for the BASIC system, which has to keep scrabbling around in tables to keep track of shifting variables and program lines. The longer your BASIC program, the worse this gets, so that a 20K program may run at half the speed of a 2K one. In compiled BASIC, however, the position of every line and variable is fixed. This makes programs fast, but means that you have to re-compile the whole lot if you changed one line.

Finally, ZX BASIC is cursed by the stupid way humans like to write things. We write 'X = 6 + 7' when the computer would be much happier with '6 + 7 = X'. It can't do anything with the name X till it finds the equals sign (meaning that a value must be stored). Similarly, the equals sign isn't really relevant till the computer knows what is to be stored. The plus sign means add two values - there's no point telling the computer about it until it has found both the numbers. ZX BASIC actually performs calculations in the second sequence (which is called Reverse polish Notation), but it has to re-order them from the first sequence every time it finds them, and that is a slow process.

WHAT'S A COMPILER

The Spectrum BASIC compilers are programs which read a BASIC program and produce a machine code equivalent, The compiler and both programs have to be in memory all at once, which limits the size of compiled programs to 10-20K.

Compiled code may be anything from 2 to 200 times faster than the original, depending upon the compiler you are using and the intricacy of the original program. We ran (or at least, tried to run!) the standard BASIC benchmark programs on each of the compilers. The results are shown in the Timing Table, along with the published timings for ZX BASIC.

The timings are not as fast as for pure machine code, which allows much more freedom to the programmer, but they are easily fast enough for most games programming. A number of commercial games are written in compiled BASIC (including Frank 'N' Stein, published by PSS) and look none the worse for it, although you'd be hard-put to write Knight Lore with a compiler.

A few of the positions in the table contain asterisks, because the test program could not be processed by that compiler. In order to keep compiled programs fast, and reduce the complexity of the compiler, the packages all impose restrictions on what they can compile.

COMPILER CONSTRAINTS

Softek's FP compiler is the only one that can cope with decimal values, for instance - this makes it much slower than the others, but means that it is the only compiler suitable for use in business programming. But who wants to run as business on a Spectrum anyway? The other compilers restrict you to whole numbers between -32767 and 32767, although you can use values up to 65535 in POKEs and suchlike.

You can switch back and forth from normal BASIC, machine code and compiled code with USR calls and RETURN instructions, so it is possible to write programs in a mixture of languages if you need speed at one point and sophistication elsewhere.

The Softek compilers (FP and IS)are the only ones which allow you to use full BASIC string-handling; Mcoder gives you a fairly complete set of facilities to work with short strings (up to 255 characters) but Zip and the Mehmood compiler can only offer simple routines to read and write characters. You could probably write a text adventure using Mcoder or one of the Softek compilers, but you'd be much better off using The Quill.

Array handling is similarly limited - none of the compilers allow arrays of more than one dimension,and the IS and Mehmood programs won't allow arrays at all, you can use long variable names with Mcoder and the Softek compilers, but the cheaper packages restrict you to 52 short variable names.

The 'core' of ZX BASIC commands - PRINT, INPUT, PLOT, DRAW, LET, GO SUB, IF, and so on - are allowed by all the compilers. The Mehmood compiler doesn't allow FOR loops, which meant that we couldn't run some of the benchmark programs.

One of the snags of real machine code is the fact that you can't 'break in' to programs. This suits software houses, who want to discourage piracy, but it is very inconvenient for programmers. The only way you can stop a machine code program is to pull out the plug and re-load it. Zip and Mcoder allow you to break into compiled programs at will, but the Softek compilers require a special command wherever you might wish to break into compiled programs, You can't break into programs produced by the Mehmood complier at all.

The Softek compilers allow you to put special instructions in REM statements. These instructions only work once a program has been compiled, which is inconvenient since you can't test such programs fully in normal BASIC - one of the big advantages of BASIC compilers over machine code is the fact that you can test your programs interactively, with all the BASIC checks and hand-holding to help you, before you compile them.

Softek's special instructions allow you to check for the Break key, enter machine code into the program, and move simple (character-sized) sprites smoothly around the screen. On the FP compiler you can also trap errors and simulate the ON GO TO statement. None of the compilers let you GO TO a calculated line number - you must always GO TO a specific number.

Mcoder offers some REM instructions, but these are designed for program testing. You can turn off BREAK checks, giving marginally faster code, or turn on a 'trace' facility which shows the current line as it is executed. Mcoder and Zip allow you to pass variable values back and forth between BASIC and machine code.

THE COMPILERS COMPARED

So far we've taken a broad overview, looking at the compilers together. In the following section we look closely at each of the five Spectrum compilers (there were six, but the first Spectrum BASIC compiler, SUPER C is no longer available).

None of these compilers really offer 'instant translation' for your BASIC. With the possible exception of Softek's FP you really have to write your program with compilation in mind - it is hard work to convert existing BASIC to suit any of the compilers. Also, there are some things which are hard to do without the flexibility of real machine code. That said, the packages all produce working code pretty effortlessly, and you can be reasonably confident that compiled programs will work first time - unlike hand-coded ones!

Next month, PR companies willing, we should be able to report on two new compilers - Colt, from HiSoft, which is a development of Mcoder, and Oxford Computer Systems' Blast, which promises to compile absolutely any ZX BASIC program, without alteration. At the moment we're having a bit of trouble wheedling copies out of the manufacturers - they both seem to be holding back until they've had a chance to dismantle their competitor's product! We'll compile more information next Niche....

MCODER
£8.95
PSS, 452 Stoney Stanton Road, Coventry

Mcoder has the longest history of all the Spectrum compilers. It began life in the July 1983 issue of Your Computer magazine; in those days it was a 2K program for the ZX81 called ZX-GT. Like the Softek compilers, Mcoder now occupies about 6K.

The Mcoder documentation is unimpressive: seven cassette-sized pages, in the form of a brief question and answer session and a list of commands allowed by the compiler. PSS offer a three page 'help sheet' to users who miss the significance of some of the comments in the cassette insert. The code produced is faster than that from the IS compiler, especially when it comes to string handling.

Mcoder looks very much like the Softek compilers (or should that be the other way around?) and performs in a similar way, with the same fast compilation and simple error indication. Mcoder and IS are very similar - Mcoder handles numeric arrays and has better debugging facilities, while IS is slightly more compatible with normal BASIC and offers simple sprites.


Blurb: BENCHMARK TESTS _ COMPARING THE COMPILERS Eight standard BenchMark programs were used in the comparison; timings for the execution of each benchmark program are given in seconds, with the speedup ratios achieved by each of the compilers printed on a grey background. ZX BASIC BM1: 4.9 BM2: 9.0 BM3: 21.9 BM4: 20.7 BM5: 25.2 BM6: 62.8 BM7: 90.0 BM8: 25.0 MEHMOOD BM1: * (0x) BM2: 0.065 (138x) BM3: 9.0 (2.4x) BM4: 4.2 (4.9x) BM5: 4.2 (6.0x) BM6: * (0x) BM7: * (0x) BM8: * (0x) SOFTEK FP BM1: 1.75 (2.8x) BM2: 2.1 (4.3x) BM3: 8.7 (2.5x) BM4: 9.4 (2.2x) BM5: 9.4 (2.7x) BM6: 19.7 (3.2x) BM7: 24.0 (3.8x) BM8: 22.5 (1.1x) SOFTEK IS BM1: 0.058 (84x) BM2: 0.076 (118x) BM3: 0.57 (38x) BM4: 0.98 (21x) BM5: 0.99 (25x) BM6: 1.32 (48x) BM7: * (0x) BM8: * (0x) MCODER2 BM1: 0.043 (113x) BM2: 0.097 (93x) BM3: 0.62 (35x) BM4: 0.90 (23x) BM5: 0.92 (27x) BM6: 1.17 (54x) BM7: 1.47 (61x) BM8: * (0x) ZIP 1.5 BM1: 0.031 (158x) BM2: 0.064 (141x) BM3: 0.194 (113x) BM4: 0.108 (192x) BM5: 0.115 (219x) BM6: 0.29 (235x) BM7: 0.46 (191x) BM8: * (0x)

Transcript by Chris Bourne

Sinclair User Issue 20, Nov 1983   page(s) 48,49

MAKING GOLDEN LISTINGS FROM THE LEADEN BASIC

Speed and smoothness of action is what everyone attempts to achieve in programs. John Gilbert reports on compilers.

It is the dream of a Basic programmer to have a slow-running, jerky, Basic program turned instantly into machine code. That is possible using a compiler which will take a Basic listing and translate it into a form of machine code. The benefits are that the program instructions are less open to prying eyes and piracy. It also means that the programs will run faster.

Anyone who has some idea of how Sinclair machines work will appreciate that neither the ZX-81 nor Spectrum can read Basic code directly. They have to use a program called an interpreter which is stored in the ROM. That program translates Basic into a code which the machine will understand.

When you write a machine code program the need for the interpreter is removed. The interpretation of Basic takes up a good deal of time, so when no interpretation is needed the program will run faster. A compiler generates code which dispenses with the need for the interpreter.

Unfortunately none of the compilers on the market will translate all Basic instructions into machine code. The usual level of translation ranges from 90 percent to 95 percent.

Softek was the first company to produce a compiler and that was for the 48K Spectrum. Its main claim to fame was that you could speed graphics displays in programs. That it did very well and in so doing provided a facility which had not been seen on the Spectrum.

Like other companies which produce compilers, Softek upgraded its design of the compiler whenever it could. The company is in the process of launching two new compilers, one of which operates using integer Basic; the other is a great step forward in Sinclair computer compiler design, using floating point numeric representation.

An integer compiler allows the use of numbers only in the format 3, 56, 9. They will now allow you to use decimal points with numbers in a program. In some cases that proves to be a problem. For instance, you may want to perform some mathematical operations, such as division, which will leave you with a decimal number. The restriction in the compiler means that you will have to use INT to make sure that the computer can handle the numeric representation.

A floating-point compiler is a great step forward as it will allow you to use decimal notation when performing mathematical operations.

That will allow the programmer to use most of the commands in Sinclair Basic. Softek claims that it will compile up to 99 percent of Basic which, compared to other compilers, is very good. Unfortunately the floating point compiler is slower than the new Softek integer compiler. The difference in speed is not too noticeable but it is best to use the new integer compiler for graphics in games and the floating point compiler for the accuracy in calculations is needed by scientists and teachers. With the two products Softek has taken control of the market.

The second company to put a compiler on the market was PSS. It was called MCODER, of which versions for both the ZX-81 and Spectrum were developed. MCODER has since been upgraded and MCODER II is available. Both versions of the compiler are similar.

The MCODER is fairly representative of what is on the market and it is worth looking at the type of commands it will allow the Basic programmer to use. Unlike the early compilers, it can use numeric and string variables as well as arrays.

The restriction to their use, of course, is that only integer numbers can be stored in them. Another restriction, which is not too great for most applications, is that the range of numbers which it can use if from -32768 to +32767. Again that is as a result of the way in which the machine stores numbers.

Arrays have to be one-dimensional and you cannot use string arrays with the MCODER. That is unfortunate but you can circumvent it by using ordinary string variables.

The input instructions include both INKEY$ and The usual INPUT statements. For input in a program the READ, DATA and RESTORE instructions are available. The compiler will handle characters only within strings which have a code less than 32 and more than 164. That means you cannot put Basic keywords into strings.

By allowing the range of codes indicated, the compiler can handle user-defined graphics, with codes ranging from 144 to 164. You can define your shapes in the usual way, using decimal notation with USR or the BIN numbers.

Other display statements include DRAW and CIRCLE, with PLOT and OVER also included in the catalogue of legal Basic statements. PRINT and PRINT AT are also available, although AT is not included in the documentation. The TAB function is not available but can be replaced easily with PRINT AT.

Several program flow statements are also included in the compiler. They include GOTO and GOSUB. The IF... THEN statement can also be obtained.

The FOR... NEXT loop structure can be used in the same way as in Basic but one restriction on it is that you cannot use a loop number which is greater than 32767. That also applies to other instructions in the compiler subset, including IF... THEN and RND.

Even with all those restrictions you can overcome the problems and write almost any Basic application program.

All the compilers on the market stress ease of use and that is true. For instance, there are three ways of operating the MCODER. The first is to load the compiler and enter your program by hand. After it is finished you can run the Basic to see if everything is working and there are no bugs. After that a quick machine code call will compile the Basic, which can then be run by a RAND USR 40000. The code can be moved round in memory if necessary but 40000 is the default location for the start of your routine.

You can load a Basic program from tape if you have one already developed and do not want to re-type it. To do so you must LOAD the Basic in the normal way after loading the compiler.

The third type of compilation allows you to translate two Basic programs into machine code in the same session. To do so, you will have to move RAMTOP and stack one program on top of the other. The two programs can then be called by separate USR instructions.

When you have told the computer to compile, one of two things can happen. You can either get an error code or you will get the OK signal.

If an error has been detected in your program, the MCODER will return your program listing with an 'S' beside the line which could not compile. It will then allow you to change that line and re-compile the code.

If you have had no difficulty you can invoke your program using USR to see that it runs faster than in Basic. You can then SAVE it to tape by following the easy-to-read but not over-long instructions.

The effect of the compiler on the code is more marked in some instructions than others. The CIRCLE and DRAW commands are not much faster than in Basic, although if you draw sufficient circles you should see the speed compared to Basic.

The real effects of the compiled code will be noticed when you use FOR... NEXT loops and the other structural statements which affect the flow of a program. The speed in some cases is unbelievable when you think that the code used to be in Basic.

A compiler is a boon to anyone who can write Basic well but cannot master machine code. Unfortunately, the compilers in the Sinclair market and elsewhere incorporate some of the manufacturers' code into the code of a program when it is compiled.

That means that some of the manufacturer's program would be in your program and as a result you could no make a profit from your program without giving credit, and perhaps a royalty, to the software house which created the compiler.

Companies which produce compilers for more expensive computers, such as the Apple II, charge a hiring or rental fee for those utilities. In that way they receive money for any program which contains some of their compiler routines.

Unfortunately things are not so simple in the Sinclair market. It would be uneconomical to charge for compilers in that way, since mass production would mean keeping track of thousands of programs.

The initial stand was to insist that it would market programs which it thought were good and where the compiler was used. In no other cases could companies use the compiler without consultations.

At the time that was a difficult but necessary move, as there was, and still is, no clarification of the law of copyright regarding software. Softek has since softened its objections to the use of its compiler for profit and asks that companies which produce games using it credit Softek on the program and cassette insert.

Compilers are useful instruments both to individuals and to software companies but the legal difficulties about their use still exists. Compilers become more complex and, as a result, companies which produce them will want to protect their interests from the usual type of piracy and the use of a compiler without consulting manufacturers.

It will need a change in the law to clarify the position but until then compilers will be of most use to individuals who do not want to take the step of learning to program in machine code. It is an unfortunate restriction of use which will need to be investigated in the near future.

Compilers are useful to the individual. Although they do not provide a complete translation from Basic to machine code they will still help anyone who does not want an assembler or to learn assembly code.

It may also provide an incentive to learn machine code programming techniques because of the speed at which it will make a former Basic program work. In the next few months we could see a 100 percent Basic compiler but until then we will have to work with what we have.

Softek. 12-13 Henrietta Street, London WC2

PSS. 452 Stoney Stanton Road. Coventry CV6 5DG.


REVIEW BY: John Gilbert

Blurb: 'A boon to anyone who can write Basic well but cannot master machine code.'

Blurb: 'Companies which produce compilers for more expensive computers charge a hiring fee for those utilities, but that would be uneconomical in the Sinclair market.'

Transcript by Chris Bourne

ZX Computing Issue 12, Apr 1984   page(s) 51

Wouldn't it be lovely to write a program in "slowly but surely" Sinclair BASIC and, at the touch of a button, convert it into machine code to run at between 20 and 100 times the original speed? Well, that's what Softek and PSS claim in their adverts for these two compilers. But do they work?

Both compilers cost £9.95 but each has its own characteristics and idiosyncrasies. There are some things, however, that both compilers have in common. Both work with integer numbers only and can handle numbers from -32768 to 32767, while Super C also handles numbers from 0 to 65536 on a simulated INPUT.

Most BASIC commands can be compiled, with a few exceptions. Neither complier can handle LOAD, SAVE, VERIFY or string arrays. However, MCoder 2 can handle strings (but not string splicing), where Super C can't. This is the big difference between the two utilities. The Super C manual does tell you how this can be done but it is fiddly, involving PEEK and POKE.

MCoder 2 can also handle numeric arrays (one dimensional), LEN, LPRINT and INPUT. Super C cannot cope with these but instead, can use STEP in FOR-NEXT loops and SCREEN$ (with code), where MCoder 2 can't.

RND is special on each compiler, giving an integer number between 0 and 32767. This is fiddly to work into a BASIC program but, on MCoder 2, you can simulate this function with:

LET R = USR 59997

This is useful when testing your BASIC program before compilation.

REM, on both compilers, is put to very good use. On Super C, you can use REM to enable the BREAK key to run machine code (which follows the REM in the line, in decimal), or to erase everything, including the Compiler, without pulling the plug. (Both compilers can survive NEW).

On MCoder 2, REM #n, gives a choice of the mode in which the compiled program will run:

Mode 0 - Gives the fastest code disabling the BREAK key.

Mode 1 - Gives longer and slower code by enabling the BREAK key.

Mode 2 - Gives code that runs at almost the same speed as BASIC, with TRACE on.

By default, Mode 1 is chosen.

Both compilers have good error messages, if a bit concise at times. Only MCoder 2 gives you the number of bytes which your code takes up, after compilation. It seems that the only way to save a compiled program is to save the whole of memory, machine code, compiler, work space, the lot. However, this is not difficult, and, with a microdrive, hardly time consuming.

One important point to note is that Super C allows only A to Z as variable names, giving only 26 available, without POKEing into memory. MCoder 2 on the other hand, happily accepts, 'LIVES' 'HS' and 'SCORE' without question. Both compilers are called with simple RAND USR commands.

Finally, to documentation, MCoder 2 was supplied by return of post in a cassette case with an inlay-card size, eight sides of "manual". This, however, tells you enough to make full use of the compiler, including a full description of all the commands available.

Super C took more than three weeks to arrive, and was sent in a large package, about the size of a video cassette box. Super C's manual can only be described as a work of art. Written by Tim Langdell, it gives a superb description of everything about the compiler including the commands, the error reports and just about everything else, finishing off with a plug for the rest of their programs.

If I had to choose between these two very powerful packages, I would prefer to use MCoder 2 from PSS, mainly because it can handle strings and can use more than 26 variables. It is also a little easier to use. However, since about June, Softek have been promising an enhancement package for Super C allowing for string arrays, string splicing and floating point. This will probably push up the price to around £15.00. Whether this will ever become available, we shall have to wait and see. At the moment, MCoder 2 still represents the best value for money.


REVIEW BY: David Harrison

Transcript by Chris Bourne

Crash Issue 5, Jun 1984   page(s) 107,108

M-CODER II BY PSS

This is an integer compiler for the 48K Spectrum only. The program is supplied in a standard cassette tape box (i.e. not one of those overgrown video cassette ones) with an eight-page fold-out instruction leaflet, which is brief but to the point.

Loading the program is simplicity itself - just type LOAD "". There is a BASIC loader which tells you that the compiler is invoked by the RAND USR 60000 command, and that your BASIC is compiled to locations 40000 upwards. This is the default address, however, and may be changed using CLEAR n where n is the address at which your BASIC is compiled. This facilitates slacking of programs in memory, but more of this later.

MCODER must always be present in memory before any BASIC is entered. This is because the loader program does a NEW when you press any key after MCODER is fully loaded. BASIC programs can then be typed in as usual, or loaded from tape. Once your BASIC program is entered and checked you compile it simply by typing RAND USR 60000. If MCODER comes across an invalid line it will return to BASIC with a flashing question mark near the offending command. If this should happen. CAPS SHIFT and 1 (EDIT) will bring down the offending line for correction.

Some typical errors include:

1. Using illegal variable names;
2. GOTO 'variable' or GOSUB 'variable', which are not allowed;
3. Illegal statement type such as LOAD or SCREENS.

Actually most BASIC programs as printed in magazines and so on will not compile in their original form, and will have to be modified taking into account the list of allowed commands. As it says in the instructions, 'You should be aware that you will probably have to make considerable alterations to your program before it will successfully compile as it is likely that the BASIC was not written to suit MCODER. However most programs can be made to work, albeit in a modified form. Errors are reported using standard Sinclair error codes as listed in the Spectrum manual, appendix B.

At the end of a successful compilation three pieces of information are shown.

1. A 'compilation OK' report;
2. The length of the compiled code;
3. The run address.

If all is well, and your compiled BASIC is stored safely above RAMTOP, it can be run using RAND USR 'address', where 'address' is given in 3. above.

As was stated earlier, it is possible to stack several programs on top of each other. This is achieved by moving RAMTOP around in memory. The procedure is to initially set RAMTOP to a fairly high place in memory and compile program A at this address. Then RAMTOP is moved down in memory to allow enough room for program B to be compiled underneath program A. This process is repeated for programs C, D, E, etc. Care must be taken not to overwrite any existing programs as no check is made by MCODER. These programs can then be treated as subroutines and called as required.

As MCODER is an integer compiler, it will only operate on whole numbers, and these must be in the range -32768 to +32767. As it has no time consuming floating point calculations to do there is a considerable increase in execution speed in compiled programs. However, as stated before, it will not compile all BASIC, and continual reference to the instruction leaflet is necessary to check which commands are allowed.

Variable names may consist of upper and lower case letters, and numbers. Multidimensional arrays and string arrays are not allowed. Strings have a default length of 32 characters but this may be altered with a poke.

By using special REM statements the BREAK key can be:

0 Disabled except at 'scroll' andINPUT - this gives the most efficient code (i.e. fastest);
1. Enabled - this gives less efficient code than 0;) but allows the program to be broken into for debugging, etc;
2. Enabled and with current line of execution displayed at the top right hand corner - this runs at about normal BASIC speed, but is very useful for debugging purposes.

Option 1. is chosen by default, but this can be changed as often as you like in programs by including a REM statement - REM # 0, REM # 1, or REM # 2 - corresponding to the options above.

The compiled code may be saved from BASIC (SAVE is not compiled) using the usual SAVE 'name' CODE n. However, as MCODER contains certain runtime routines, it must be saved along with the compiled code.

APPLICATIONS

Compiled BASIC is generally more efficient than interpreted basic, which means that it runs faster and is more compact. This is advantageous for games writing as games will run much faster. As this is a mainly games orientated magazine some thought will be given to this.

In general, arcade games written in BASIC are slow and jerky - slow because of inherent qualities of the interpreter, and jerky because of the whole character block steps used for movement. Using a compiler such as MCODER can more or less solve the problem of speed. However, the jerkiness is still there. The result is games, which instead of being slow and jerky, are now fast and jerky. The speed partly compensates for this, but the results are never particularly realistic and in no way are they comparable to most commercially available games. Some people will accept this but many, I feel, will be disappointed.

CONCLUSIONS

MCODER II is easy to use, and if you can overcome the omission of some commands it could be quite useful. The speed improvement is significant, but the program is not really intended for beginners. Using a compiler is supposed to be an alternative to using machine code, but in reality some knowledge of machine code is needed to fully understand its operation.

At £9.95 I cannot help feeling that it is overpriced, as the SOFTEK IS compiler is the same price, and this offers far superior (in theory) facilities. However, there seemed to be some anomalies in the operation of the SOFTEK compiler, whereas the MCODER worked without fault, so this can only be in MCODER's favour.


REVIEW BY: Steven Wetherill

Transcript by Chris Bourne

All information in this page is provided by ZXSR instead of ZXDB