Skip to content
/ PDP-8 Public
forked from jdersch/PDP-8

A fork of the Python PDP-8 emulator with added blinkenlights and teletype sounds. Needs PyGame.

Notifications You must be signed in to change notification settings

mdoege/PDP-8

 
 

Repository files navigation

PDP-8

screenshot

A fork of the Python PDP-8 emulator with added Blinkenlights. Needs PyGame.

The top row of lights shows the program counter and the bottom row the accumulator.

To quit the program, press Ctrl+C to return to the monitor, then enter q.

PDP-8 front panel photo by David Gesswein. ASR-33 teletype sounds by 262LongRunner@YouTube.

Running the Chekmo chess program

 python3 pdp8.py
 load
 r

Enter a White move, e.g. "E2-E4" and then "PB" for the computer to play Black.

 $ python3 pdp8.py
 pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)
 Hello from the pygame community. https://www.pygame.org/contribute.html
 PDP-8 simulator v0.000001, (c) 2020 j. dersch
 PC 0000 AC 0000 L 0 SW 0000 IE 0
 > load
 PC 0200 AC 0000 L 0 SW 0000 IE 0
 > r

 CHEKMO-II
 W. YOUR MOVE? E2-E4
 B. YOUR MOVE? PB
 B. D7-D5  
 W. YOUR MOVE? 

Here is a game between Stockfish and Chekmo, with analysis provided by SCID:

chekmo

But always remember to only watch those pretty blinkenlights... :)

blinkenlights

Running RIM tape files

Shifter

 rim
 pt shifter.rim
 r
     Press <Ctrl-C> when loading has finished
 pc 100

Now repeatedly enter "s" to single-step through the program and watch the accumulator increase every few steps.

The FOCAL programming language

$ python3 pdp8.py 
pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
PDP-8 simulator v0.000001, (c) 2020 j. dersch
PC 0000 AC 0000 L 0 SW 0000 IE 0
> load focal
PC 0200 AC 0000 L 0 SW 0000 IE 0
> r

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?:NO

SHALL I RETAIN SINE, COSINE ?:NO

PROCEED.

*W
C-FOCAL,1969

Now enter some FOCAL code at the "*" prompt, e.g. this FOR loop which TYPEs numbers, and then use GOTO to run the program. (In FOCAL, commands can be abbreviated by just using their first character.)

 *1.1 F X=1,1,5; T X,!
 *G
 =    1.0000
 =    2.0000
 =    3.0000
 =    4.0000
 =    5.0000

Use "W" to list the program and "E ALL" to delete it.

Loading external code into FOCAL

The "auto" monitor command auto-types a text file into the terminal. If you are getting errors during input such as "?11.35" or "?01.40", you need to increase the value of AUTODELAY in the script, e.g. "AUTODELAY=.1".

Several FOCAL source code files are included:

Note that lunar.fc and ham.fc need a lot of free RAM, so you need to answer "NO" to the FOCAL startup questions!

Hamurabi

$ python3 pdp8.py 
pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
PDP-8 simulator v0.000001, (c) 2020 j. dersch
PC 0000 AC 0000 L 0 SW 0000 IE 0
> load focal
PC 0200 AC 0000 L 0 SW 0000 IE 0
> r

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?:NO

SHALL I RETAIN SINE, COSINE ?:NO

PROCEED.

*CTRL-C halt
PC 2670 AC 0000 L 0 SW 0000 IE 1
> auto ham.fcl
PC 2670 AC 0000 L 0 SW 0000 IE 1
> r
   .... <computer reads program text>
*G


HAMURABI:  


LAST YEAR
=     0 STARVED,
=     5 ARRIVED,
POPULATION IS=   100

THE CITY OWNS=  1000 ACRES.

WE HARVESTED=     3 BUSHELS PER ACRE;
 RATS ATE =   200 BUSHELS, YOU NOW HAVE
=  2800 BUSHELS IN STORE.


HAMURABI:  LAND IS TRADING AT=    18 BUSHELS PER ACRE;
HOW MANY ACRES OF LAND DO YOU WISH TO BUY?

Mandelbrot set

$ python3 pdp8.py 
pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
PDP-8 simulator v0.000001, (c) 2020 j. dersch
PC 0000 AC 0000 L 0 SW 0000 IE 0
> load focal
PC 0200 AC 0000 L 0 SW 0000 IE 0
> r

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?:NO

SHALL I RETAIN SINE, COSINE ?:NO

PROCEED.

*CTRL-C halt
PC 2671 AC 0000 L 0 SW 0000 IE 1
> auto mand.fc
PC 2671 AC 0000 L 0 SW 0000 IE 1
> r
   .... <computer reads program text>

*G

**********************************************************************
**********************************************************************
**************************************************** *****************
*************************************************      ***************
*************************************************      ***************
****************************************    *               **********
*************************************** *                       ******
*************************************                            *****
********************** **** *******                               ****
***********************          **                                 **
*********************                                             ****
*** *                                                          *******
*********************                                             ****
***********************          **                                 **
********************** **** *******                               ****
*************************************                            *****
*************************************** *                       ******
****************************************    *               **********
*************************************************      ***************
*************************************************      ***************
**************************************************** *****************
**********************************************************************
**********************************************************************
**********************************************************************

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%