[Coco] [Color Computer] GCC 4.0 6809

James Diffendaffer jdiffendaffer at yahoo.com
Wed Jul 20 17:46:28 EDT 2005


After discovering that the 68HC11 uses an almost identical memory
model as the 6809 I started looking at GCC again.  

As soon as I get all the Cygwin updates required to build GCC (I'm
temporarily on dialup and it's been downloading for over 12 hours)
I'll be ready to do a build and if all goes well start generating some
code.

I've been looking at the code generator and so far it seems to be 6809
compatible.  I'm going to cross reference the HC11 and 09 instruction
sets and search for instructions not on the 6809 before I'm done but
converting it has been WAY easier than SDCC.
I also need to check the stack frame, condition code register bits and
a couple other things but that is minor compared to what SDCC requires.
The HC08 register model is way different than the 09 and I was
rewriting a *lot* of the code generator over.

So why didn't I just do GCC in the first place?  Updating the old 09
GCC to new was a nightmare because the versions are so different but
anyone wanting to make HC11 GCC generate 09 code could make the
changes easily.  Most of the changes I've made are actually just
names, not actual logic changes and you could generate code without
making those mods.  
The HC12 stuff can be yanked out but I'm leaving it in until I get it
working... not going to risk breaking anything yet.

Building a 6803 compiler would involve yanking stuff related to the
2nd index register and changing the stack pointer name.  (I suppose it
could be made into another fake register)  Then look for instructions
that the 6803 doesn't support, check the stack frame and CCR bits.  

The 6309?  That would require knowing more about some of the GCC
structures than I do now.  It is very doable since the additional
registers function like the first set.  More of a copy, paste and
modify operation than starting from scratch.

So, as soon as I get these updates loaded and can build GCC I'll run
some test code through and look at the assembly.  If all goes well
I'll start cleaning up the code and update the comments.
It will still need proper startup code for RS-DOS/OS-9 and a way to
build CoCo binaries so it's far from complete.  And I haven't looked
at the peephole optimizer yet so there may still be pleanty of work.





Brought to you by the 6809, the 6803 and their cousins! 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ColorComputer/

<*> To unsubscribe from this group, send an email to:
    ColorComputer-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the Coco mailing list