Speed Comparison Between 2068 Pascal and Compiled BASIC (TIMEMACHINE)

Author(s): Larry Kenny
Publication: Update Magazine
Pub Details: Update January 1990
Date: January 1990
Pages: 19

Recently i have been working on using my 2068 to control a 3 axis drilling/ routing machine using stepper motors. To make the machine move in arcs and circles i needed to use the sine and cosine functions in the 2068 rom. After trying some basic and machine language (using the fp interpreter) routines i found that the program couldnt run nearly fast enough to keep the machine busy at full speed.

I asked David Solly who is a long time Hi-Soft Pascal user to write me a test program using its sine/ cosine functions so i could test it against 2068 Basic and compiled basic (Time Machine compiler from Novel Soft).

The test program plots around a circle 100 times. Here are the results.

2068 basic interpreted          ......   150 seconds
Compiled Basic (Time Machine)   ......   126 seconds
HI-SOFT PASCAL                  ......    18 seconds

Wow ! The pascal really flies even when doing floating point math. It has all its own math routines built in and doesnt do any rom calls. That also means that the compiled code can be burnt into an eprom and run on a Z80 based cpu without the timex rom resident.

The compiled Basic is only slightly fa ster that regular basic when the floating point routines are used. Even calling the 2068 FP routines from machine code doesnt make much difference.

If you are writing a program that does a lot of calculations such as a spread sheet, 3d graphics, or Cad etc, pascal will far outperform Basic.

Anyone interested in 2068 pascal can leave a message on the Ottawa TS BBS at (613) 745-8838 . If you have a LKDOS disk system i have converted pascals internal file routines for disk instead of tape . There are also numerous pascal source files on the BBS. The BBS runs 24 hours a day on a 2068 using Larken Maxcom.

2068 BASIC Circle Listing

 5 REM ! OPEN #     (Needed for Time-Machine only)
10 LET RAD = 50
20 FOR A=0 TO 628 STEP .5
30 PLOT 80 + RAD * SIN A , 80 + RAD * COS A
40 NEXT A
50 PRINT "END OF PROGRAM "

HISOFT Pascal circle listing

5  PROGRAM CIRCLE;

10 PROCEDURE CIRC;
11 CONST RAD =50;
12 VAR
13 A : REAL; ON : BOOLEAN;

14 BEGIN
15 A := 0; ON := TRUE;
16 REPEAT
17 PLOT (80 + RAD * SIN(A) ,
18 (80 + RAD * COS(A));
19 A := A + 0.5;
20 UNTIL A > 628;
21 END;

22 BEGIN {MAIN PROGRAM}
23 CIRC;
24 WRITELN ('END OF PROGRAM');
25 END.

PASCAL for the TS-2068 and Sinclair QL

This little note from the Editor is to provolk thought. Quite some time ago David Solly, of the Ottawa Group, sent in a masterful large article about PASCAL. I was afraid to publish it because “I couldn’t cope” with its advanced programming. Now we have in a following article a short and sweet program (done by David for Larry Kenny). This article may whet the appetite of many for PASCAL TUTORIALS. The article also ties in well with the next subject.

I believe that we should start at the foundation level with PASCAL. It is a very powerful language that we should learn. To David and other PASCAL programmers: Lets go with some beginner tutorials and lead into the power and speed of PASCAL. Most colleges teach Pascal but few have the time and opportunity to enroll.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.