[Coco] [Color Computer] Re: OS-9 C and Pascal compiler output
Charles Richmond
cybercunx at tx.rr.com
Thu Feb 22 15:00:55 EST 2007
On Feb 22, 2007, at 12:39 PM, James Diffendaffer wrote:
> [snip...] [snip...] [snip...]
>
> >The C compiler basically ran several programs sequentially: the
> >preprocessor, the compiler, the assembler, and maybe a linker.
>
> That's actually pretty normal except most compilers have the
> preprocessor built in. On small systems this was a way of saving
> memory. I'm pretty sure there were even a few compilers that had the
> compiler split into phase 1 and 2. I think they separated the parser
> from the code generator... though I'm not sure how.
I used a Lattice C compiler on an Atari ST before. Besides doing the
preprocessing, the first pass parsed the code and produced an
"intermediate code". This intermediate code was sort of like the
p-code produced by some Pascal compilers. The second pass generated
the executable code directly from the intermediate code. The first
pass can run on *any* processor because the intermediate code is
*not* processor dependent. Thus to port from x86 to 68000, you
only need to re-write the second pass.
>
> [snip...] [snip...] [snip...]
>
>
> I planned on outputting a standard assembler format, preferably as
> generic as possible and probably as close to the original Motorola
> sample code as possible.
>
> What I really wanted was to look at how it did some things in the code
> it generates. I had a few choices to make on how to generate code and
> some would produce better code but might break compatibility with
> existing linkers.
>
>
There were a couple of free C compilers posted to
<comp.sources.atari.st>
back in the halcyon days of that machine. Also, the BDS C compiler
sources are
available for free at:
http://www.bdsoft.com/resources/bdsc.html
This compiler is for 8080/Z80, but the general organization might be
useful to you.
--
+----------------------------------------------------------------+
| Charles and Francis Richmond richmond at plano dot net |
+----------------------------------------------------------------+
More information about the Coco
mailing list