UPDATE: The files in this directory have been updated to avoid using wine if possible. Run the gcc6809 shell script and it will install/build whatever is missing. I'll update the README below shortly. I'm moving gcc support to ../max6809 ( https://gtoal.com/src/max6809/ ) which is the development directory for the little '6809 max' board that I'm using C with. ---------------------- The absolute easiest way to run gcc6809 on linux without pulling in an exceptional amount of overhead is to run the cygwin executable under wine. gcc6809.exe and a few helpful files are in this web directory. You'll have to install wine yourself. Once you have it installed, if there are any files or directories missing when you try to run gcc6809, you might get some hints in DOTwine-hints.txt (or just run wine under strace yourself). gcc6809.exe was extracted from a very large IDE (Vide) built specifically for compiling C programs for the "Vectrex" 6809-based vector video game system. Trust me when I say that if you're just running a little homebrew 6809 kit you will not want to start from the Vide installation. (But for completeness, it is to be found at https://github.com/malbanGit/Vide/ and http://vide.malban.de/ You might come back to it much later when your needs exceed that of a simple compilation to an asm file. It's actually a very good IDE (if you like IDEs) but it's large and has a huge learning curve.) Unfortunately this version of gcc6809 does not have the ability to output an interleaved source and assembly file, which is an extremely useful facility to have, especially for programmers who normally write in assembly code. So... I've supplied a program, "stabs", which will manually interleave the source with the generated assembly code. Fortunately we can get the source line numbers corresponding to the generated code by compiling with "-g" and looking at the "stabs" directives this generates for use with run-time diagnostics. (Using "-g" does *not* alter the code that is produced, so it is a safe option to enable for all compilations.) ("stabs" is a hack and has only been tested on one trivial test program. No guarantees if it will hold up under heavy use. And source code size is currently limited to 1024 lines.) This version of gcc generates assembly code as its output; it does not create a .o file. Calling gcc under wine and post-processing the asm output to include the C source as asm comments is done by the "gcc6809" shell script: #!/bin/sh cp $1 testgcc09.c wine gcc6809.exe -o testgcc09.asm -g -O3 -mint16 testgcc09.c # testgcc09.c and testgcc09.asm filenames are hard-wired into stabs.c ! ./stabs > testgcc09.s mv testgcc09.s `basename $1 .c`.asm rm testgcc09.asm testgcc09.c echo Output written to `basename $1 .c`.asm Note that we are using gcc here *only* to translate C into assembly code. The compiler does not supply library routines nor does it handle the initialisation of the main program or give any assistance to program loading. You still have to add these facilities yourself and assemble and link the generated asm file. For most hobbyists with their own 6809 boards, a basic compilation like this is *much* easier to adapt to their needs than starting from the large "Vide" IDE mentioned earlier. Even getting just gcc6809 running native on Linux takes a major effort. The version of gcc we are running is: 4.3.6 (gcc6809) ( from: strings gcc.exe|fgrep "(gcc6809)" ) I threw this system together today to support the "6809 max" kit I've just built. (Info on that at https://gtoal.com/src/max6809/ ) I've started work on a demo program to run on the 6809 - mastermind.c I had half a dozen different 6809 assemblers on my system, and fortunately one of them assembled the output from gcc without problems: xasm. The xasm distribution probably came from http://www.brouhaha.com/~eric/embedded/6809/ and the archive looks like it contains enough to put together a linker and loader. Future plans: 1) add a peephole optimiser. (I have one half-written for another project, shouldn't be a major job to add here) 2) remove the lazy parameter handling. 3) add support for the builtin calls (eg multiply, divide and remainder) Note that I've started putting some relevant files into this directory (e.g. libgcc1.s) but haven't used them yet. All you need to download are: gcc6809 gcc6809.exe The following are optional, depending on whether you want to look at merged asm and C: Makefile stabs.c wibble.c incfile.h fn.c (even more optional, used to test stabs "make") Graham Toal, 20220905 --- Memo to self: for previous attempt at running gcc on linux extracted from Malban's Vide installation kit, NOT using "wine", see /usr/local/lib/gcc and /home/gtoal/src/vectrex-gcc-test and gcc-gcc6809-4_3_branch/gcc/