Simulated PDP-11/20 running Papertape BASIC

Parent Category: Projects Category: BlinkenBone panel simulations Written by Administrator


The PDP-11/20 BlinkenBone GitHub distribution automatically boots into the DEC "Papertape-BASIC" from a simulated high-speed papertape reader.

The simulated PDP-11/20 is quite minimalistic: the system consists just of a PC05 highspeed papertape reader/puncher, and an ASR33 teletype.

papertape dec PDP 11 basic

Booting into Papertape BASIC

Booting a SimH PDP-11 from papertape is a complicated process, but is performed automatically in the SimH ini-script.

  1. the papertape bootloader is already "deposit"ed into memory.
  2. the absolute loader and the BASIC are "punched" one after another to the same papertape file "absloader+basic.ptap"; and that strip is attached to the SimH reader device "PTR".
  3. the bootloader is started. It reads in the absolute loader from tape and starts him.
  4. the absolute loader HALTs at address 157500 and waits for the next tape to be inserted.
    Since this already on the same strip (=file), a simple CONT is issued.
  5. the absolute loader loads in the BASIC. After success, it is started.

See http://www.avitech.com.au/ptb/ptb.html for more details, this page is very good !

papertape dec absolute loader

 

Using the Papertape BASIC

First of all: the manual is in the attachement, see below.

The Basic interpreter is delivered on a papertape strip with ID code "DEC-11-AJPB-D". It can run on a PDP-11 with just 4K of memory, and runs standalone without any operating system.

Therefore there are some limitations:


After start the prompt "*O" is shown. This means you can decide what additional options you want to load. A simple "ENTER" chooses all options and all memory to be used.

Primes

To keep the Blinkenlights busy, this BASIC program can be run.

10 REM PRIMES.BAS: PROGRAM TO CALCULATE PRIME NUMBERS
20 PRINT "LIMIT";
30 INPUT L
40 PRINT 2;
50 REM TEST ONLY ODD NUMBERS N
60 FOR N = 3 TO L STEP 2
70   REM DIVIDE ONLY BY D = 3, 5, 7, ...
80   FOR D = 3 TO SQR(N+1) STEP 2
90     IF N/D = INT(N/D) THEN GOTO 130
100  NEXT D
110  PRINT N;".";
120  GOTO 140
130  PRINT "..";
140 NEXT N
150 END

 You don't need to type it in. Just copy the text over the clipboard into the SimH console window.

But wait ...

Load a BASIC program from Papertape

The "Papertape-BASIC" is not only distributed on papertape, it also can load and save program files to/from papertape.

The "primes.bas" example file is part of the distribution. To let BASIC read it from the SimH Paper Tape Reader PTR device:

  1. HALT and break into Simh
  2. Put the program strip in the reader:
    sim> attach ptr primes.bas
  3. Continue execution of the 11/20.
  4. Under BASIC, just issue "OLD": the reader starts and reads "primes.bas"
  5. If you want to read the strip again, you must reset the current reader position back to start:
    sim>dep ptr pos 0

See here a complete walk-through:

blinkenbone pdp1120 basic walkthrough

 

Save a program to papertape

You can also save your BASIC program to papertape. In this case the Paper Tape Puncher PTP is used:

  1. Break into SimH and "put an empty strip into the puncher":
    sim> attach ptp myprogram.bas
  2. Continue the 11/20 and under BASIC type
    SAVE
  3. Break again to SimH and "remove the strip from the puncher":
    sim> detach ptp
  4. You now have a file "myprogram.bas" on your disk.

Surprisingly BASIC saves the file as a normal MSDOS/MS-Windows text file: lines are separated with the "CR/LF" byte sequence 0x0D 0x0A.

Since Bill Gates' first product was a BASIC interpreter for ALTAIR, and he knows DEC products very well, this may not be coincidence.

 

Go for the real thing!

While working with papertape in SimH works fine, it totally misses the physical experience. Nothing can beat
the punching noise, or the view of a strip moving steadily through the reader while zig-zagging in both the source and the destination reservoir.

 

 

Attachments:
Download this file (DEC-11-AJPB-D_PDP-11_BASIC_Programming_Manual_Dec70.pdf)DEC-11-AJPB-D_PDP-11_BASIC_Programming_Manual_Dec70.pdf[Manual for PDP-11 Papertape-BASIC (1970)]5797 kB