Prev: USB drives, caching and sync
Next: Which CPU to choose?
From: Andrew Reilly on 12 Jan 2010 07:53 On Tue, 12 Jan 2010 09:36:18 +0100, Philipp Klaus Krause wrote: > I want to write programs for a Z80-based system where 32K of RAM and 32 > K of ROM are available, developing on and cross-compiling on a GNU/Linux > system. > So far I've used the sdcc compiler for this. Now I'm looking for > something that compiles to C; the output would then be fed into sdcc > again. I would like to be able to use the C libraries I have written for > this system before. > My goal is both to try a new language (I know C, but would like to have > a look at other programming styles, maybe OO or functional) and see how > sdcc handles the resulting C code. A couple that spring to mind are smart-eiffel (for the object oriented flavour), gambit-C (for scheme/functional) and there's at least one forth that compiles through C, from memory. Unfortunately, I suspect that all of those will probably have some fairly strong assumptions about 32- bitness that will be uncomfortable to accommodate on a Z-80. For practical purposes, you're probably better off getting your higher- level ease through an interpreter (that you might have to write yourself), and which links to your existing C libraries. There are some pretty cool starting points in VM-based scheme and threaded forth systems. The tricky part is going to be building a sufficiently sophisticated garbage collection system that will run in that little memory: most of the "cool" languages use garbage collection. A simple mark/sweep engine might do for starters. A multi-generational BIBOP allocator might not fit comfortably... Cheers, -- Andrew
From: Albert van der Horst on 12 Jan 2010 10:54 In article <4b4b33cf$0$9752$6e1ede2f(a)read.cnntp.org>, Philipp Klaus Krause <pkk(a)spth.de> wrote: >I asked this question here about one and a half years ago. I'm posting >again since I'm curious about the current situation. > >I want to look at alternatives to C for Z80 programming using languages >that compile to C. There are the following requirements: > >- Compiles to C >- Free compiler >- Low memory usage (I have only 1KB of RAM, 32KB of ROM) > >Has anyone come across such a language? When I worked on the Z80 ( 80's) there was the Aztec c-compiler. It was a nice system, well-documented, with source for the libraries. It wasn't free, but almost (couple of hundred euro's). If you can lay hands on a copy, it will certainly full fill your needs. > >The last requirement seems to be a rather hard one. Many languages that >compile to C include relatively large overhead or do dynamic allocation >of memory, etc. So far bitc (http://bitc-lang.org/) seems to be the >closest match, but it's abandoned. At the time having merely 1KB of RAM wasn't extreme. > >Philipp -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert(a)spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
From: Philipp Klaus Krause on 12 Jan 2010 11:15 Albert van der Horst schrieb: > > When I worked on the Z80 ( 80's) there was the Aztec c-compiler. > It was a nice system, well-documented, with source for the libraries. > It wasn't free, but almost (couple of hundred euro's). > If you can lay hands on a copy, it will certainly full fill your needs. I'm not looking for a C compiler. There already is sdcc targeting the Z80, which seems perfect for me. I want to try different languages, which should compile to C (so I can send the resulting C code into sdcc). Philipp
From: Doug McIntyre on 12 Jan 2010 11:38 Philipp Klaus Krause <pkk(a)spth.de> writes: >Unfortunately AFAIK, no one has managed to build cfront on a modern >system (googling e.g. for cfront linux doesn't return any encouraging >results). cfront is a historical curiosity. It never kept up with the standard, so only the most basic C++ code would even compile. The historic code I played around with seems to be in a rather poor state for cross-compatibility as well.
From: Stephen Pelc on 12 Jan 2010 15:40
On Tue, 12 Jan 2010 17:15:18 +0100, Philipp Klaus Krause <pkk(a)spth.de> wrote: >I'm not looking for a C compiler. There already is sdcc targeting the >Z80, which seems perfect for me. I want to try different languages, >which should compile to C (so I can send the resulting C code into sdcc). Do you have any objection to compilers which generate binary directly? If you have a link map from SDCC it is usually quite simple to provide an interface to the C libraries, providing that you know the start up mechanism of the C system. Stephen -- Stephen Pelc, stephenXXX(a)mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeforth.com - free VFX Forth downloads |