z80 vs Python

J

Janusz U.

Hello!

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'm waiting for the opinion.

The best regards
Janusz U.
 
J

Janusz U.

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
possible.

I know. Sorry, I didn't precise. I thought exactly about eZ80F91 - it's
based on Z80 but much more expanded... I will start on the module (and
deviloper kit) for that procesor. It would be independent platform for
tests software in the Python.
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.

I think to expand language by own library for Python - eg. control GPIO of
eZ80, read
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.

speed 50MHz (or 20MHz in F92, F93...)
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).

I have just bought the developer kit for eZ80 so I have limited way. I'd be
happy to run Python on eZ80 platform.

thx
Janusz U.
 
C

Christopher T King

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
possible.

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.
 
?

=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=

Personally, if I had the time, I'd try porting python to a gumstix
board:

http://www.gumstix.com/

It probably wouldn't be too hard, but still, it'd be fun to get it
onto that tiny board. :)

That board is incredible !

Is the "special" 286 processor on it 32-bit or 16-bit like the old 286
was ?
I guess you can't run Linux on a 16 bit so it must be 32...

And the price is so small !
 
P

Phil Frost

Actually, the 286 is essentially a 32 bit processor. It has most of the
features of the 386, only many of the control structures such as the GDT
are different, as well as the memory bus.
 
P

Paul Boddie

Pierre-Frédéric Caillaud said:
[...]

Is the "special" 286 processor on it 32-bit or 16-bit like the old 286 was ?

On the gumstix board? It's an XScale processor, meaning that it has a
32-bit ARM architecture, although I don't follow the exact twists and
turns of the different ARM architectures these days, so I may be
simplifying there somewhat.

Paul
 
J

Janusz U.

Uzytkownik "Phil Frost said:
Actually, the 286 is essentially a 32 bit processor. It has most of the
features of the 386, only many of the control structures such as the GDT
are different, as well as the memory bus.

but '86 is not compatible with Z80 (only little in hardware part - buses)

The best RGS
Janusz
 
G

Grant Edwards

That board is incredible !

Is the "special" 286 processor on it 32-bit or 16-bit like the old
286 was ? I guess you can't run Linux on a 16 bit so it must be 32...

There is a "16-bit" version of Linux called ELKS that runs on 8086 class CPUs.
 
C

Corey Coughlin

Oh, it's not a 286 processor, it's a Intel XScale® PXA255, which is a
full 32 bit ARM architecture. Basically, it's the same processor you
find in a lot of PocketPC PDAs. So it's not x86 compatible, but there
are plenty of linux versions (full 32 bit) around for it. Although
the memory constraints require you to scale things down a little. It
looks like they're taking the processor and adding the minimum support
chips to keep the board small.

It's kind of a shame in some ways, what I'd really like to see is
something using the new multicore ARM, so that you could go for a
massive multiprocessor architecture with the lowest possible power.
And a higher speed interface, like PCI, so you could gang them
together to a normal pc, kind of like the clearspeed processor
(www.clearspeed.com). Then you could really start looking at massive
computing power on the desktop at low power. Not that I really need
it or anything, but still, could be fun.
 
P

Paul Rubin

Phil Frost said:
Actually, the 286 is essentially a 32 bit processor. It has most of the
features of the 386, only many of the control structures such as the GDT
are different, as well as the memory bus.

Huh? The 286 has memory protection and 386-like segment descriptors,
but it's a 16 bit processor through and through. It has a 16-bit ALU
with 16-bit registers, and addresses within a segment are 16 bits.
Yes, there were versions of Unix that ran on it, which isn't too
surprising given Unix's origins in the 16-bit PDP-11 world. I'm not
aware of a Linux port to it, unless you mean something like ucLinux.
 
G

Grant Edwards

Huh? The 286 has memory protection and 386-like segment descriptors,
but it's a 16 bit processor through and through. It has a 16-bit ALU
with 16-bit registers, and addresses within a segment are 16 bits.

Definitely. The basic ALU architecture was carried over
directly from the 8086. The 80286 just had some extra
memory-protection and segmentation features along with some
user/supervisor stuff.
Yes, there were versions of Unix that ran on it, which isn't too
surprising given Unix's origins in the 16-bit PDP-11 world.

I ran Coherent (a v7 clone) on a '286 for a while. Each
process was limited to 64K data and 64K text space because of
the CPU's 16-bit architecture.
I'm not aware of a Linux port to it, unless you mean something
like ucLinux.

IIRC ucLinux is still 32-bit and uses gcc (hence no 8086 port).
ELKS, OTOH, runs on the 8086.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top