Re: [stella] z26 linux port snapshot

Subject: Re: [stella] z26 linux port snapshot
From: "B. Watson" <atari@xxxxxxxxxxxxxx>
Date: Wed, 21 Apr 2004 12:05:47 -0400 (EDT)

On Wed, 21 Apr 2004, Julian Squires wrote:

> Hi.
> On Wed, Apr 21, 2004 at 03:28:52PM +0000, rufbo1@xxxxxxxxxxx wrote:
> > Forgive my ignorance here, but what's stopping you from decompiling
> > the asm into relatively standard C and recompiling for LinuxPPC (okay,
> > YDL now) and possibly later for OS X?  I realize it'd be much, much
> > slower, but how close is Moore's Law to catching other architectures
> > up to acceptable performance on high end machines?  Might be neat to
> > at least have z26 running on a dual G5...  ;^)

It wouldn't be `decompiling'... AFAIK decompilers rely on the conventions
used by the C compiler, when they're interpreting the asm code. The z26
asm code was written in assembler, doesn't follow those standards. I
dunno if it would be possible to use a decompiler on it at all.

> It's theoretically possible but practically very tricky.  Even
> converting the assembler from MASM to NASM took a lot of care, from what
> I can tell.  I was considering translating it to PPC asm (or portable C)
> manually, but the size of the file and the number of macros makes it a
> fairly imposing task, unfortunately.

Yeah, it was pretty painful... I wrote a perl script that did maybe 95%
of the job automagically, then finished the rest by hand... then Eckhard
found the bugs introduced by me and my perl script (I dunno if I would
have found them, I'm not a great x86 asm programmer).

> I'm sure that powerpc machines will be getting a bit more attention
> anyway now with the Stella maintainer hanging around here.

...and as soon as the z26 Linux port stabilizes, we'll be transliterating
the x86 asm code to C, so you'll be able to compile it for PPC Linux,
Mac OS X, or whatever (Solaris? AIX? NextStep? It already works on BeOS!)

Actually I've started on some of the C-ification already, for data
definitions and setup routines that only get called once. The next
snapshot should have this tiny bit of C code in it.

Eventually, the asm code will be only the TIA, RIOT, and 6502 stuff, at
which point we'll write a C version, but keep the asm version, so you'll
be able to pick between them at compile time. At least, this is what I
want to do. The C core will probably be slower, but maybe not all that
much slower: the current asm core is highly optimized for the original
non-MMX Pentium, which probably hurts it some on more modern CPUs.

(Heh. I can already hear you muttering `Altivec'...)

Archives (includes files) at
Unsub & more at

Current Thread