BASIC compiler?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

BASIC compiler?

Post by Symoon »

Hi,

I just gave a quick try at Ray McLaughlin's basic compiler on the Oric, with a small program drawing HIRES things.
It must have been an amazing amount of work to achieve this!

Anyway, here are the results:
- initial BASIC program, 87 bytes in memory, 8 seconds to draw
- resulting ASM program: 1.9KB big, 3 seconds to draw

So if memory is not important, the speed gain is quite cool (I was using SIN command, which could explain the size?).

But the result only works under Sedoric which is not very satisfying for my needs.

So I got a simple question: has there ever been a project of "Basic cross-compiler" for Oric on modern computers?
JamesD
Flight Lieutenant
Posts: 358
Joined: Tue Nov 07, 2006 7:38 am

Re: BASIC compiler?

Post by JamesD »

The BASIC program is smaller because it's tokenized and most of the code is in the interpreter.
The compiler has to generate assembly to replace a lot of what the interpreter does, so the code has to be larger.
As for SIN, the compiler probably uses BASIC's floating point library, so that part isn't going to be any faster.
There is a BASIC compiler for the MC-10 that uses it's own fixed point math, which really speeds things up, but decimal math will be less accurate.
Post Reply