On Mon, 4 Sep 2006, Johnny Billquist wrote:
However, have you ever programmed on a PDP-8?
Not much, but I'm a bit familiar with it.
If so, you would realize that it really requires you
to do things a bit
different from what people nowadays do.
You have 4K word pages. One word is 12 bits. The addressing style of
instructions really limit most routines to what you can fit into 128 words.
No stack...
What's a stack? ;-))
(Note: There's no stack on the PALM either, but other goodies instead, I
admit).
Like I said, it wouldn't be difficult to write a
Z-machine interpreter for
the PDP-8, but you'd better not base it on something written in C.
You might pick an idea or two from Frotz, for instance, but you'd have to
rewrite that as well to fit with the PDP-8.
I think if you take an assembler program as a starting point you might
oversee the essential point of the routine because you are too busy
figuring out how to port that to another assembler language for a
completely different architecture. A (simple!) C program shows you what
you need to know and then you can think of doing the same in whatever
language and for whatever architecture. That's the reason I chose the ITF
interpreter (and not Frotz or any other one).
And you have almost no OS to support you either, so
you'd have to implement
the I/O as well, and figure out which, if any, clock you have, if you want to
implement timed input.
Well, there's no OS at all on the IBM 5110, only some monitor routines
that assist you in accessing the floppy or the printer, but the I/O (and
much else) has to be done from scratch (there are no library routines,
nothing!). You have to write your own 16 bit math routines, multiplication
and division and the like. Although the PALM is a 16 bit processor, the
ALU only is 8 bits wide (with carry into the high order byte). There are
neither screen output nor very handy keyboard input routines, so you need
to get a bit creative. Ah, and not to forget the Z-Code <--> ASCII <-->
EBCDIC conversions required, custom line wrapping (screen has only 64x16),
custom "MORE"-like pager, etc.
Christian