Simulated PDP-11/20 running Papertape BASIC
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.
Booting into Papertape BASIC
Booting a SimH PDP-11 from papertape is a complicated process, but is performed automatically in the SimH ini-script.
- the papertape bootloader is already "deposit"ed into memory.
- 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".
- the bootloader is started. It reads in the absolute loader from tape and starts him.
- 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.
- 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 !
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:
- Variables may only have single-letter names, or single letter + 1 number (like "N2").
- all input must be given in UPPER case letters (image you're sitting before an ASR33 teletype)
- no string processing, except for printing constant text.
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.
To keep the Blinkenlights busy, this BASIC program can be run.
10 REM PRIMES.BAS: PROGRAM TO CALCULATE PRIME NUMBERS
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:
- HALT and break into Simh
- Put the program strip in the reader:
sim> attach ptr primes.bas
- Continue execution of the 11/20.
- Under BASIC, just issue "OLD": the reader starts and reads "primes.bas"
- 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:
Save a program to papertape
You can also save your BASIC program to papertape. In this case the Paper Tape Puncher PTP is used:
- Break into SimH and "put an empty strip into the puncher":
sim> attach ptp myprogram.bas
- Continue the 11/20 and under BASIC type
- Break again to SimH and "remove the strip from the puncher":
sim> detach ptp
- 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.