[Coco] [Color Computer] Multiple C compiler projects

Gene Heskett gene.heskett at verizon.net
Mon Jul 18 00:09:34 EDT 2005


On Sunday 17 July 2005 22:05, James Jones wrote:
>John R. Hogerhuis wrote:
>> I think it would make sense to focus effort on one compiler. It
>> seemed like we had concensus to focus on the sdcc port, abandoning
>> the old gcc 6809 port as it needed too much work and GCC is
>> targeted at beefier CPUs.
>>
>> Within the last week it seems we have two new initiatives (Boisy
>> got C code for a 6809 C compiler, but I don't understand the
>> license terms at all) and now a GCC 4.0 port.
>>
>> Of course whatever would get us a C compiler first is where we
>> should focus. But before you get too far with GCC 4.0 you should
>> take a look at sdcc.
>
>I'd say that it would be nice to still have a compiler that could
>actually run on the CoCo itself (or an emulated CoCo). GCC 4.0 is a
> fine thing--especially since they've moved to SSA (static single
> assignment) form internally--but I seriously doubt that it will be
> possible to make it run on a 6809.
>
>People working on compilers targeting OS-9/6809 (or NitrOS9) might
> want to keep in mind taking full advantage of C type qualifiers.
> Currently,
>
>int a[] = {1, 2, 3, 4, 5};
>
>in a way has to appear twice in the address space of the process
> running the program it appears in: once in the process's data area
> , and once in code as the initialized data that is copied to the
> array in the data area. (It also chews up time for the copying.)
>
>OTOH, a compiler can realize that
>
>const int a[] = {1, 2, 3, 4, 5};
>
>can be placed in the code area and accessed with a PC-relative
>reference. It's only there once, and is initialized when the module
> is loaded rather than when the process is spawned or as part of
> cstart.
>
>WARNING! Because of the way OS-9 works, you CANNOT do this with
>pointers, and hence by induction any data that (transitive closure
> of contain)s a pointer. Initialized data that contains pointers has
> to be adjusted either by where the module is, if it points at
> something in the module, or by where the process's data area
> starts, if it points at something in the process's data. You can't
> do that to data in the program module itself.

> James Jones

James, that doesn't coincide with my experience.  I have often made 
reference to a constant contained in an fdb in the program module 
itself by simply accessing it ,pcr style.

Are you forgetting that one of the more important advantages of the 
6x09 family is its ability to use program counter independent code, 
code that will run at any loading address in the machines 64k map?

By the same token, pointers can be fcb'd at build time, and used to 
form an address into a table of subroutines from those fdb'd 
pointers.  Adding gettst's and settst's to the system is done very 
much like that.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.35% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.



More information about the Coco mailing list