Login
Back to forumSee the full topicGo to last reply

Posted By

MMS
on 2014-07-27
12:09:53
 Re: PLUS-Comp Found!

Second part:

The compiler offers 4 different modes
1) Compile one program on Drive 8
2) Compile a pack of programs from Drive 8 to Drive 9 in the order of Drive 8 directory
3) Automatic compiling of a program pack. It is the same as the Mode2 with the difference, that
only the first program gets the machine code runtime routine pack, the rest of the programs
will be loaded over this first one
4) Automatic compiling with overlay technic. It is the same as Mode3 with the difference that
the first program contains the variables of all programs, so the programs will take from each
other the values in variables and dims

The BASIC programs compiles in three steps: A, B, C.
The A step executed only when the overlay technic used.
In step B the program prepares the work files that are linked together in step C.

There is a special case when GRAPHIC command used. The GRAPHIC command moves the BASIC
programs from position $1000 to $4000. Such programs need to be compiled with GRAFIKUS compiling mode. In such cases the the compiled machine code program need to be loaded directly to $4000.
The Compiler "downwards" compatible with the BASIC 3.5, as the compilation method was worked
out based on BASIC2.0. Because of this, there are some commands where we should tell the
Compiler program, that a BASIC3.5 command will come. In most of the cases the detection of
V3.5 commands is automatic, but few commands need to be extended with a compilation
directive.
We can choose from three different directives. (The difference is between the limits of the directives: how long the the special handling mode to be used).
:: = one command
<- = command line (back arrow)

#be = beginning of a program module
#ki = end of a program module

The Compiler can accept the own developped BASIC expensions too, these commands should be handled in the same way as the BASIC3.5 commands.

From 1986 onwards you can buy at Novotrade shops the B-G-S Comp(P) compiler family for
Commodore64. The meaning of the B-G-S:
B = BASIC
G = Supergraphic 64
S = Simons BASIC
It can compile the above BASIC versions on systems with one or two floppy drives. With two
floppy drives (P) can execute all 4 compiling mode even on a Commodore 64 machine too. The
above three compiling directives can be used here too, that may help reducing memory
requirement and improving program speed.

The S-Comp(P) knows more functions than the better known SIMONS-COMP versions.
The P code programs generated with SIMONs-COMP cannot switch back from the graphic mode to normal character screen, it gives an error code "?NEXT WITHOUT FOR ERROR", and stops.
The same failure does not happen with the programs compiled with S-COMP. S-COMP let it using the sprite and DESIGN command too, this is impossible at SIMONS-COMP.

There was a benchmark to compare the normal BASIC with the compiled programs and to find
the fastest compiled P code with a program built up from 9 blocks.

The best average was realized by the PLUS-COMP (+COMP), the end result was way faster than any
C64 compiler.
(see attachement PLUS-COMP result.JPG)



MMS side comments:
-There was no example given how the special directives should be used, so some tests needed here

-It is the proper way use integer variable in FOR-NEXT cycle to speed it up drastically (12x faster than original Plus4 V3.5):

FOR I%=1 to 10000
NEXT

It did not work in Austrospeed compiler when I tested it, but maybe the NEXT command without variable is the key to success?

-In normal mode C64 seems faster than Plus/4, when arithmetics, DIMs, FOR/NEXT used. DIMs seems make situation much worse, the average 10% difference grows to 20%. So compiler really needed to compensate bad lines and ROM/RAM switching happy



Back to top


Copyright © Plus/4 World Team, 2001-2024