Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PDP8/I vs 8/E question

167 views
Skip to first unread message

Brian White

unread,
Oct 22, 2018, 9:20:03 AM10/22/18
to
Hi all
I've been building an FPGA PDP8/I as a way to learn Verilog. It's based on the information on the PDP8/I in Prosser's book (http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp8/pdp8i/Prosser_The_Art_of_Digital_Design_2ed_1987.pdf) I've got it pretty much working. Specifically, it passes the tests in https://github.com/lisper/cpus-pdp8/tree/master/tests/src: MAINDEC-8I-D01C-D (instruction test), MAINDEC-8I-D02B-D (instruction test 2), MAINDEC-08-D1GB-D (extended memory).
I'd really like to get it to run FOCAL. I've been using the FOCAL-8 that ships with the PDP8/E simulator (https://www.bernhard-baehr.de/pdp8e/pdp8e.html). The FOCAL-8.bn there runs with the simulator and with simh but will not run with my verilog version. On my simulator, I get two 000 characters and then it ends up in an infinite loop waiting for something but it never prints the "CONGRATULATIONS...." message.
I'm thinking that, since I built something close to a PDP8/I and both simulators that can run FOCAL-8 are PDP8/E's, it might be some subtle difference between the 8/I and 8/E. I've been looking around on the web but can't find a definitive list. As I've been debugging, it looks like the first parts of FOCAL-8 try to figure out what kind of PDP8 it's running on. I was able to implement the unusual opcode 7354 (CLA CLL CMA RAL RAR that puts 3776 in the ac) but it still fails to print the welcome message.
Any help would be great. Is there a list somewhere of the differences (at the CPU level) between 8/E and 8/I? Alternatively, are there places I should be looking for what I'm doing wrong?
Thanks for your time.

Brian

Vincent Slyngstad

unread,
Oct 22, 2018, 5:05:25 PM10/22/18
to
"Brian White" wrote in message
news:b53091a4-986f-4c9a...@googlegroups.com...
> I'm thinking that, since I built something close to a PDP8/I and both
> simulators that can run FOCAL-8 are PDP8/E's, it might be some subtle
> difference between the 8/I and 8/E. I've been looking around on the web but
> can't find a definitive list. As I've been debugging, it looks like the first
> parts of FOCAL-8 try to figure out what kind of PDP8 it's running on. I was
> able to implement the unusual opcode 7354 (CLA CLL CMA RAL RAR that puts 3776
> in the ac) but it still fails to print the welcome message.
> Any help would be great. Is there a list somewhere of the differences (at the
> CPU level) between 8/E and 8/I? Alternatively, are there places I should be
> looking for what I'm doing wrong?

The first thing that comes to mind when you mention infinite loop and
FOCAL in the same breath, is an undealt-with interrupt. It is a design
issue in the 8/I, which was partly dealt with in the 8/E, that interrupts
will be continuously requested until they are dealt with. Which means,
if you don't deal with them, you can't make forward progress -- you
just keep getting interrupted again and again.

In the 8/E, many (most?) devices by default mask their interrupt, until
you enable it. (Which also means extra IOTs to do that, with their
attendant complexity, etc.)

So, are you looping through the interrupt service routine over and
over, perchance?

Vince

Brian White

unread,
Oct 23, 2018, 9:11:37 AM10/23/18
to
On Monday, October 22, 2018 at 5:05:25 PM UTC-4, Vincent Slyngstad wrote:
> "Brian White" wrote in message
>
> The first thing that comes to mind when you mention infinite loop and
> FOCAL in the same breath, is an undealt-with interrupt. It is a design
> issue in the 8/I, which was partly dealt with in the 8/E, that interrupts
> will be continuously requested until they are dealt with. Which means,
> if you don't deal with them, you can't make forward progress -- you
> just keep getting interrupted again and again.
>
> In the 8/E, many (most?) devices by default mask their interrupt, until
> you enable it. (Which also means extra IOTs to do that, with their
> attendant complexity, etc.)
>
> So, are you looping through the interrupt service routine over and
> over, perchance?
>
> Vince

Hmmm - it _is_ stuck in an interrupt-involved loop. I will look at it over the weekend and see what's up. That's a very useful place to look. Thanks for the tip - it is always a pleasure working with experts....

All the best
Brian

Vincent Slyngstad

unread,
Oct 23, 2018, 1:11:30 PM10/23/18
to


"Brian White" wrote in message
news:5cef7576-efa8-425a...@googlegroups.com...
> Hmmm - it _is_ stuck in an interrupt-involved loop. I will look at it over the
> weekend and see what's up.

My first thought is that you may have included a real time clock interrupt.

It's also possible that some device has come ready without you explicitly
requesting the transfer of the first byte. That seems less likely, as FOCAL
should be able to handle the TTY and a paper tape reader, which are the
most plausible character-at-a-time devices.

> That's a very useful place to look. Thanks for the tip - it is always a
> pleasure working with experts....

You are welcome. Good luck :-)!

Vince

Klemens Krause

unread,
Oct 24, 2018, 9:50:02 AM10/24/18
to
Brian White wrote:
...
> Is there a list somewhere of the differences (at the CPU level) between
> 8/E and 8/I? Alternatively, are there places I should be looking for
> what I'm doing wrong?

I don't know, which FOCAL-version is in the baehr-simulator. I'm running
DEC-08-AJAE-PB 7/9/69
FOCAL 1969 + INIT
4K INIT

on all of my machines: classic-8, 8/L (which is essentialy an 8/I), 8/E,
VT-78 and SBC 6120.
Differences between classic-8 and 8/I is, that classic-8 cannot combine
shift and IAC operations, and classic-8, 8/I, 8/L don't have BSW.
All these machines don't have MQ-register in the basic version.
So a FOCAL that runs on the classic-8 doesn't use any of the above features.

If you want a complete list of the differences of the CPU-versions, have
a look in the sources of Charles Lasners KERMIT-version: K12MIT

I suppose you have an error in the interrupt-handling.

Klemens

Brian White

unread,
Oct 25, 2018, 10:21:39 AM10/25/18
to
On Wednesday, October 24, 2018 at 9:50:02 AM UTC-4, Klemens Krause wrote:
> Brian White wrote:
> ...
Klemens
Thanks - I think it’s an interrupt-related thing as well. I’m hoping to have time to dig into it over the weekend. Do you have the FOCAL you’re using in a form you can send to me? I’d like to try it out as well.
Thanks again
Brian

Klemens Krause

unread,
Oct 28, 2018, 6:20:01 AM10/28/18
to
I'll put the FOCAL on our ftp server tomorrow.
Can you import .BN files in raw 8-bit mode in your emulator?
Alternativly I can put it ASCII-form, either in .EN format, to
decode this you need Charles Lasners K12ENC, K12DEC, which comes along
with K12MIT, or I can make an reassemblable octal dump which can be put
into PAL, to produce a loadable .BN

Klemens

William Cattey

unread,
Oct 28, 2018, 11:59:05 PM10/28/18
to
In some experiments with FOCAL69 and UW-FOCAL under OS/8 I was doing,
I discovered that I could not use the terminal emulater PASTE functionality
to insert text from another window into FOCAL. The characters came in too fast
for FOCAL to handle. I think that too was an interrupt-related issue, but didn't
pursue a fix, distracted as I was by other stuff.

FOCAL under ETOS also turned off Interrupts, I believe.

Brian White

unread,
Oct 29, 2018, 8:59:39 AM10/29/18
to
WOO HOO!
I got the code working (almost..). Vince, you were right - I had the IO code for the printer and keyboard wrong. Once I replaced all my complex code with the simple stuff you suggested, I got the welcome message I wanted in the Verilog simulation:

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8/I COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?

It even knows it's a PDP-8/I! It turns out that the details of this message depend on what you do with the 7354 (CLA CLL CMA RAL RAR) instruction. If that leaves ac=7777 (as simh and the OS X PDP-8/E simulator), you get "... ON A PDP-8 COMPUTER", but if it leaves ac=3776 (as this site describes http://www.ibiblio.org/pub/academic/computer-science/history/pdp-8/Generic%20Programs/WHATAMI.pdf), you get the "PDP-8/I" message.

I was then able to move the code to the FPGA and, oddly, I get the first part of the message but not the "SHALL I...". That, and getting keyboard input, are projects for next weekend.

Thanks to all for your help. Once I get this fully working, I'll put the code and info on the web for others to use.

That was FUN!

All the best!

Brian

Brian White

unread,
Oct 29, 2018, 9:01:05 AM10/29/18
to
THANKS!
I can read the .bn format - I wrote a little python script to turn it into .mem format (<address> <data>) - so that will be AOK. I will give it a try.

Thanks again.

Klemens Krause

unread,
Oct 29, 2018, 11:20:02 AM10/29/18
to
Brian White wrote:
> On Sunday, October 28, 2018 at 6:20:01 AM UTC-4, Klemens Krause wrote:
>> I'll put the FOCAL on our ftp server tomorrow.
...
>
> THANKS!
> I can read the .bn format - I wrote a little python script to turn it into .mem format (<address> <data>) - so that will be AOK. I will give it a try.
>
This makes things easier for me: you can find the .BN-file on
http://bitsavers.informatik.org/bits/DEC/pdp8/From_Vince_Slyngstad/dec/dec-08-ajae-pb
It should be the same then our version. Let me knof, if you can't get it running
from there, I'll put our version on our ftp-server.

Klemens

Klemens Krause

unread,
Oct 29, 2018, 11:40:02 AM10/29/18
to
William Cattey wrote:
...
> FOCAL under ETOS also turned off Interrupts, I believe.
>
That must be a special version. Normally FOCAL runs with interrupts on.
I once patched a FOCAL to not using interrupts to run it on an IM 6100
system with incompatible interrupt behaviour.
Especially on the old systems 8/L an older it is essential to do
teletype-I/O with interrupts. The reason is, that on these machines it
is not possible to turn off interrupts for single I/O devices, for
example for the serial line interface. If the teleprinter flag or the
keyboard flag is set the interrupt request is forced.
You cannot say: interrupt by a timer yes, interrupt by powerfail yes,
but interrupt by teletype no.
So serious software authors provided interrupt handled I/O, in case
that other interrupt source would later be added to a system.

Klemens


Brian White

unread,
Nov 1, 2018, 9:42:50 AM11/1/18
to
On Monday, October 29, 2018 at 11:20:02 AM UTC-4, Klemens Krause wrote:

> This makes things easier for me: you can find the .BN-file on
> http://bitsavers.informatik.org/bits/DEC/pdp8/From_Vince_Slyngstad/dec/dec-08-ajae-pb
> It should be the same then our version. Let me knof, if you can't get it running
> from there, I'll put our version on our ftp-server.
>
> Klemens

Klemens, I'm sorry but that link gives a 404 error - not found. It's no rush, but can you check it when you get a chance?
thanks
B

Dennis Boone

unread,
Nov 1, 2018, 10:09:00 AM11/1/18
to
> Klemens, I'm sorry but that link gives a 404 error - not found. It's no rush, but can you check it when you get a chance?
> thanks
> B

Looks like it should be:

http://bitsavers.informatik.uni-stuttgart.de/bits/DEC/pdp8/From_Vince_Slyngstad/dec/dec-08-ajae-pb

De

Brian White

unread,
Nov 1, 2018, 10:14:57 AM11/1/18
to
Thanks - I will test it when I get a chance.
Brian

Vincent Slyngstad

unread,
Nov 1, 2018, 11:33:56 PM11/1/18
to


Brian White wrote in message
news:bcd9a012-0871-4214...@googlegroups.com...
> Klemens, I'm sorry but that link gives a 404 error - not found. It's no rush,
> but can you check it when you get a chance?
> thanks

You can also get that stuff direct from my site here:
http://www.so-much-stuff.com/pdp8/software/dec.php
There is quite a bit of new content since that bitsavers
snapshot was taken.

(However, some of the brand-new tapes in the new OS/8
section are corrupted, and I am currently busily fixing that.)

Vince

Klemens Krause

unread,
Nov 2, 2018, 4:40:01 AM11/2/18
to
Brian White wrote:
> On Monday, October 29, 2018 at 11:20:02 AM UTC-4, Klemens Krause wrote:
...
>> http://bitsavers.informatik.org/bits/DEC/pdp8/From_Vince_Slyngstad/dec/dec-08-ajae-pb
...
>
> Klemens, I'm sorry but that link gives a 404 error - not found. It's no rush, but can you check it when you get a chance?
> thanks


Oh, I'm sorry. I intermixed the URL of the original bitsavers, with .org and
that of it´s mirror here at the university. :-)

In the meantime I have activated a feature of our classic-8 that probably no
emulator in this world can emulate: The KR01 powerfail restart option. It is
possible to plug the running machine off while it is executing a FOCAL program.
When power comes back, the program simply resumes. Only the teletype sometimes
looses a character.
Nice to see on real hardware.

Klemens


cjl

unread,
Nov 4, 2018, 7:57:01 AM11/4/18
to
On Monday, October 29, 2018 at 8:59:39 AM UTC-4, Brian White wrote:
> WOO HOO!
> I got the code working (almost..). Vince, you were right - I had the IO code for the printer and keyboard wrong. Once I replaced all my complex code with the simple stuff you suggested, I got the welcome message I wanted in the Verilog simulation:
>
> CONGRATULATIONS!!
> YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8/I COMPUTER.

This is part of a little can of worms problem some others have touched on and mentioned some of my code.

For starters, I have spruced up the code which will be part of an eventual re-release of Kermit-12 to add a few enhancements I want and some that were requested by others, etc.

Regarding the CPU ID stuff, here is the latest and greatest and it explains a few things.

http://www.ibiblio.org/pub/academic/computer-science/history/pdp-8/Generic%20Programs/WHATAMI.pdf

There are several issues here pertaining to what you are doing:

In FOCAL, 1969 the model detect code is defective. If the reality of the situation is that the machine is really an 8/I or an 8/K then the tests are just plain wrong and get "interesting" results; ironically, you get the less "popular" mistake:

In reality, if you ONLY check for this subset of the model family the way FOCAL does, you first of all have to rule out it is a PDP-12. No problem because the 8/L is never a PDP-12. So far so good.

But by that simplest check, all you can REALLY say is this is probably a PDP-8/I OR it is probably an 8/L and you really cannot claim to know.

On the real PDP-8/I in 1969, in-house DEC systems were generally well-maintained. In the real world, memory timing was more dubious, especially when DEC had many vendor problems That's why ALL of the PDP-8/L and PDP-12 are slower. In MANY of the PDP-8/I systems, the system may have been slightly slowed down.

Assuming an ASR 33 console, this bad FOCAL ID code used the done flag of the teletype output as a primitive clock and it was hand-tweaked to hopefully tell the difference between machines that are nominally 1.5 versus nominally 1.6.

Unfortunately, in many cases, this backfires and declares many of them as PDP-8/L.

In your case, I assume your machine timing managed to look more like a faster 8.I so you got that [but you were expecting it. My point is you just as well might have gotten PDP-8/L/

As time passed, this actually deteriorated: A sold upgrade for the PDP-8/E was an LA30P interface and some machines were set for 300 baud terminals such as the LA-36.

Either way, you will ALWAYS get 8/L in any of these situations, etc.

But I have a fix for the entire problem [in the Kermit-12 code or better the upgraded version linked to above].

The PDP-8/L is an odd beast. Since it can never have the EAE option, it bothers to totally inhibit the group III OPR instructions.

But this is not synonymous with lacking EAE. Here's the subtle difference:

On the 8/I 7000 is a NOP, so is 7400 and so is 7401. Bur on the 8/L, it is a "different" kind of NOP [no net change in outcome, but the timing is different] so far, so what.

But now do the same for CLA.

7200 is CLA and so is 7600. But on all models OTHER THAN the PDP-8/L 7601 is CLEAR THE AC. On the 8/L it is a NOP and that can be exploited. [See the code above for all the details].

Thus, the Kermit etc. code never screws up. And it adds in the checks for machines newer than FOCAL [which we will excuse it for.]

One thing is totally inexcusable is FOCAL-8. It removes all the model checks AND it is sabotaged ! If found to be running on a DCC-112 competitor machine, FOCAL is made to self-destruct in a nasty way that at a glance suggests a hardware problem.

A very important issue in the FOCAL world is "binary compatibility" for many user-supplied absolute binary patches. FOCAL-8 just throws that away!

Apparently, there was a never-released follow-on to FOCAL, 1969 that didn't work with all of the standard other option packages, so it was shelved.

However, that code was given to Lenny Elekman who modified it into FOCAL12 for DIAL-MS.

I had the source code and studied what was different [other than the obvious PDP-12 part].

Long story short, there is a need for a one word add in the "FOR" command code to fix an obscure bug. Thus, FOCAL-12 has that bug fixed, etc.

Later, this same code was also handed to a newbie, and I "obtained" a very early copy of what he was just starting to trash. It was actually only meaningless lines of comments different from FOCAL, 1969. [Note: I don't really mean lines of comments, I mean comments that were just lines, as in lines of - or lines of * only, etc. to delineate sections. I think he was just trying to superficially understand portions and used that as his personal added "guide" etc.

Long story short, two things that matter happened:

1) You can get the 100% accurate [including comments] source listing of FOCAL, 1969 in a directory nearby the one linked to above.

http://www.ibiblio.org/pub/academic/computer-science/history/pdp-8/FOCL69%20Files/FOCAL69.pdf

2) I implemented the fix in P?S/8 FOCAL and MAINTAIN binary compatibility.

This comes at a small price: the patched version will not run on a PDP-5 or a PDP-8/S.

[Note: As is the case with OS/8, P?S/8 is family of 8 only, so this is moot.]

That patch could be extracted out from P?S/8 FOCAL [1969 with patches].

P?S/8 FOCAL doesn't use the initial dialogue at all because the questions about preserving functions are compressed down to command-line switch options to cover all cases [including one that is not available in the released, FOCAL, 1969 which is what if you want the EXP LOG etc. package but you do not want the SIN/COS. In the paper-tape version, there was no room to implement that extra dialogue, so it was left out. Since I don't use the dialogue I just follow any variation on the two command switches, etc. It's just trivial code relocation, etc.

Thus, I would strongly recommend sticking with FOCAL 1969 and avoiding FOCAL-71, aka "FOCAL-8"..

To make matters much more confusing, the CORRECT manual for FOCAL, 1969 says "FOCAL-8" on the cover!

http://www.ibiblio.org/pub/academic/computer-science/history/pdp-8/FOCL69%20Files/DEC-08-AJAD-D.pdf

cjl
0 new messages