Over the years there have been a number of attempts to port gcc to the 6809. None of these have ever ended up as part of the standard gcc distribution. What is offered here is the best version that I am aware of.

This distribution is based on the work of James Dessart, whose gcc for 6809 page was the basis for this version. You should visit James' page for some background on the history of this port. You do not need any of the files from his site in order to build gcc proper. You will, however, need the assembler and linker that are there, in order to make final executables.

Again, the gcc here will only translate C source code into 6809 assembler files. You still need an assembler and linker, and possibly libraries, to complete your application. At present the only supported assembler is the asxxxx tools from Alan Baldwin. At least version 1.5.2 should be used; I'm currently doing most of my testing with version 4.1.0.

As of the latest development tree, gcc versions 3.4.4 through 3.4.6 work correctly. gcc 4.x compiles but frequently aborts. gcc 3.3.6 used to work OK but isn't supported anymore.

This is an active project; if you want to contribute, have any questions, or want to report any bugs with this software, contact me at brian@oddchange.com.

Source Code Packages

Packages are not being provided for future versions of gcc6809, due to lack of interest. See information below on how to access the online source repository; this is open to everyone.

Download the gcc6809 Release 1.2 source code if you want to build the compiler yourself. You'll need a native version of gcc on your host system.

This tarball consists of the 6809 machine definition and some replacements for some core gcc files. Once you've downloaded it, expand it using tar and bunzip.

In order to build, you'll also need an official gcc tarball for the version you want to build. You can get this from any GNU mirror. For example, for gcc6809 3.4.5, download gcc-3.4.5.tar.bz2. Place this file into the releases directory that was created when you expanded the 6809 tarball.

Finally, to build the compiler, just type make everything, and hopefully it will work for you. Read the Makefile for a list of other ways you can kick off the build, and for more information on what to do next.

If you use Cygwin, beware that building the compiler is slow.

Note, you do not need the patchfiles on James' web site, as they have been incorporated into the 6809 tarball for one-stop downloading.

Online Source Code Access

The source code is managed in a Subversion repository at the following location:

http://www.oddchange.com/svn/public/gcc6809

Anonymous read-only access to the repository is allowed to all. You will need a Subversion client in order to checkout the files; or you can use WebSVN to browse the repository and/or download tarballs.

The latest stable release of the code is located in the tags/2006-06-09 directory. The absolute latest changes can always be found by going into the trunk directory.

Philosophical Differences

I've made a number of changes which relate specifically to the pilot project on which I am using this compiler. I believe that these are worthy changes that apply elsewhere, too, but users of previous versions of gcc6809 may not agree.

By default, int is an 8-bit quantity, not a 16-bit one. Even though gcc can do some 16-bit math using the index registers, fundamentally I believe the machine to be 8-bit and believe that the programmer should explicit ask for 16-bit quantities when needed. In many cases, this is sufficient, and leads to better register usage.

I've made little attempts to keep compatibility with James' original version, as I've gotten no interest from anyone using that version to migrate to the new one. I'm willing to work with other parties to help keep compatibility for existing projects.

Release Notes

Release 1.3 (Coming Soon -- these changes are only in SVN)

Release 1.2

Release 1.1

Future Enhancements

More changes are in the pipeline: