Skip to content
/ Py1620 Public

A very basic IBM 1620 emulator in Python which can run the Power of Two demo program and Tic-Tac-Toe

Notifications You must be signed in to change notification settings

mdoege/Py1620

Repository files navigation

logo

Py1620 (IBM 1620 emulator)

A very basic IBM 1620 emulator in Python. It currently implements enough of the 1620 instruction set to run the Computer History Museum's Power of Two demo program or Tic-Tac-Toe (11.0.013) from the 1620 General Program Library.

See the IBM1620-Baseball repo for additional IBM 1620 tools and documentation.

Power of 2

Py1620

The program is loaded from the CMEM file. The addition and multiplication tables in 1620 memory are not used but standard Python integer math. Computing 2**9999 takes about 18 seconds on a PC, so the program is about 70x as fast as a real IBM 1620.

Overbars for the flag bit are printed using Unicode combining characters and may not look good (e.g. be shifted horizontally) with some fonts.

Also see this YouTube video of Power of Two running on the 1620 Junior emulator.

$ python3 py1620.py pow

POWER OF 2 CALCULATOR

N = 8

2**8 = 2̅56



N = 100

2**1̅00 = 1̅267650600228229401496703205376

Tic-Tac-Toe

The program is loaded from the punch card text file. When the computer loses, it will learn the losing move and play differently next time:

TTT

$ python3 py1620.py

*** auto-resume from HALT at 0

SQUARES NUMBERED AS FOLLOWS

1  2  3

4  5  6

7  8  9

SW 1 ON FOR DATA,PUSH START
*** auto-resume from HALT at 1350

NEW GAME
YOUR PLAY 5
   MY PLAY IS 1
YOUR PLAY 2
   MY PLAY IS 8
YOUR PLAY 9
   MY PLAY IS 3
YOUR PLAY 6
   MY PLAY IS 4
YOUR PLAY 7
 TIE GAME

Credits

The IBM 1403 printer font is available at ibm-1401.info.

IBM 1620 image by Marcin Wichary, CC BY 2.0 https://creativecommons.org/licenses/by/2.0, via Wikimedia Commons

Further reading

About

A very basic IBM 1620 emulator in Python which can run the Power of Two demo program and Tic-Tac-Toe

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages