Running CP/M on the C64

The idea of running the multitude of CP/M software on your Commodore surely was one of the drivers for people to invest in the C128.
But what about that obscure CP/M cartridge, containing of course the Z80 CPU (running at 3MHz), that Commodore released for the C64 in 1983?  Did this introduce CP/M for the classic Commodore computer? 

At least in theory, the cartridge would open up the world of CP/M to the C64 user, but 1541 disk drive incompatibilities made it next to impossible to run CP/M software on the home computer.  A disk of, let’s say an Apple (CP/M) would simply not run and only produce a “Bad Track” or “Bad Sector” error.
Commodore quickly stopped manufacturing these cartridges and Commodore users had to wait till the C128 before they could really start playing around with CP/M
So was the CP/M cartridge a complete waste?  Surely there would be some “proprietary” Commodore CP/M software for the C64?
The answers are “no” and… “no”.
This may seem a bit contradictory but there was one neat little trick that you could do to actually run the CP/M programs out there and it didn’t involve the incompatible disk drive: you had to utilize the user port to transfer CP/M software from another machine… talk about some workaround!


Picture courtesy of Z80.eu

The idea was simple: use a 6510/8080 Assembler program to dump everything that arrives via the user port to memory (about 35 Kbytes), switch to the Z80 on the cartridge and make it read everything from memory and write to disk.
I’ve included here in PDF-format (sorry, I’ve only got the hardcopies, so you’ll have to type it in yourself) 2 programs, one in 6510 Assembler, the other in 8080, that will allow to transfer CP/M programs of maximum 35 KBytes to the C64.   There’s no protocol to handle errors in transmission, but the upside is that you don’t need to write any program for the transmitting computer (a mere “PIP ptp:= programname” command suffices).

To install the program, first enter the Z80 code into the ED-editor under CP/M, assemble and load.  The resulting COM-file then needs to be expanded with the 6510 program, using a machine language editor like Micromon.
With this editor, you can put the second program (in 6510 assembler) at address 0E00 in memory.  Once this is done, we move the routine to the RAM positions C000 to C2000.  This is a safe area as CP/M does not utilize it when running in 44K-mode.
After saving to disk, we load CP/M and move the 6510 part to the Z80 address 0531 (this can be done with the DDT command: MB000, B200, 531 meaning “Move from B000 to B200 to position 0531”).
Do a “Control-C” and provide the command “SAVE 8 FILTRN.COM”.

Phew, OK, maybe not that easy (it’s a workaround remember) and a lot of typing but now it gets a bit easier.

Under CP/M make the command “FILTRN file.ext”, with file.ext being the name under which you want to save the imported program.
The computer will now ask “110 OR 300 BAUD (1/3)”, so specify the transfer rate.
Next up, the program will simulate a terminal.  This is useful if we want to get a file from a multi-user mainframe.  You can provide a command to “LIST” the file you want to transfer.
Then the system will initiate the file transfer (when hitting the C= key).  On the transmitting machine, you can provide the “PIP” command, sending the data from the file to the communications port.  It will transmit the data to the C64’s memory and echo it on screen.  Once the file has reached its end, you can press the “UP ARROW” key and the save to disk will commence.


Picture courtesy of Z80.eu

So, with this procedure, albeit a bit complex, you can open up your C64 to the wonderful world of CP/M applications such as MBASIC (a gigantic improvement over Commodore’s Basic as it has the possibility to perform IF…THEN…ELSE, WEND, etc.), FORTRAN-80 (wow, I remember doing graphical analysis of CT scans with this language while I was at university), Wordstar (although you do need a 80 columns card for your C64 as it really only works on 80 columns) and many more compilers such as PASCAL, COBOL and C.

Share This Post

DeliciousDiggGoogleStumbleuponRedditTechnoratiYahooBloggerMyspaceRSS

4 Responses to Running CP/M on the C64

  1. Pingback: Tweets that mention Running CP/M on the C64 | A Commodore Geek's Blog -- Topsy.com

  2. Great blog. Keep going on, I am glad to see any new web site about vintage computer.

    But … if you take pictures from other web sites ( like from my page at http://www.z80.eu/c64.html – this page describes CP/M for the C64 and the module itself in detail and is up und running since years), you are invited to do so, but mention always where you got the pictures. Thx for reading.

  3. Pingback: August 1982, the world gets to buy the C64 | MOS 6502

  4. Pingback: Strange peripherals… the FD-4000 drive | MOS 6502

Leave a Reply

Your email address will not be published. Required fields are marked *