Skip to main content

Raymii.org Logo (IEC resistor symbol)logo

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

Running Adventure on the DEC PDP-8 with SIMH

Published: 23-07-2015 | Author: Remy van Elst | Text only version of this article


Table of Contents


pdp-8

In this guide I'll show you how run the classic Colossal Cave Adventure game ona PDP-8, emulated by the SIMH emulator. The PDP-8 was an 12 bit minicomputermade in 1964 by DEC, the Digital Equipment Corporation. We will install and setup SIMH, the emulator with a RK05 diskimage running OS/8. We will use FORTRAN onOS/8 to load ADVENTURE, then we use our brain to play the game. As a bonus, Ialso show you how to edit files using EDIT, and show you a bit of the OS/8system.

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)

Introduction

I've recently accuired a PDP-8 remake, the PiDP-8/i by Oscar Vermeulen.This beautiful piece of hand made hardware uses a Raspberry Pi to emulate aPDP-8 with SIMH. The front panel actually works, you can use the switched toload paper tapes, the RIM and BIN loader and all the other legacy goodness. Itis a bit smaller than a real PDP-8, it is scale 2:3. The real PDP-8 has 1.5 cmswitched, the PiDP-8 has 1.0 cm switches.

I have an interest in legacy systems like the PDP-11, VAX/VMS and othermainframes and minicomputers. The PiDP-8/i allows me to have a small piece ofthis legacy myself. It also motivated me to learn more about the PDP-8 and it'shard and software. It also inspired me to write this article about it. Sincethese systems are way older than me, emulation and recreation are the only wayfor me to use them, sadly.

I really encourage you to check out the PiDP-8. Order one as well, you caneither get a kit to construct yourself, or order an assembled version. Supportthis beautiful piece of work!

pidp-8

SIMH is an emulator which not only emulates a PDP-8, but a lot more oldermainframes and minicomputers. See the website for more information aboutSIMH.

This guide shows you how to run the classic Colossal Cave ADVENTURE game on anemulated PDP-8 with SIMH. We will use Ubuntu 14.04 as our host operating system,but any OS that runs SIMH will do.

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)

Colossal Cave was written by Willie Crowther and quickly became one of the mostpopular games of that time. Because it was written in FORTRAN it was ported tovarious machines, even to the IBM-PC and the Apple II.

The PDP-8 can run plain paper tapes with software, but later in it's lifetime itgot access to magnetic disks and therefore is able to run actual operatingsystems. The ADVENTURE game runs, via FORTRAN, on the OS/8 operating system forthe PDP-8. Wikipedia has more information on OS/8, that is a veryinteresting read.

pdp-11

We will use a disk image graciously provided by Rick Murphy with both OS/8 andthe adventure program already compiled in it. You can download it from RickMurphy's website(direct link to the rk5) or from here. This is adisk image in the RK05 DECpak disk format. The RK05 is a moving headmagnetic disk drive approximately 2.5 MB on a 14", single-platter IBM-2315-stylefront-loading removable disk cartridge.

RK05

Installing and configuring SIMH

First create a folder where you will store the disk image and the configurationfiles, and go in that folder:

mkdir pdp8cd pdp8

Ubuntu, and many other operating systems, have packages available for SIMH. Wecan use the built in package manager to install simh:

apt-get install simh

If your distro doesn't have simh, see their website for installationinstructions.

Download the prepared disk image:

wget https://raymii.org/s/inc/downloads/pdp/advent.rk05

To make the start up proces easier you can set up an 'pdp8.ini' file with a fewcommands in it. SIMH will load and run these commands at startup if you executethe pdp8 command.

Our pdp8.ini file has the following in it:

set cpu 32Kset cpu idleattach rk0 advent.rk05boot rk0exit

First it sets up the CPU. Then it attached the advent.rk05 file as the firstdisk and finally it boots up from that attached disk.

Do note that you don't need to create this file, you can also enter thesecommands manually at the simh prompt.

Running the PDP-8

In the current folder, execute the following command to start up simh with ourconfiguration file:

pdp8

If all goes well, you should see something like below:

$ pdp8PDP-8 simulator V3.8-1.

Some distributions, like Arch name the command simh-pdp8. It does the samething.

Congratiulations, you are now in a 1960's era operating system. Look around abit, for example, execute the DIR command:

.DIRDIRECT.SV   7            FRTS  .SV  26            BASIC .WS  11PIP   .SV  11            PASS2 .SV  20            SET   .SV  20FOTP  .SV   8            PASS2O.SV   5            RTFLOP.SV  15[...]BRTS  .SV  15            LCSYS .BI   3            ADVENT.LD 145F4    .SV  20            UCSYS .BI   3            LOAD  .LS   8 162 FILES IN 2648 BLOCKS -  544 FREE BLOCKS

You can get help at any moment using the HELP command:

.HELP<[?3L[?4L[?5L[?5LHJ\OS/8 MONITOR COMMANDSCMD     PROG    EXPLASSIGN  KBM     ASSIGNS LOGICAL NAMEBACKSP  CAMP    BACKSPACES DEVBASIC   BASIC   ENTERS BASIC SYSTEMBOOT    BOOT    BOOTSTRAPS TO DEVCCL     CCL     DISABLES CCLCOMPARE SRCCOM  COMPARES FILESCOMPILE PAL8    COMPILES PROG    F4/FORT    BASIC    RALF    SABRCOPY    FOTP     COPIES FILESCREATE  EDIT     OPENS FILE FOR EDITING[...]#NNN    TAKE INTERNAL OCTAL FORM OF FILENAME@FILE   REPLACE IN CMD LINE BY FILE'S CONTENTS$       COMPLEMENT DEFAULT ALTMODE SWITCH

Editing files on OS/8 with EDIT

If you just want to run adventure, skip this section.

You can edit a file for example, using a LINE EDITOR. First create the file, inthis example, A.PA.

.CREATE A.PA#

You can edit files with the EDIT command later on.

Your prompt changes from a . to a #. If this is an existing file, you mustread the first page into the buffer by typing

#R

To insert text at the top of the buffer, use I. To append to the end, use A.

#ITHIS IS A TEST

Press CTRL+L to exit the edit prompt.

You can start inserting before any line by typing $nI where $n is the linenumber (which is never displayed). For example, to insert a line before line 20,use 20I.

The L command lists the current buffer:

#LTHIS IS A TEST

5L displays line 5 and 1,5L displays lines 1 through 5. . indicates thecurrent line. If you type .L the current line is displayed.

To delete a line, use $nD where $n is . or a line number. To change a lineuse $nC where $n is . or a line number. It deletes the line indicated by$n, then waits for you to type in a replacement.

As said, EDIT reads a page from disk into the buffer. When you are done withthat page and ready to move to the next type N. This writes the existing pageto the output file (P command), clears the buffer (K command), and reads thenext page from the input file (R command). You can use the P, K, and Rcommands individually, but be careful. Doing these commands out of sequence canmess up your file.

When you are done editing, use the E command to exit. This will write thecurrent buffer to the output file, then copy all remaining pages from the inputto the output file if you aren't already on the last page.

#E

You can use the TYPE command to see the contents of a file:

.TYPE A.PATHIS IS A TEST

See this page for a detailed guide on using PDP-8 EDIT.

Running Adventure

To run Adventure we first need to run the FORTRAN environment. Start it up withthe following command R FRTS:

.R FRTS*

Your prompt changes to a *. The HELP command explains what the R commanddoes:

R   KBM   RUNS PROGRAM FROM SYS:

Tell the FORTRAN system we want to load Adventure with the following command,ADVENT.LD:

*ADVENT.LD

Press the ESCAPE key on your keyboard to start the execution. Below you'll findthe full sequence of commands plus some ADVENTURE output:

$ pdp8PDP-8 simulator V3.8-1.R FRTS*ADVENT*$WELCOME TO ADVENTURE!!  WOULD YOU LIKE INSTRUCTIONS? > NOYOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING. AROUND YOU IS A FOREST.  A SMALL STREAM FLOWS OUT OF THE BUILDING ANDDOWN A GULLY.> ENTER YOU ARE INSIDE A BUILDING, A WELL HOUSE FOR A LARGE SPRING.THERE ARE SOME KEYS ON THE GROUND HERE.THERE IS A SHINY BRASS LAMP NEARBY.THERE IS FOOD HERE.THERE IS A BOTTLE OF WATER HERE. > TAKE LAMPTAKEN. > 

To exit SIMH and the PDP-8, press CTRL+E. SIMH will stop and you will be backat your command prompt.

You can view some more help on the PDP-8 SIMH version by executing (in OS/8) thefollowing command:

.TYPE ADVENT.DC

Enjoy!

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