[Coco] Compiler [was: CoCo Video Player]
John Kent
jekent at optusnet.com.au
Tue Mar 22 00:54:17 EDT 2011
Hi John,
I've downloaded bcc09 and will take a look at it. Boisy has written a C
compiler for the 6809 also which I've also downloaded, but I have to set
up a development environment to compile it. I haven't looked at the
source code, but I think it might have been written in Java.
OK on the output of bcc09 being similar to the old Introl compiler. I'm
not sure who I was talking to, whether it was Rich Pennington from
Introl, or John Hartman from NoICE, but I think the Introl compiler
included line numbers of the source code that could be used to index the
source or listing file.
I don't currently have a PC with Linux installed on it, but I do have
Mingw and Cygwin. I did install Wubi on this PC, but I have fogotten the
password and can't log in. I'll have to uninstall and reinstall it.
I also had VMware running CentOS on this PC so I could run the Linux
version of the Xilinx ISE software. I tried to uninstall VMware but it
didn't uninstall properly.
I used to run Linux years ago back in the days of dial up modems and
Yidrasil (sp?). I had Red Hat 6.2 running on an old machine at one stage
with IRLP software on it that doubled as a firewall router with 10base T
coax running around the house :-)
I was looking at Vbcc a while back and that had peek hole optimization
using string matching and substitution on the assembler output.
Generating a run time library for the compiler might not be too hard.
I'm not sure what the issue is with OS-9. The SuperSleuth disassembler
for the 6809 gave you a switch for disassembling code into position
independent format. It would not matter if you used position independent
code for FLEX, just provided the library had hooks into the operating
system. I would have thought OS-9 would have provided similar I/O
interfaces to Flex.
Thanks for your reply. I'll take a look at the code when I have done my
other chores.
John
On 22/03/2011 7:04 AM, John W. Linville wrote:
> A while back, I was looking at retargeting the Bruce Evans C compiler
> (bcc) to target the coco. I figured I'd start with RSDOS (or
> possibly FLEX) targets, since those have less specific code generation
> requirements than OS-9. But, I hoped to support (Nitr)OS-9 as well.
>
> For those not familiar with it, the Bruce Evans compiler goes way back.
> It was (or is?) used to build Linux-oriented boot loaders like LILO
> and GRUB, and before that it was used in the Minix world. But what
> makes it interesting is that it can also be built as a 6809 compiler.
> At its heart it's a K&R compiler, but it does have an "ANSI" mode
> that AFAICT is mostly just a function prototype convertor. There is
> also a peephole optimizer as part of the codebase, but alas there
> are no optimization rules for 6809 included.
>
> The object file format actually is the same as the old Introl compiler,
> a commercial offering that targetted FLEX and probably some embedded
> systems and the like. So theorhetically those libraries could be used
> with the compiler -- not a big motivator, but worth knowing. :-) I did
> manage to find documentation for the Introl object format and convinced
> myself that the format matched what the toolchain was producing.
>
> When I was experimenting with it, it seemed to be generating reasonable
> code. FWIW, I believe Chet Simpson had previously (years ago) said on
> this list that he had used bcc for some coco work and that he was
> pleased with its code generation. Chet also claimed to have done
> some enhancements to bcc. I managed to find the sources he published,
> but IIRC any changes from the original sources were minimal.
>
> So anyway, I decided that there wasn't much point in keeping the
> 80x86 code generation in the codebase -- let the x86 bootloader
> and ELKS folks worry about that! :-) So, I set-out to strip all
> the non-6809-relevant bits from the code base. I also made a few
> changes to the defaults (like setting the "ANSI" mode by default),
> and I applied a few bug fixes (mostly related to building/running
> on x86_64). I called the project 'bcc09' and put the results here:
>
> http://git.infradead.org/users/linville/bcc09.git
>
> In my work, I'm really only concerned with Linux. With that said,
> I have no motivation to prevent running on other Unix-like OSes
> (including OSX) or even Windows. I would just need someone else to
> be interested enough to try that and to send patches to fix whatever
> is broken. If you are interested, then let me know!
>
> John
--
http://www.johnkent.com.au
http://members.optusnet.com.au/jekent
More information about the Coco
mailing list