knowledge-database (beta)

Current group: comp.compilers

Z80 C compiler recommendations

Z80 C compiler recommendations  
David Given
 Re: Z80 C compiler recommendations  
Paul R. Santa-Maria
 Re: Z80 C compiler recommendations  
John
 Re: Z80 C compiler recommendations  
Jürgen_Kahrs
 Re: Z80 C compiler recommendations  
Jose Juan Mendoza Rodriguez
 Re: Z80 C compiler recommendations  
David Given
From:David Given
Subject:Z80 C compiler recommendations
Date:9 Jan 2005 20:53:27 -0500
I'm currently looking for an open-source Z80 C compiler that generates
good code. I'm wondering if anyone has any recommendations.

What I'd really like is gcc for the z80, but while there have been
numerous projects to do a port none of them have been
completed. There's an lcc port but lcc has dubious licensing and I
could never make it work properly. sdcc supports the z80, but I wasn't
impressed by the code.

Recently, I discovered that the Amsterdam Compiler Kit
(http://www.cs.vu.nl/vakgroepen/cs/ack.html) has been open sourced; it
will generate code for the PDP-11, VAX, 68000, SPARC, 8080, 8086,
80386, Z80, Z8000 and the NS16032, among others, and has frontends for
a number of different languages, including ANSI C and a C++ subset
(and Basic!), and in general looks rather good. However, the build
process is incredibly antiquated and very scary and I never actually
managed to get it installed properly, so I never got the multi-stage
optimiser to work, so I haven't been able to evaluate the code. Does
anyone have any experience of this? Is it worth persevering with?

The problem with the Z80 is that it's so incredibly CISC that
optimising for it requires lots of human effort. Most modern free
compilers do a decent job at optimising for RISC architectures, but
that can mostly be done generically, and so suck on the Z80. Sigh. It
could be worse, however; it could be a 8080, with three usable
registers... the best compiler I've found so far is Hitech C, except
that's not available (for free) as source, and I have to run it
self-hosted in a CP/M emulator.

Is there anything else I should look at? TenDRA? tcc? I'm not averse
to doing some work, including doing a rudimentary port, but I'd prefer
to use one done by someone who actually knows what they're doing.
--
+- David Given --McQ-+ "I never really understood how there could be
| dg@cowlark.com | things that would drive you insane just because you
| (dg@tao-group.com) | knew them until I ran into Windows." --- Peter da
+- www.cowlark.com --+ Silva
From:Paul R. Santa-Maria
Subject:Re: Z80 C compiler recommendations
Date:12 Jan 2005 22:58:38 -0500
David Given wrote:
> I'm currently looking for an open-source Z80 C compiler that generates
> good code. I'm wondering if anyone has any recommendations.

You can try asking in comp.os.cpm. One CP/M K&R
C compiler, BDS C, has been made open source:
http://www.bdsoft.com/resources/bdsc.html

--
Paul R. Santa-Maria
Monroe, Michigan USA
From:John
Subject:Re: Z80 C compiler recommendations
Date:12 Jan 2005 22:56:24 -0500
Is "http://sdcc.sourceforge.net/" of any use to you?

John
From:Jürgen_Kahrs
Subject:Re: Z80 C compiler recommendations
Date:12 Jan 2005 22:58:01 -0500
David Given wrote:

> Recently, I discovered that the Amsterdam Compiler Kit
> (http://www.cs.vu.nl/vakgroepen/cs/ack.html) has been open sourced; it

Thanks for mentioning this. Does anyone know if the ACK is still
supported or used ?
From:Jose Juan Mendoza Rodriguez
Subject:Re: Z80 C compiler recommendations
Date:15 Jan 2005 20:52:38 -0500
Juergen Kahrs wrote:

>David Given wrote:
>
>> Recently, I discovered that the Amsterdam Compiler Kit
>> (http://www.cs.vu.nl/vakgroepen/cs/ack.html) has been open sourced; it
>
>Thanks for mentioning this. Does anyone know if the ACK is still
>supported or used ?

It's used in Minix:

http://www.cs.vu.nl/pub/minix
ftp://ftp.cs.vu.nl/pub/minix
http://minix1.hampshire.edu
http://minix1.bio.umass.edu

The ACK is not actively maintained (it's the only package in Minix
that comes in binary form), but I think you can trust it. I have
used it intensely during the last few years, and I have never found
a single bug in it (though folklore says that there is a bug in the
global optimizer, the one that gets called with -O2 and above).
It has even succeeded in compiling (with -O2) the TenDRA C/C++
compiler on Minix, and this one seems absolutely stable.

Regards.
Jose Juan Mendoza Rodriguez
From:David Given
Subject:Re: Z80 C compiler recommendations
Date:14 Jan 2005 00:42:34 -0500
Jürgen Kahrs wrote:
> David Given wrote:
>> Recently, I discovered that the Amsterdam Compiler Kit
>> (http://www.cs.vu.nl/vakgroepen/cs/ack.html) has been open sourced; it
>
> Thanks for mentioning this. Does anyone know if the ACK is still
> supported or used ?

I think it's totally unsupported. It certainly doesn't build
out-of-the-box on my Linux system, due to the build system being
really scary.

At some point in my copious free time I should probably look into
getting rid of the ghastly interactive configuration script (are you
running V7, BSD or SysV?) and autoconfing it; it'd be nice to get it
working.

Supported backends seem to be:

i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22
em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020
sun3 sparc sparc_solaris ns pdp s2650 vax4 z80 z8000 arm

Supported frontends seem to be:

Modula-2 Pascal Occam(!) Basic(!!) ANSI-C C Fortran

That's a good list.

--
+- David Given --McQ-+ "There are two major products that come out of
| dg@cowlark.com | Berkeley: LSD and Unix. We don't believe this to be
| (dg@tao-group.com) | a coincidence." --- Jeremy S. Anderson
+- www.cowlark.com --+
   

Copyright © 2006 knowledge-database   -   All rights reserved