Skip to main content

Raymii.org Logo (IEC resistor symbol)logo

Quis custodiet ipsos custodes?
Home | About | All pages | RSS Feed | Gopher

Toggling in a simple program DEC PDP-8 and PiDP-8 using the switch register

Published: 08-06-2016 | Author: Remy van Elst | Text only version of this article


Table of Contents


pdp-8

In this guide I'll show you how to toggle in a simple program on the DEC PDP-8or the PiDP-8, or in a front-panel simulator named BlinkenBone if you lack thehardware. I have a replica of the PDP-8/I (the PiDP-8) but lacked the actualknowledge on the front panel and switches to get started and do something cool.This guide has step by step instructons, with pictures, and basic explanation.After all, what is an expensive blinking light panel without fun stuff to togglein?

As you might know, I'm a fan of the PDP line of computers and legacy systems ingeneral. Mainframes, homecomputers, you name it and I probably like it. Addflashing lights, panels and big controls to it and you have my attention in notime.

Plus, in previous jobs I've worked on mainframes, VAX and PDP systems and theemulators used to keep those systems running on modern hardware. Thinkhospitals, banks, insurance companies, train signalling control and the likes.So, the interest did not spawn from nowhere.

Oscar Vermeulen created an amazing replica of the PDP-8/I. It's a frontpanel with working switches and LED's, plus a simple Raspberry Pi running theSIMH emulator. I've written multiple articles on the PDP and PiDP-8and I like the device a lot in general.

If you like this article, consider sponsoring me by trying out a Digital OceanVPS. With this link you'll get $100 credit for 60 days). (referral link)

Backstory

I did however only use the serial console and SSH to control the PDP-8 computer.Since I'm managing a lot of Linux/UNIX systems that's what I'm familiar with.But, the PiDP-8 (and the PDP-8/I) has a front panel with switches and lights.The lights show the different parts of the system, like the memory, programcounter and contents of the registers and the switches allow you to manuallycontrol all those aspects.

There is little documentation on using those switches, except for the excellentmanuals from DEC. No simple, get started using the switches guide. This pageaims to solve that by showing you, step by step, how to toggle in a very, verysimple program, by hand. What it does? It manually moves a bit through theAccumulator lamps.

I found the program and tutorial on this page, it is from the BlinkenBoneauthor. This page is based on that, but hopefully, geared more to new users.

This guide covers the BlinkenBone panel simulator, explains the Switches,explains the Lamps (Register Indicators), explains the program and then startswith the step by step guide to toggle that in.

BlinkenBone

BlinkenBone is another super nice project which provides the front panels ofvarious PDP computers as a JAVA based GUI and backend server. It describesitself as an architecture to connect simulators of vintage computers with"Blinkenlight panels".

If you don't have a PDP-8 or PiDP-8 replica, you can use BlinkenBone to still beable to use the front panel of such an actual machine. This page has a lotof very detailed information on the PDP-8/I and it's front panel. It is a verygood read.

pdp

The above picture is a screenshot of BlinkenBone running on my machine showingthe PDP-8/I front panel while running Adventure. I have the luck of having anactual replica, the PiDP-8, but for those without one, this is an excellentalternative.

Read this page for installation instructions on BlinkenBone. It is Javasoftware, so it runs on Windows, Mac and Linux. There is also a specialRaspberry Pi version. Installation is very easy, download the archive, extractit and run the starting script.

BlinkenBone also has a few other simulated panels, for example for thePDP-11/70, PDP-10 KI10 and a PDP-11/20. Please make some time to play with thosesince it's awesome.

Jorg Hoppe, behind the BlinkenBone, noted that it is an excellent idea and agreat experience to run the BlinkenBone software on a large touchscreen.Quoting, "Operating the panel in original size on a 23 inch screen with yourfingers is absolutely worth the extra $$$. (I use an Acer 232TL under Win10).".I did try it myself on a small Asus Transformer tablet running Windows 10, 10inch, and even that is a very nice experience.

Switches and Lamps

pdp

An actual PDP-8/I front panel.

I'll use the term PDP-8 further on in the tutorial, but by that I also mean thePiDP-8 or the BlinkenBone GUI.

The below sections cover the functions of the switches and the lamps. Skip overit if you just want to start toggling.

Front Panel switches

The front panel of the PDP-8/I has 26 switches. From left to right, the firstthree control the Data Field (DF). DF determines the core memory field of datastorage and retrieval.

pdp

The second three control the Instruction Field (IF). IF determines the corememory field from which instructions are to be taken.

pdp

The third, fourth, fifth and sixth pair of switches control the SwitchRegister (SR). The Switch Register provides a means of manually setting a12-bit word and load that into the PC (program counter) by pressing the LoadAdd key or load the content into the MB (Memory Buffer) and core memory withthe Dep key.

pdp

The last switches are, from left to right, in order the following.

Register Indicators Lamps

The Lamps are called Register Indicators. These are also explained below, fromtop to bottom.

pdp

pdp

pdp

pdp

pdp

Major state indicators

pdp

These lamps indicate that the processor is currently performing or has performedsuch a cycle. Fetch for example indicates that the processor is currentlyperforming or has performed a Fetch cycle.

Miscellaneous indicators

pdp

Instruction indicators

pdp

These lamps indicate that the processor is currently performing or has performedsuch an instruction. For example, And indicates that the processor iscurrently performing or has performed an And instruction.

The above sections were slightly adapted from this page.

The program to blink lamps

The program we are going to toggle in is a very simple program. It sets a bit inthe accumulator and HALT's. When we, the user, press the Cont switch, itshifts the bit to the left in the AC, and so on.

We are going to use an assembler to assemble the assembly code into binary. Inthis case we are using palbart. You can download palbart here and readmore on it here. In case the download site ever goes down, I've mirroredthe C code here and the linux executable here.

Below you can find the assembler code of the program:

/ shifter - manually move a bit through the Accumulator lamps*100                    / start addr        CLA CLL IAC     / Link=AC=0, AC++. AC now 1LOOP,        RAL             / rotate the bit left through AC and Link        HLT             / wait for user to CONTinue        JMP     LOOP    / again$

There are comments in the code, and if you want to read more about the PDP-8assembly instruction set on this page named "What is the PDP-8 instructionset?". By reading that you understand the code above a bit more.

Make sure you have downloaded palbart. Save the above code, for example in afile named shifter.pal. Then run it through the assembler:

chmod +x ./palbart ./palbart shifter.pal

A file "shifter.lst" is produced:

/ shifter - manually move a bit through the Accumulator lamps        Page 1    1              / shifter - manually move a bit through the Accumulator lamps    2                  3        0100  *100                    / start addr    4 00100  7301          CLA CLL IAC     / Link=AC=0, AC++. AC now 1    5              LOOP,    6 00101  7004          RAL             / rotate the bit left through AC and Link    7 00102  7402          HLT             / wait for user to CONTinue    8 00103  5101          JMP     LOOP    / again    9                 10              $      No detected errors      No links generated

The first collumn represents the Address and the second column represents the(binary) Contents of that register.

Step by step

If you like this article, consider sponsoring me by trying out a Digital OceanVPS. With this link you'll get a $5 VPS for 2 months free (as in, you get $10credit). (referral link)

So, we have the memory addresses and the data, but how do we toggle that in?Start by firing up your PiDP-8, PDP or start up the BlinkenBone.

After downloading and extracting BlinkenBone, navigate to that folder and, onUbuntu, start the prepare.sh script to install dependencies:

sudo bash prepare.sh

On other distro's, install java and rpcbind.

Start the PDP-8 with the ADVENT disk coupled:

sudo bash pdp8i_os8advent.sh

A Java window with the front panel opens, and the terminal starts up the SIMHemulator. Wait a few moments until it is finished. The terminal shows thefollowing:

WELCOME TO ADVENTURE!!  WOULD YOU LIKE INSTRUCTIONS? > 

Above is a video of a screen recording showing the front panel while ADVENT isrunning. If it's not loading, view it on Youtube.

Toggle!

Now on the panel (PDP-8, PiDP-8 or emulator) toggle the Stop switch. Bytoggle, I mean, push it so that it changes state and push it again so that thestate is back as it was before the first toggle.

After toggling the Stop switch, the Lamps should stop moving. We've stoppedthe execution of ADVENT and OS/8.

The Switch Register switches are Octal. In this case that means that theyrepresent 0 to 7 (8 possibilities). From left to right, a pair of three switchesrepresent the values 4, 2 and 1. If you toggle the rightmost switch, itcontain the value 1. If you toggle the middle switch and the rightmost switch,it will contain the value 3 and so on. Below is a picture to make it moreclear:

pdp

Do note that the Dep switch is in the oposite position. In the pictures belowit looks like it's always toggled, and that is the case, so don't worry.

After we toggled the STOP switch, we can start toggling in the program. Thefirst thing we do is toggle in the value 100 and then toggle the Load Addswitch to set the start address in the PC (program counter):

pdp

The octal value 100 is represented by the switch positions 000 001 000 000.

The second instruction we toggle in is 7301 (Link=AC=0, AC++. AC now 1). Theoctal value on the switches it: 111 011 000 001. Do note not to toggle theLoad Add switch, but the Dep switch. I made that mistake a few times atfirst. We are not loading that address, but we are depositing the value in theaddress we loaded earlier. Below is a picture:

pdp

The third instruction we toggle in is 7004 (rotate the bit left through AC andLink). The octal value is: 111 000 000 100. Picture below:

pdp

The fourth instruction is 7402 (wait for user to CONTinue). The octal valueis: 111 100 000 010. Picture below:

pdp

The fifth instruction is 5101 (JMP to LOOP, start over). The octal value is:101 001 000 001. Picture below:

pdp

The sixth instruction we are toggling in is the same as the first, 0100. Togglethe Load Add switch to set the start address in the PC (program counter):

pdp

Now the program is in the memory of the PDP. By toggling in 0100 and thenloading that address, we make sure that when we toggle START, the PDP startsexecution there.

So, the next thing to do is toggle the START switch. What happens is that theon the Accumulator lamp row, all lamps turn of and one lights up. Then nothinghappens. Toggle the Cont switch, then the Lamp turns off and the Lamp left ofit lights on. See the three examples below:

pdp

pdp

pdp

The basic flow is: set a bit, then start the loop which shifts that bit, thenhalts until the user toggles the continue switch.

Here below is a recording showing the emulator running this program:

If it's not loading, view it on Youtube here.

That's all there is. I hope you have enjoyed this guide and enjoyed playing withthe PDP-8.

If you like this article, consider sponsoring me by trying out a Digital OceanVPS. With this link you'll get a $5 VPS for 2 months free (as in, you get $10credit). (referral link)

Tags: adventure, articles, dec, fortran, os-8, pdp, pdp-8, pidp8, simh