Date : Mon, 07 Sep 1992 10:42:52 BST
From : matthew@... (Matthew Sweet)
Subject: A group project...
Hi,
A lot of people complained that there wasn't a decent
'C' compiler for the BBC when this list was set up.
How would people like to remedy this situation?
My suggestion is that the group get together and write
a multi-pass C compiler for the 6502 that is capable
of running on a BBC B.
The aim would be to make the system modular, so that
the front-end could be re-used for other CPUs
(Z80, 32016, etc), but only a 6502 back end would be
written.
As I see it, on a limited memory machine like a BBC,
a the compiler should use disk as its workspace.
A C file on disk should be run through each stage,
producing another disk file.
The following need to be done:
All interested need to express this interest!
A discussion of minimum H/W required should be held.
While the final product may execute on a standard BBC B,
is it acceptable if it can only compile itself on a
BBC B with a second 6502?
The development tools to be used should be discussed.
A final aim would be to have the C compiler in C, however
this needs you to be able to compile C to start with...
Do we use tcc as an initial development tool, writing
C code that will compile on tcc? Do we write full C and
get one of the group to initially compile it using
BEEBUG C (a full implementation of C that compiles
to code for a virtual machine that is then emulated
by the BBC) and then itself?
What S/W architecture do we use in the final objects?
- the stack supplied is probably too small for C.
- do we place an arithmetic stack between &400 and &800?
- how do we use zero page (my suggestion is as "registers")
- what calling convention should we use?
- Which functions can be placed in a ROM for non-standalone use
in standard BBCs? - Arithmetic primitives are an obvious choice.
At least an assembler and a linker need to be produced,
(65as and 65ld)? These would then be used as final stages
of translating 'C' to 6502 assembler. Possibly the tcc
utilities could be used/extended.
Matthew