Technology Technology

intro Intro Java Java ASP ASP PET PET  

Commodore PET Programs

A bit of Computer Archeology

Back at the end of the 1970's and at the start of the 1980's, I was a pupil at Keswick School. During this time, the school bought two Commodore PET computers ("Personal Electronic Transactors"). Initially, there was one model 2001-8N but, later, a new model 3008 - with more memory and a full-size keyboard - was purchased. I was the only pupil at the school to have my own key to the computer room. By the time I was in the 6th form, my ownership of the key had actually become legitimate!

I built up a fair collection of programs for the PET, most of which I wrote myself in BASIC. A few were hand-coded in 6502 machine-code. Some others were typed in from magazines, written by other pupils from Keswick School or obtained from other sources. The programs were saved onto cassette tapes, which I kept and had latterly been stored in an old shoebox in my loft for nearly 20 years.

The time finally came in 2009 to try and recover the programs from the cassette tapes. A bit of digging round on the Internet and trying out a few different ways of decoding the data resulted in the following, successful, method:

  1. Connect up the line-output of a (half-decent) cassette deck to the line-input of the sound card in a standard desktop PC (the one I used runs the "Testing" distribution of Debian GNU/Linux).
  2. Set the audio mixer to capture only the line input for recording, i.e. mute the microphone, etc. I found that setting the line-input and capture levels to about 70% seemed to work best; obviously your ideal setting could be very different, depending upon the equipment that you are using.
  3. Use the arecord utility to record the output of the cassett deck and create a single, large, ".wav" file for each side of the tape. Depending upon your computer's O/S, you may need to use different software to capture the audio into a ".wav" file.
  4. Use the tape64 utility with the -op:[directory] option to process the ".wav" file.
  5. If the tape64 program fails to extract all (or any!) of the programs from the ".wav" file, then go back to step (2) and try again with different recording levels. It took me a few goes, with different levels for different sections of each tape, before I got all the programs extracted.
  6. Install VICE, the Versatile Commodore Emulator onto your computer.
  7. You can now use the petcat command to de-tokenise the binary programs into a human readable text format.
  8. Track down the ROM images that the VICE emulator requires. Searching the Internet for "vice-1.5-roms" should get you what you need.
  9. Run the emulator using the xpet command, passing the name of a binary program to it.
  10. Revel in the retro-glory of it all!

Screen Shots

Some scans, of photographs from circa 1981, showing a few of the programs running on original Commodore Pets!

Galactic Attack Cluedo Space! Space Invaders Space Invaders on the 2001-8N

The Programs

I had three tape-fulls of programs, but there was a large overlap between them. The following list is the result of trying to pick the latest version of any given program. Both the binary version - ready to run in VICE - and the human- readable listing, or HEX dumps of machine code programs, are given. The descriptions of the programs, with any specific notes that were preserved on the A4 sheets of paper that had survived with the tapes, are included. For anything further, you'd probably be best off reading the listings and working it out - my memory really doesn't go back 30 years or more!

Binary ProgramListingNotes
3d_os+xs.pet3d_os+xs.txt3D Noughts and Crosses
addition.petaddition.txtAddition practice
air_attack.petair_attack.txtAir attack
alntc.petalntc.txtAlien attack
alpha_scatter.petalpha_scatter.txtAlpha particle scattering
anagram.petanagram.txtPrints out anagrams
auto_number.petauto_number.txtAuto line number
avrge.petavrge.txtFinds averages
bthll.petbthll.txtBoot hill
calcl.petcalcl.txtCalculator simulator
card_sharp.petcard_sharp.txtCard sharp (memory test)
check.petcheck.txtMemory Check
chess.petchess.txt[Model 2001-8N only] Microchess 2.0 - copy using sys(826)
clever_os+xs.petclever_os+xs.txtIntellegent Noughts and Crosses
clock.petclock.txtAnalogue clock face
codes.petcodes.txtCodes + decodes
count_to_100.petcount_to_100.txtCount to 100 game
cross.petcross.txtNoughts and crosses
date_book.petdate_book.txtDate book - Needs a data cassette
flash.petflash.txt[Model 2001-8N only] Flashes screen at ~ 60Hz - alter interrupt: POKE 538,3 : POKE 537,58
galactic_attack.petgalactic_attack.txtGalactic Attack
guessing_game.petguessing_game.txtGuessing game
gunner.petgunner.txtGunner (by elevation)
hexld.pethexld.txtHex loader - Put data in program as DATA statements
hunter.pethunter.txtCatch blob
imphex.petimphex.txtImphex / Hexpawn
key_repeat.petkey_repeat.txtAuto repeat key - start = sys(832), stop = sys(848)
landr.petlandr.txtLunar lander
life.petlife.txtLife - sys(6400) to go
mazer.petmazer.txtFind way round maze
memory_check.petmemory_check.txtMemory Check
mmprt.petmmprt.txtMemory printer - run, then sys(826)
nocop.petnocop.txtNo copy program - saves - use sys(826)
os+xs.petos+xs.txtNoughts and crosses
pascl.petpascl.txtPascals triangle
plot.petplot.txtPlot (?!)
poetry.petpoetry.txtComposes poems
pound.petpound.txtDraws £ sign on printer
power_boat.petpower_boat.txtPower boat
prsin.petprsin.txtPrints a sine curve
quadr.petquadr.txtSolves quadratic equations
reaction_test.petreaction_test.txtReaction test
rndst.petrndst.txtRandom number tester
rvchr.petrvchr.txtReverses characters only - sys(826)
saucer_war.petsaucer_war.txtSaucer War
scpyd.petscpyd.txtPrints out the screen, double chars - RUN (in top left) is erased
shooter.petshooter.txtShoot the blob
shooting_gallery.petshooting_gallery.txtShooting Gallery
sines.petsines.txtPlots a sine curve
space_invaders.petspace_invaders.txtSpace Invaders
spact.petspact.txtSpace attack
squash.petsquash.txtSquash (solo)
stomper.petstomper.txtStomp on an insect
target_practice.pettarget_practice.txtTarget practice
trace.pettrace.txtTrace - initialise = sys(7876), on = sys(7906), off = sys(7852)
trans.pettrans.txtTransfer 1K to Screen - sys(826): POKE 827, K of source
treasure_maze.pettreasure_maze.txtTreasure Maze
typer.pettyper.txtTyping practice
urchr.peturchr.txtUser character printer - no's are data for char definition
worms.petworms.txtWorm race
wpros.petwpros.txtWord processor - may need a data cassette
wtout.petwtout.txt'Reverses' screen - sys(826) to go

Most of the programs run fine in several different (emulated) models of the PET. Select model 8032 in VICE and you should be fine. The few programs that are specific to the older 2001-8N model PET are flagged up in the notes, above.

For several of the games, keys on your PC's numeric keypad should control movement, but make sure that you have NUM LOCK on, or this won't work!

A few of the odder low-level programs might not work in any sane way in the emulator, but they are included here in case anybody want's to try them on a real PET! Other programs may be of dubious value, or their function may be too obscure to understand, but are here for completeness.







Alba House
Alba House

Castlerigg Project
Castlerigg Project


The Personal Planet is maintained by Dave Wylie djwpptag David Wylie Last significant update: Monday 14th August 2017 David J. Wylie