--- title: "Speed Comparison Between 2068, PASCAL and Compiled BASIC (TIMACHINE)" type: "article" slug: "speed-comparison-between-2068-pascal-and-compiled-basic-timachine" url: "http://localhost/article/speed-comparison-between-2068-pascal-and-compiled-basic-timachine/" markdown_url: "http://localhost/article/speed-comparison-between-2068-pascal-and-compiled-basic-timachine.md" published_at: "2020-10-27T17:16:06+00:00" modified_at: "2026-06-21T23:26:39+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "I have been working on using my Timex/Sinclair 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 Timex/Sinclair 2068 ROM. After trying some BASIC and machine language — using the floating point interpreter -…" category: - name: "ZXir QLive Alive" slug: "zxir-qlive-alive" taxonomy: "category" url: "http://localhost/category/periodicals/zxir-qlive-alive/" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "Pascal (programming language)" slug: "pascal" taxonomy: "post_tag" url: "http://localhost/tag/pascal/" - name: "TIMACHINE" slug: "timachine" taxonomy: "post_tag" url: "http://localhost/tag/timachine/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Larry Kenny" slug: "larry-kenny" taxonomy: "indiv" url: "http://localhost/indiv/larry-kenny/" publication: "ZXir QLive Alive" publication_r: id: 10286 title: "ZXir QLive Alive!" type: "periodical" url: "http://localhost/periodical/zxir-qlive-alive/" authors: "Larry Kenny" volume: "8" issue: "4" issues_articles: - id: 26832 title: "ZXir QLive Alive! v8 n4" type: "issue" url: "http://localhost/issue/zxir-qlive-alive-v8-n4/" pages: "13-14" pubdate: "Winter 1998" related_articles: - id: 39233 title: "TIMACHINE Review" type: "article" url: "http://localhost/article/timachine-review/" - id: 6330 title: "TIMACHINE – A BASIC Compiler" type: "article" url: "http://localhost/article/timachine-a-basic-compiler/" - id: 47055 title: "TIMACHINE: A sort of review" type: "article" url: "http://localhost/article/timachine-a-sort-of-review/" - id: 46781 title: "TIMACHINE and FDD System Compatibility" type: "article" url: "http://localhost/article/timachine-and-fdd-system-compatibility-2/" - id: 46660 title: "TIMACHINE and FDD System Compatibility" type: "article" url: "http://localhost/article/timachine-and-fdd-system-compatibility/" - id: 44939 title: "Patch for *C, *D and *E bugs in Timachine" type: "article" url: "http://localhost/article/patch-for-c-d-and-e-bugs-in-timachine/" - id: 42064 title: "Bob’s Notebook: TIMACHINE" type: "article" url: "http://localhost/article/bobs-notebook-timachine/" - id: 23603 title: "Timachine – A Fix" type: "article" url: "http://localhost/article/timachine-a-fix/" - id: 23604 title: "TS2068 Timachine – A Fix" type: "article" url: "http://localhost/article/ts2068-timachine-a-fix/" - id: 23251 title: "Bob’s Notebook: Printing and TIMACHINE" type: "article" url: "http://localhost/article/bobs-notebook-5/" - id: 22731 title: "TIMACHINE and the FDD System" type: "article" url: "http://localhost/article/timachine-and-the-fdd-system/" - id: 15430 title: "TIMACHINE on AERCO Disk" type: "article" url: "http://localhost/article/timachine-on-aerco-disk/" - id: 21968 title: "Speed Comparison Between 2068 Pascal and Compiled Basic (Timachine)" type: "article" url: "http://localhost/article/speed-comparison-between-2068-pascal-and-compiled-basic-timachine-2/" - id: 43280 title: "*D & *E Compilation Bug" type: "article" url: "http://localhost/article/d-e-compilation-bug/" - id: 23244 title: "A Letter from Cameron Hayne" type: "article" url: "http://localhost/article/a-letter-from-cameron-hayne/" - id: 42115 title: "Bob’s Notebook: Peeking and Poking About" type: "article" url: "http://localhost/article/bobs-notebook-peeking-and-poking-about/" - id: 60061 title: "Comparing ZXbasic and TimeMachine" type: "article" url: "http://localhost/article/comparing-zxbasic-and-timemachine/" - id: 21687 title: "Peeking and Poking About" type: "article" url: "http://localhost/article/peeking-and-poking-about/" - id: 60057 title: "TimeMachine on Zesarux" type: "article" url: "http://localhost/article/timemachine-on-zesarux/" - id: 38500 title: "Sinclair Survival Column" type: "article" url: "http://localhost/article/sinclair-survival-column-5/" - id: 8097 title: "Machine Specifics: Orphans" type: "article" url: "http://localhost/article/machine-specifics-orphans-3/" product_reviews: - id: 26070 title: "TIMACHINE" type: "product" url: "http://localhost/product/timachine/" archive_link: false volumeissue: "v8n4" --- # Speed Comparison Between 2068, PASCAL and Compiled BASIC (TIMACHINE) I have been working on using my Timex/Sinclair 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 Timex/Sinclair 2068 ROM. After trying some BASIC and machine language — using the floating point interpreter – routines, I found that the program couldn’t run nearly fast enough to keep the machine busy at full speed. I asked [David Solly](http://localhost/indiv/david-solly/), who is a long time HiSoft PASCAL user, to write me a test program using its sine/cosine functions so I could test it against Timex/Sinclair 2068 BASIC and compiled BASIC. The test program plots around a circle 100 times. The results: | T/S-2068 BASIC | Compiled BASIC (Timachine) | Hi-Soft PASCAL | | --- | --- | --- | | 150 seconds | 126 seconds | 18 seconds | Wow! The PASCAL really flies even when doing floating point math. It has all its own math routines built in so it doesn’t 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/Sinclair ROM resident. The compiled BASIC is only slightly faster that regular BASIC when the floating point routines are used. Even calling the Timex/Sinclair 2068 floating point routines from machine code doesn’t make much difference. If you are writing a program that does a lot of calculation such as a spread sheet, 3d graphics, or CAD etc., PASCAL will far out perform BASIC. ### Timex/Sinclair 2068 BASIC Circle Listing ``` 5 REM ! OPEN # (Timachine 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 ``` PROGRAM CIRCLE; PROCEDURE PLOT (ON : BOOLEAN; X, Y : INTEGER); BEGIN IF ON THEN WRITE(CHR(21), CHR(0)) ELSE WRITE (CHR(21), CHR(1)); INLINE (#FD, #21, #3A, #5C, #DD, #46, 2, #DD, #4E, 4, #CD, #E5, #22); END; PROCEDURE CIRC; CONST RAD = 50; VAR A : REAL; ON : BOOLEAN; BEGIN A : = 0; ON := TRUE; REPEAT PLOT (ON, ENTIER(80 + RAD * SIN(A)), ENTIER(80 + RAD * COS(A))); A : = A + 0.5; UNTIL A > 628; END; BEGIN (*MAIN PROGRAM*) CIRC; WRITELN ('END OF PROGRAM'); END. ```