Well, I finally got my blinkenlights working to the tune of the teletype machine. Oscar Vermeulen pointed me to the correct value to change in the simh code. The SERIAL_OUT_WAIT value in simh_defs.h needed to be increased from the default of 100 to  20000. Now the accumulator LEDs seem to blink correctly.

UPDATE: After doing some research on SERIAL_OUT_WAIT, I found that it is also used in the lp, pt, and ttx drivers. That means that, for instance, punching a simulated paper tape will also be at 110 baud. Clearly, that is not what we want. So, I changed the SERIAL_OUT_WAIT back to 100 and added a new constant – TTO_WAIT –  to pdp8_defs.h, and set it to 20000. Then in pdp8_tt.c, changed the SERIAL_OUT_WAIT in the tto_unit structure to TTO_WAIT. Now, only the console runs at 110 baud.

I also found out that this value does not guarantee a fixed wait time – just a minimum. It assigns this wait time to the tto_unit when it is added to the simh processing queue to output one character. Anything in the queue ahead of it will get processed first. This is very noticeable in my “Blinkenlights1” video during the init message, and also at the end of the directory listing.
This mod brings with it an unforeseen benefit. I can now actually stop the directory listing with a Control-C. Before, the whole directory listing would get buffered up, and had to be printed out before the Control-C was even recognized.

PiDP-8 – The Teletype Connexion

IMG_0207For a Model 33 Teletype machine to be used with the PiDP-8 as a console device, a few things need to be done (this also applies generally to simh/PDP-8):

  • You need a current loop to RS-232 converter (self-powered).
  • If not using the PiDP-8 serial port, you need a USB to RS-232 adapter that will work at 110 baud.
  • For proper “PDP-8” operation, you need to strap the Model 33 for MARK parity. This is covered in the Teletype documentation which is available online.
  • In simh, you need to “set TTI 8B” and “set console serial=<device>;110-8n2”, where <device> is either the actual device, e.g., /dev/ttyUSB0, or the simh serial device, e.g., ser0.
  • You need to ensure that the OS/8 KL8E device handler is compiled with “emulate tab” support. (Tabs on the teletype are not supported.)
  • If a Model 33 ASR using the paper tape reader, you need to modify the Low Speed Paper Tape device handler to increase the between-byte timeout.



PiDP-8 Edit, Assemble, & Run

I finally got up enough gumption to sit down at my trusty ASR-33 to type in a program, assemble it, and run it. I used the sample program – A Sample Editing Job – from DEC’s OS/8 System Reference Manual, chapter 4 (The Symbolic Editor).  In this section, the reader is instructed to type in the sample program (prints out “HELLO!”), edit the program to correct errors, assemble the program using PAL, and finally run the program. The program text contains some errors that will be corrected later after all the text is entered. Well, after just 22 minutes, I saw “HELLO!” on my teletype. Typing in the code wasn’t too bad, but took the most time. My first attempt at editing ended prematurely with a Control-C (Quit) due to my frustration over my extreme unfamiliarity with the editor. My second attempt fixed all the errors, but took much longer than it should have, once again due to my unfamiliarity with Edit. The 22 minute computing session has been compressed to just over 8 minutes in the following video:

Hello World

Hello World 3 Ways – BASIC, PAL Assembler, Paper Tape

The first program anybody writes and runs on a computer is “Hello World”. My PiDP-8 was no exception. The quickest “Hello World” is to get Basic running, type it in, and run it. So I did. That was easy.

After “Hello World”, I loaded “Eliza” which I had retro-modified to run on simh/PDP-8 while I was waiting for my PiDP-8 to arrive. The version I started with was from Big Computer Games published in 1984. Most of the string handling routines had to be modified because OS/8 Basic has very limited string handling routines. I did my editing in Textwrangler on my Mac and cut and pasted it into the PDP-8 terminal. I finally got it running the way it should. After I got my PiDP-8, I transferred it to the PiDP-8 using Filezilla and loaded it as a paper tape using the simh PTR. I was finally starting to see how the computer users of 50 years ago had to wait for, it seemed, an eternity just to see the program header print on the teletype. But Eliza, the Psychotherapist, asked all the pertinent questions. Trying to type an answer on the teletype keys was a chore, to say the least. You need to punch the keys down solidly and slowly for everything to be typed correctly.


Next to be edited, compiled, and run was a PDP-8 PAL Assembler version of “Hello World”. I copied a version that is freely available from a number of places on the web. I “cheated” again and edited on my Mac. (One of these days when I have enough time, I need to learn OS/8 Edit or TECO to edit my source code.) I also used a version of Palbart, a PAL-compatible cross-assembler, on my Mac to compile the source code into a PDP-8 .BN file. (A PDP-8 .BN file is actually a paper tape formatted binary file, whether it is on a disk or paper tape.) Once again, I transferred the .BN file to the PiDP-8 using Filezilla. I successfully ran the program, then punched a paper tape binary using PIP. Then I read the paper tape back in and ran the program again. It all worked!!

The next “Hello World” I wrote is a version of a BANNER program that I know was in the DECUS library, but I couldn’t find the source code anywhere. I based my version on “verbum.c” written by Eric L.Smith, however PAL assembly language looks nothing like C. So, this was my first real attempt at PAL programming. It’s not really a “Hello World” program, per se, but it punches human-readable text on the paper tape. After the program was successfully compiled and transferred, I started up the program, typed in HELLO WORLD, hit return, and a paper tape with HELLO WORLD printed in 5X7 dot-matrix characters was punched.

PiDP-8 + Model 33 ASR

IMG_0190Last fall, during my web surfing, I stumbled across blog about a re-creation of the venerable DEC PDP-8 – the first widely-available minicomputer. Oscar Vermeulen (Obsolescence Guaranteed) had made a Rasperry pi-based, functionally compatible version of a PDP-8, including an operational front panel. He was offering it as a kit. I had to get one.

I had missed out on the early days of computing. I didn’t get my first computer until 1977 – a SWTP 6800 kit, with 8K of RAM, cassette tape program storage, and a CT-64 video display terminal. I built it, troubleshot solder whiskers between the RAM card printed wiring traces, fiddled with 4K Basic and Motorola 6800 assembly language loaded at 300 bps from cassette tape, decoded and displayed RTTY HF newsfeeds, and typed in and played Basic “Star Wars”. That was fun, and the start of my computer self-education.

But, before that, the PDP-8 started the revolution, although unaffordable by the hobbyist. It didn’t have a video display terminal. It used a teletype machine – a 110 baud electromechanical typewriter, historically used to send message traffic around the world via telegraph circuits and HF radio. I wanted to get back to the roots of personal computing. That meant I needed to get a PiDP-8 AND an accompanying teletype machine for I/O.

I bought a Model 33 KSR with acoustic coupler and brought it back to life, but soon realized that although the KSR was fine as a terminal, something was missing. In the early days, even before magnetic tape and floppy disks, program storage was on paper tape. I needed to experience punching and reading the original computer storage medium. So I bought a Model 33 ASR and without too much trouble got it running. And I’m now having fun playing with PDP-8 assembly language, 4K Basic, OS/8, and simply learning what it was like to operate a PDP-8 “back in the day.” The whirr of the teletype’s motor, the heavy feel of the ancient keyboard, the clatter of the typewheel striking the paper, watching the bits punched into the paper tape fly by as “hello world” is loaded into the computer – all contribute to an unequalled experience, along with the PiDP-8’s “blinkenlights” front panel where you can actually program the computer using the front panel switches and see the result displayed in an octal format.