ZEMU and the pdp8

Johnny Billquist bqt at softjar.se
Tue Apr 10 16:30:36 CDT 2007

David, I couldn't reply to you. Your mail server for some reason don't 
want anything to do with me, so I'm posting this here instead.

Yes, I've seen the discussion.
My view is basically that it's not impossible at all. Just a question of 
actually write the thing. Memory wise it will be just fine.
Large V5 games will probably require too much memory, but I think almost 
all Infocom games will be fine. They have much more modest requirements. 
Inform games both require lots of memory, and are extremely inefficient, 
on a level that makes you not want to play them because of speed issues 

As someone noted in cctalk, a few issues to deal with is about the fact 
that the z-machine is oriented towards 8-bit based architectures, so you 
will get some extra work, and inefficiencies because of that. Not much 
to do about it, except to live with it. It's nothing strange, just extra 

Any z-machine on a small computer needs to implement a virtual memory 
scheme. I did that for ZEMU, and the same goes for one on the PDP-8. But 
that's easy. You just have a paging scheme with an LRU algorithm. The 
easiest there is. I stole the design from Frotz, I think, and then 
improved some on it, and adopted it to my needs.

Also, I used Frotz as a debugging tool when I wrote Zemu. It helps to 
have a working Z-machine around, which you can tinker with and add 
printouts to, to compare with what is happening in your implementation.

Well, like I said. I don't see any real problems, except it will take 
some work. ZEMU took me probably a couple of months atleast, in the end.
And then Megan did the work to port it to RT-11.

For the PDP-8 I would think that you'd want atleast 16K, by the way. I 
think that the z-machine will need around 8K, and then you need atleast 
4K for the dynamic memory, which would leave 4K for the game code. More 
is always better, though. Larger games will need more dynamic memory, 
but one 4K field for the game code is plenty enough. In ZEMU I think I 
normally only use 10 pages of 512 bytes each for game code, but I can 
play any game with just one page, and it gets slower, but not unbearably so.

The things that are tricky is really timers and screen handling. A lot 
of code in ZEMU is to deal with this stuff. But you really don't need to 
bother with either. Especially not if you're focused on V3 games. 
Another big item in ZEMU is to deal with all different versions of the 
z-machine. By focusing on just V3, that would become much simpler.

Actually, I think it's both realistic, and probably wise to focus on 
just V3. It will be much less code if you ignore other versions, most 
Infocom games will run just fine, and you can skip timers, and have a 
simple screen handling. Memory requirements will not be bad.
I mean, basically, the z-machine consists of executing instructions, 
which aren't that difficult. And then you need the memory handler and 
the screen handler. A few instructions are very complicated, but that's 
just a very few, like the parse instruction which converts an input line 
into tokens.
And then you need to deal with the 8 vs 12 bit issues, and decide on how 
to layout the virtual memory in the physical.


David Griffith skrev:

 > On the cctalk list, there's a thread on how to get a Z-Machine running on
 > a pdp8.  Since you did this on a pdp11, I thought you might have some
 > insight on this tricky goal.

Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol

More information about the cctech mailing list