There are 24 messages in this thread.
You are currently looking at messages 0 to 10.
I want to look at alternatives to C for Z80 programming. Since there's probably nothing that directly compiles to Z80 asm I want to look at languages that compile to C. There are the fopllowing requirements: - Compiles to C - Free compiler - Low memory usage (I have only 1KB of RAM) Has anyone come across such a language? 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 badly documented and a pain to build. It seems the authors just see it as a tool for development of Coyotos, their embedded OS, not as a generic programming language someone else might want to use. Philipp
On Jul 13, 11:36=A0am, Philipp Klaus Krause <p...@spth.de> wrote: > I want to look at alternatives to C for Z80 programming. > Since there's probably nothing that directly compiles to Z80 asm I want > to look at languages that compile to C. Which are quite rare. > There are the fopllowing > requirements: > > - Compiles to C > - Free compiler > - Low memory usage (I have only 1KB of RAM) Have you considered FORTH? > > Has anyone come across such a language? > > 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 badly documented and a pain to build. It seems > the authors just see it as a tool for development of Coyotos, their > embedded OS, not as a generic programming language someone else might > want to use. > > Philipp
On Jul 13, 10:36=A0am, Philipp Klaus Krause <p...@spth.de> wrote: > I want to look at alternatives to C for Z80 programming. > Since there's probably nothing that directly compiles to Z80 asm I want > to look at languages that compile to C. There are the fopllowing So you add the overhead of a C compiler that needs to guess the optimal way to represent something in an alien language? If you don't want to program directly in C then I'd suggest focusing on other languages that do have Z80 output capability. There are plenty of compiled languages that emit Z80 code - Ada, Fortran, ... and of course BASIC variants abound. And some interpreted BASICs (BBC BASIC for instance, used in the Amstrad NC100 among other things) are already ported to the Z80 and very nice. Take a look, for just one example, at <http://www.z80.info/z80sdt.htm>
Philipp Klaus Krause wrote: > I want to look at alternatives to C for Z80 programming. > Since there's probably nothing that directly compiles to Z80 asm I want > to look at languages that compile to C. There are the fopllowing > requirements: > > - Compiles to C > - Free compiler > - Low memory usage (I have only 1KB of RAM) > > Has anyone come across such a language? > > 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 badly documented and a pain to build. It seems > the authors just see it as a tool for development of Coyotos, their > embedded OS, not as a generic programming language someone else might > want to use. > > Philipp If you understand C programming, why not modify the C output from bitc or any other compiler. If don't understand C programming, learn. donald
Philipp Klaus Krause wrote: > I want to look at alternatives to C for Z80 programming. > Since there's probably nothing that directly compiles to Z80 asm I want > to look at languages that compile to C. There are the fopllowing > requirements: > > - Compiles to C > - Free compiler > - Low memory usage (I have only 1KB of RAM) Which Z80 only has 1K ram ? > > Has anyone come across such a language? > > 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 badly documented and a pain to build. It seems > the authors just see it as a tool for development of Coyotos, their > embedded OS, not as a generic programming language someone else might > want to use. CP/M ran on the Z80, so there are shiploads of old tools out there. Rather than add another link in the chain, for litle benefit, find a toolchain that runs on the Z80, and operates on a PC (comand line) under Z80 emulation ? You will find forth, Pascal, Modula-2, BASIC's by the Dozen I think Intel also had a PL/M for the 8080 ? If you only have 1K ram, this cannot be a big project, so why the aversion to C ? For small projects, it may be more productive to tolerate C, but have better access to DEBUG, than chosing a better language, with poorer debug access ? eg Zilog's Z80Acclaim has a Free C, and it ALSO has good Debug support. -jg
On Mon, 14 Jul 2008 09:30:50 +1200, Jim Granville <n...@designtools.maps.co.nz> wrote: >Philipp Klaus Krause wrote: >> I want to look at alternatives to C for Z80 programming. >> Since there's probably nothing that directly compiles to Z80 asm I want >> to look at languages that compile to C. There are the fopllowing >> requirements: >> >> - Compiles to C >> - Free compiler >> - Low memory usage (I have only 1KB of RAM) > >Which Z80 only has 1K ram ? The 28 year old Sinclair ZX80 perhaps? ;-) http://en.wikipedia.org/wiki/Sinclair_ZX80 Joop
On Jul 13, 6:31=A0pm, Joop <j...@xs4all.nl> wrote: > >Which Z80 only has 1K ram ? > > The 28 year old Sinclair ZX80 perhaps? ;-)http://en.wikipedia.org/wiki/Si= nclair_ZX80 The ZX81 was considerably more popular, if you have a spare ZX80 I want to buy it :) Also there are many hobbyist SBCs and I think a couple of other home computers with a Z80 CPU and 1K RAM (as 2 x 2114). There are various Z80 micros with 1K RAM on-chip too, the Z80S188 coming immediately to mind.
Philipp Klaus Krause wrote: > - Low memory usage (I have only 1KB of RAM) With 1KB of RAM, I can't see how you'd be doing anything at all useful in any language other than Z80 assembler. Wanting a pre-compiler to produce C then compile and link the C source output in 1KB - not a chance. Or are you talking about rommable software with 1KB RAM? Regards, -- Mark McDougall, Engineer Virtual Logic Pty Ltd, <http://www.vl.com.au> 21-25 King St, Rockdale, 2216 Ph: +612-9599-3255 Fax: +612-9599-3266
Mark McDougall wrote: > Philipp Klaus Krause wrote: > >> - Low memory usage (I have only 1KB of RAM) > > With 1KB of RAM, I can't see how you'd be doing anything at all useful > in any language other than Z80 assembler. Wanting a pre-compiler to > produce C then compile and link the C source output in 1KB - not a chance. > > Or are you talking about rommable software with 1KB RAM? > > Regards, > The first processor for which I wrote embedded C had 128 bytes of RAM, and the application worked just peachy. 1kB would have left me awash in spare memory. I would put a 1kB processor into the "definitely use C" category, rather than the "definitely avoid C" category. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
Tim Wescott wrote: > The first processor for which I wrote embedded C had 128 bytes of RAM, > and the application worked just peachy. 1kB would have left me awash in > spare memory. Was the code in ROM with 128 bytes of RAM? I'm assuming the OP is talking about a total ROM+ROM of 1KB. Hence my last (as yet unanswered) question. Regards, -- Mark McDougall, Engineer Virtual Logic Pty Ltd, <http://www.vl.com.au> 21-25 King St, Rockdale, 2216 Ph: +612-9599-3255 Fax: +612-9599-3266