z80 vs Python

Christopher T King squirrel at WPI.EDU
Thu Jun 24 17:34:53 CEST 2004

> I have an idea that implements the Python interpreter for z80 as an
> universal flexible language (like scripts) to support attached hardware.
> What would it be shortest way to do it?
> I think of course about C (Zilog has good support of own products...).

I wouldn't recommend this. The standard Python interpreter is quite hefty
(>700K dynamically linked), not to mention the standard libraries. Seeing
as Z80 has only 64K address space, I don't see a full implementation as

What you /could/ do would be to implement a (very) small subset of Python;  
i.e. leave out generators, new-style class, list comprehensions, ability
to override built-in types, functions, and operators, and most of the
standard library, then you /might/ be able to fit a language with Pythonic
syntax in that address space.

Another issue would be speed. Z80s, though they've gotten faster over the 
years, still only run at speeds on the order of 10MHz. You might be better 
off writing a Z80 compiler for a Python-esque language -- this would save 
both speed and memory.

If you can pick a different chip, go with something like a StrongARM. 
These have the power and address space necessary for Python. Plus, it's 
been done before (Python runs beautifully on modern PDAs).

If you stick with the Z80 though, you've got quite a challenge ahead of 
you - good luck! If you succeed, you'll be sure to make hackers of Game 
Boys, TI-83s, and TRS-80s everywhere deliriously happy.

More information about the Python-list mailing list