SIMH PDP-8: Manually Loading the RIM Loader, the Binary Loader, and an Application from Paper Tape

(all PDP-8 blog entries can be seen by clicking here)

In my blog entry

Assembling/Compiling to SIMH PDP-8 Paper Tape and Executing the Paper Tape Program

I loaded the Hello World test program into memory automatically using SIMH’s load command rather than emulating all of the futzing around one would really do on a PDP-8 to really load a program from paper tape.

In this, my final installation of using the PDP-8 emulator, I will show you how to do the entire process manually, pretty near to what one would have had to do on a real PDP-8.

We will be using the Hello World program, prog3.bin, that was written in the prior blog entry.

I figured this procedure out by reading the book “Introduction to Programming” which can be googled as IntroToProgramming1969.pdf.

When you turn a PDP-8 on, the memory is randomly set and there is no ROM memory to get things bootstrapped like there would be on any even near-modern computer. Instead, you had to enter your boot strap program by hand into memory using the PDP-8 switch register.

To enter the instruction 6014 at address 7756, first you would set the switch register to 111 111 101 110 and then transfer that into the program counter. Then you would set the switch register to  110 000 001 100 and deposit that into memory. That would get one instruction encoded. The boot strap program is  small, but this is still a painfully slow process (and there is no room for mistakes).

This painfully slow process is what we are going to emulate.

The ‘boot strap’ program for the PDP-8 is called the RIM loader. This tiny program can load programs in RIM format from the paper tape reader.

Generally the only thing the RIM loader is used for is to load the larger BIN loader which can read files in BIN format from the paper tape reader. The BIN loader is a much longer program and so you really don’t want to load that using the switch register.

Once the BIN loader is in memory, you would use that to load your own application from paper tape. The RIM and BIN loaders are in high memory, and normally not overwritten. Once you load them you don’t have to do so again until the computer is shut off or your application over writes them.

 Step 1: Load the RIM Loader

In SIMH, we don’t have a switch register to enter instructions into memory. Instead we use the deposit command. We will start ‘depositing’ the RIM loader at memory location 7756. This is done with the slightly easier to use deposit (d) command:

d 7756 6014
d 7757 6011
d 7760 5357
d 7761 6016
d 7762 7106
d 7763 7006
d 7764 7510
d 7765 5357
d 7766 7006
d 7767 6011
d 7770 5367
d 7771 6016
d 7772 7420
d 7773 3776
d 7774 3376
d 7775 5357
d 7776 0
d 7777 0

Just copy and paste those commands into SIMH. You can then see the instructions you deposited using the examine (e) command:

sim> e -m 7756-7777
7756:   RFC
7757:   RSF
7760:   JMP 7757
7761:   RFC RRB
7762:   CLL RTL
7763:   RTL
7764:   SPA
7765:   JMP 7757
7766:   RTL
7767:   RSF
7770:   JMP 7767
7771:   RFC RRB
7772:   SNL
7773:   DCA I 7776
7774:   DCA 7776
7775:   JMP 7757
7776:   AND 0
7777:   AND 0

Step 2: Load the Binary Loader

You can get the binary loader from this location. Download it, place in your PDP-8 directory and rename to something simpler like loader.bin.

Now attach the binary loader file to the paper tape reader:

sim> attach ptr loader.bin

Load the binary loader using the RIM loader:

sim> go 7756
<<press control-E>> to halt the CPU
Simulation stopped, PC: 07760 (JMP 7757)

The binary loader is now in memory.

Step 3: Load your application using the binary loader:

Set the switch register to 3777 and attach your application’s bin file to the paper tape reader. I am using the Hello World application written in a prior blog entry which is in the file prog3.bin

sim> deposit sr 3777
sim> attach ptr prog3.bin

To load from the tape reader, start execution of the binary loader at memory location 7777:

sim> go 7777

HALT instruction, PC: 07701 (KCC)

The Hello World Application is now loaded into memory, starting at location 200 (because that is where we told the assembler to place it).

To run the application program, we start execution with memory location 200:

sim> run 200
HALT instruction, PC: 00210 (JMS 212)

Pretty cool, huh! Of course it would have been a lot cooler if I had a real PDP-8, could toggle in the RIM loader and a real paper tape reader to read paper tape with, but I’ll make do with what I have.


This entry was posted in c-retro and tagged . Bookmark the permalink.

5 Responses to SIMH PDP-8: Manually Loading the RIM Loader, the Binary Loader, and an Application from Paper Tape

  1. Rick Rutt says:

    Very nice series on the PDP-8. I was able to spend a small amount of time on some actual PDP-8 machines in a chemistry laboratory instrumentation course as Michigan State University in the mid 1970’s. I was a Computer Science senior, but I took the chemistry graduate course as an elective so I can get my hands on some real computer hardware sitting in front of me.

    At that time our software courses all involved terminal based access to a CDC-6500 scientific mainframe. We weren’t allowed in the data center that housed the actual computer.

    The PDP-8 machines in the chemistry lab had DECtapes and diskette drives running the OS/8 operating system used in most of your articles on the PDP-8. Since I wanted to declare myself a “real programmer”, I made myself go thru the full exercise of toggling the front panel switches to enter the RIM loader, loading a precious paper tape copy of the BIN loader, then loading more paper tapes for a FORTRAN-II compiler.

    Then I ran the FORTRAN compiler and had it read in a source code paper tape. Then I mounted a blank paper tape roll into the paper tape punch, and told the compiler to output the compiled binary code.

    Both the RIM and BIN loaders remained in the high memory addresses, which other software NEVER overwrote. So next I loaded the FORTRAN run-time program to replace the compiler, told it to read the compiled binary paper tape, and then run my program.

    I only did this tedious cycle once or twice, just so I could “brag” about it to this day.
    Us programmers must have a masochism gene somewhere in our DNA.

  2. Dan – you might be interested in the PiDP-8 – a PDP-8 replica built around a Raspberry Pi (using SIMH). I just got and built mine, and am in the process of repeating some of the experiments on your blog using my new toy. See!pidp-8/cbie

    • Dan TheMan says:

      That is very cool. I’ve been eying the MITS Altair 8800 clone too🙂

      • Yeah, I’ve also been looking at the Altair clone. It’s pretty pricey, though, and the cabinet is awfully large. I like the PiDP-8’s compact size and low price. The Altair clone’s ability to “read” cassette’s from MP3 files is very appealing.

  3. Kevin Szabo says:

    Dan, thanks for this. I am old enough to have entered those commands into both a straight-8 (original transistorized PDP8) and PDP-8L (and maybe other 8s that I have forgot). I just want to put in one little correction … the memory does not come up randomly. This is the beauty of core memory; the contents are preserved over power-down. If programs are well-behaved the RIM loader (or the improved loader, I think BIN?) would remain in memory for days or weeks. It was only after an errant program clobbered the memory locations that held the loaders that you had to re-key them in. Let me tell you, toggling in the RIM loader gets really old really fast.🙂

    Cheers, Kevin

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s