[Coco] [Color Computer] Re: OS-9 C and Pascal compiler output

James Diffendaffer jdiffendaffer at yahoo.com
Thu Feb 22 13:39:25 EST 2007


>As I recollect, I found OS-9 C _impossible_ to figure out until I
>learned C with Borland's Turbo C. Pascal was even worse! I _think_ I
>used C to write a few filters, but most of my work was done in BASIC-09
>because it had a Debug environment built in.

Lot's of people I know learned on Turbo C but most compilers actually
work more like the OS-9 one.

>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.

>The
>.compiler would need to put out a format that the assembler would find
>acceptable. Of course, if you are writing your own assembler, then you
>determine what that format is. Personally, I'd just format it for the
>RMA assembler; or to be really nice, have the RMA assembler the 
>default, with a command line switch to output in the Level-1 
>assembler's format.

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.

I wanted to be able to compile a large program under the OS-9 compiler
and then have it recompile under mine with minimal changes.  Since the
OS-9 compiler is old and probably a subset of C I'm not sure of what
to expect.


>Best wishes in your attempt,
>--Rich 

Thanks





More information about the Coco mailing list