Running CP/M on the Commodore 64!


CP/M cartridge retail box

Back in 1983 there was this great idea of expanding the Commodore 64 with the then popular (but declining) base of serious business software from the CP/M side of the world by creating a cartridge with a z80 processor inside, and a special port of the CP/M operating system that would take over the C64 letting you run real programs like Fortran, Cobol and the far better (and updated) Microsoft Basic v5!

However as always the major failing of CP/M was the massively different and incompatible diskettes of every platform.  The Commodore 64, lacking in RS-232 ports, and it’s incredibly incompatible 1541 drive rendered it nearly impossible for the average home user to transfer any programs in the specially formatted CP/M diskettes for the cartridge.  Not being able to read a standard 1541 diskette would prove to be it’s undoing.

While messing around in Vice, I saw that this cartridge is emulated now!  A quick search led me to where I was able to then locate the needed cpm.d64.gz, and I was booted up into CP/M and of course that hit the first snag which is of course, where is the software?

Well another search brought me to the package ‘ctools‘ which I quickly built on the Linux subsystem for Windows (I had to add -fpermissive to get it compile..), and now I could take that CP/M diskette delete the contents, and for the heck of it insert in Zork.. Of course where to find Zork along with other CP/M software?  The zip can be located on, even fun things like Microsoft BASIC v5.21 (Interpreter), along with the manual.

CP/M only recognized a single drive, so you have to swap diskettes (Such a typical Commodore 64 experience), and here we go!

via Vice

Naturally the Commodore 64’s 40 column mode is… terrible.

However even back in 1984, a fine program aptly called sets up the Commodore 64 in high resolution graphics mode, and emulates an 80 column mode.  Even better, the magic for the most part happens on the 6502 side, meaning it doesn’t take away from the precious memory on the CP/M side.

Zork 1 under CP/M / Soft80

Its worth noting that although Infocom games are dreadfully slow on the Commodore 64, playing under CP/M is also dreadfully slow, taking some 10-15 seconds to complete a command.

At least under emulation there is the warp mode.  And what took an hour to put together would have been months no doubt in the 1980’s ending in the CP/M cartridge going into a drawer to never be seen again.

A Z80 on a cart is pretty interesting.  It would have been interesting if other CPUs had made their way, a 68000 would have been interesting to have bridge the 8 bit world out, or even if Commodore had tried to put an 8088 onto that card, as early PC’s were nowhere near the 640kb hard disk wielding monsters they would become much later.  Naturally one could only dream of the power of an 80386 or the once vaunted NS32016

Commodore Programming Languages

While looking for nothing in particular, I came across Glenn Holmer’s excellent site which has an excellent collection of languages for the Commodore 8bit computers.

And among them was the first C compiler I’d ever owned, SUPER-C!


Towards the end of the effective life of the Commodore 64, people started to dump expensive software on the cheap.  It was a great time to go to the World of Commodore, and see all the great vendors and wares.  And of course feel that ever pervasive shift to the Amiga.  It was where I picked up this fun little binder:

And what about programming in C?

Super-C CCP

It boots up into a CP/M like environment, complete with drive letters.  You can write programs to either be loaded up from the BASIC ROM environment, or the CCP environment.  On the one hand it’s pretty cool, it includes a simple text editor, and the compiler and linker.  But one thing is for sure, using this with a single 1541 is incredibly slow.  The touted Commodore 128 version with REU support would have made it’s insanely slow speeds a little more tolerable.  That and having multiple machines would have been a must.

As interesting as it was to look at, if you really wanted to do anything with C on the Commodore 64, seriously use cc65. There is something to be said for using a cross compiler when you are running at GHZ vs the 6502’s 1Mhz.

Building the Original Commodore 64 KERNAL Source

I just found this post over, the source code to a bunch of old Commodore 8 bit products have been located and recovered, and place online over on github.  Even better there is detailed instructions on cross assembling from a suitable PET machine for building your own KERNAL ROM.

Other sources include:

  • BASIC_C64 reindented BASIC_C64, KERNAL_C64 and DOS_1540 to approximate the LST
  • BASIC_CBM2_A reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • BASIC_CBM2_B reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • BASIC_PET2001 added BASIC_PET2001
  • DOS_1540 reindented BASIC_C64, KERNAL_C64 and DOS_1540 to approximate the LST
  • DOS_1571 added DOS_1571
  • DOS_1581 added DOS_1581
  • DOS_4040 reindented DOS_4040 to approximate the LST output of the assembler
  • DOS_8070 reindented DOS_8070 to approximate the LST output of the assembler
  • DOS_8250 reindented DOS_8250 to approximate the LST output of the assembler
  • DOS_D9065 reindented DOS_D9065 to approximate the LST output of the assembler
  • EDITOR_CBM2 reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • KERNAL_C64_01 added KERNAL_C64_03 and renamed the existing KERNAL_C64 to KERNAL_C64_01
  • KERNAL_C64_03 fix disclaimer of C64 KERNAL -03 to reflect the LST printout
  • KERNAL_CBM2_A reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • KERNAL_CBM2_B reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro

Super late, but pretty cool too!

Of interest is the PET2001 Basic sources.  While there have been reversed efforts dating back for years, this is the actual source code.  Namely the header.



REALIO=4      ;5=STM
        ;1=MOS TECH,KIM
        ;0=PDP-10 SIMULATING 6502

Which is pretty damned interesting. The infamous “WAIT6502,1” feature is also included!

Commodore Lemonade

Simulations before the sims

Lemonade on the PET

Back before there was sim city, the first popular simulation thing I can think of on our ancient basic bound 8 bit machines (and even mainframes running basic!) was Lemonade.  Wikipedia, naturally is full of Apple citations, and of course, is absent of any mention of the most popular selling home computer of all time, as Commodore is usually scrubbed from history in favor of this narrative that Apple was some how popular (it wasn’t).

Oddly enough tracking down these older versions of Lemonade is really hard.  But thankfully others have done the hard work for me!

First from The Sleeping Elephant,  and here is lemonade!.prg for the Pet microcomputer.  It’ll run fine in Vice, although it’ll run best using a Pet 3016 – 3032 and the model 4016 and 4032.  It needs more than 8kb of RAM, so the original models are out, and the ‘graphcis’ don’t display corrrectly on the larger 8000 models, although the game does run.

But what about the Commodore 64?

Commodore Educational Software

By the time the Commodore 64 came out, Commodore had stepped upped their game, and made available a large number of basic programs ported to the Commodore 64. As always the thinking is if you can convince parents that this is educational and it’ll help their kids, they’ll buy one.  Well in this case they were right!  Although lacking the cool animation of the PET, it does include more documentation.  And thanks to, You can download a tape file image here.

Game Play

Unsurprisingly the game play is pretty much the same.  You buy your Lemon concentrate, sugar and cups, try to predict demand based on your price and the weather.  You set a price, and sit back and hope for the best.

Lemonade Stand on the PET
Lemonade Stand on the Commodore 64

Once you figured out that the first few lines (3-5 on the C64) were there to not let you alter it, you were golden.  With the source, you could make summer last 10 years if you wished, or change any of the seemingly arbitrary limits.  If you were really keen on it, you could also print the source code and work out the logic flow with a pencil, something that you really needed back in the days of 40 column screens.

Settings -> Virtual Device Traps

Settings -> Drive Settings -> (Uncheck) True drive emulation

Settings -> Peripheral Settings

And now you can click the printer #4 tab and set it to output a to a file

Assuming you have the program loaded you can then just type in:


*Remember that Vice emulates the Commodore layouts, which means on the PET machines, they use a number pad.

The above commands will open up the printer, print the listing output to the printer, then close the printer device.  If all went well you’ll have the source dumped to viceprnt.out although PETSCII won’t render on ASCII systems, nor will the machine language portion, and a lot of the BASIC may get down shifted but you can always fix that with tr.

tr ‘[:lower:]’ ‘[:upper:]’ < c64_lemonaide.bas > c64_lemonaide_upper.bas

Quad core by Singular Crew / C64 demo

One of the coolest Commodore demos in some time.  Featuring quad Commodore 64’s.

Some details: This is the party version, rendered with VICE. AVSEdit Plus and VirtualDub used to merge videos. Unfortunately we had no four projectors to show it realtime. An idea to start: use rod or board to press space same time.

Main code: Scorpy.
Zoomer part and some bugfix by Soci.
12 channel music: Vincenzo
Four screen picture: Leon
Rotator logo and some grafic artwork: Poison.

Note: The rotating logo in the last part originally designed to an Amiga demo 10 years ago which never finished.

I have to say, it not only looks great, but sounds great! Obviously we didn’t need the C65, we just needed a cluster of C64s.

NOS clone datassettes!

New old stock, still in shipping boxes!

327 devices!
327 devices!

I found this eBay auction, and couldn’t believe what they had unearthed!  Boxes and boxes of these clone datassette!

New old stock
New old stock

Obviously the perfect thing for any retro Commodore user!  And as you may know in Europe most people used tapes, while us North Americans all used disk drives, namely the mighty 1541.

As of me writing this there is only ONE left!  It’s not my auction, and I have nothing to do with them, but this is your big chance to get one if you want one!


Well it turns out the last unit has just been sold.  Too late to post it seems.

Scripted Amiga Update & hosting at

I saw this awesome link over at’s software Library featuring the Amiga

Behind it all is the Scripted Amiga Emulator.  What is more interesting is that there has just been a MASSIVE update/rewrite to the project and it is now boasting far more features!

Looking at the features page, there has been quite a number of updates since the last version.  The big ones (to me) is that the CPU core has been rewritten, and now supports not only the 68000, but the 68010, 68020, and 68030 (only with fake MMU). OCS, ECS and now AGA as well!  Preset models include the 1000,500,2000,500+,600,3000 and 1200.  IDE disk files can even be mounted for the 600 & 1200!

In addition is support for the Amiga 1000 velvet prototype, and even now has the ability to have an AMAX (Macintosh emulation) cartridge port.

R-Type on SAE
R-Type on SAE

I’d highly recommend the internet archive link, you can jump right into some great Amiga action with nothing to download or install!

The Ultimate Amiga 500 Talk

Amiga Hardware Design And Programming

The Amiga was one of the most powerful and wide srpead computers in the late 80’s. This talk explains its hardware design and programming.

The Amiga 1000 appeared in 1985 and was followed by the Amiga 500 a few years later, which had the same design concept but was a little bit more powerful. The hardware design was highly sophisticated and powerful and was years ahead to other computers at the time then.
Equipped with the Motorola 68000 Microprocessor as the CPU which was internally a full 32 bit processor and several additional co-processors for various complex DMA tasks it was perfect for graphics-intensive software.

This talk explains the hardware in detail, how all those processors interacted and how it was programmed.

➤Speaker: rahra
➤EventID: 7468
➤Event: 32th Chaos Communication Congress [32c3] of the Chaos Computer Club [CCC]
➤Location: Congress Centrum Hamburg (CCH); Am Dammtor; Marseiller Straße; 20355 Hamburg; Germany
➤Language: english
➤Begin: Sun, 12/27/2015 18:30:00 +01:00
➤License: CC-by

CBM Basic

I found this repository by accident, cbmbasic which is a ‘portable’ version of the old Microsoft Basic for the Commodore 8bit computers in C which can run on any manner of machine.

Really cool, right?

So for the heck of it, I fired up the x68000 toolchain, and in no time after gutting the file open operation as some stuff isn’t defined, and I wanted to see it run, I had a working executable.

CBM Basic

All the commands MUST BE IN UPPERCASE… Then again the Commodore did default to upper case, so I guess that isn’t a surprise.  There is no ‘system’ command to take you out of basic, but Control-C works just the same.

The other intersting thing, is that on the authors blog,, the original source code for the 6502 basic has been found.  Notably this version includes portions written by Bill Gates.  It is a very fascinating read.

Belated Merry Christmas!

Sorry things have been busy @ Home & Work.

I had been thinking about doing something special for the holidays but looking around it’s a little too late.

So instead here is something nerdy from my youth, the Commodore Christmas demo diskette..   When I was lucky enough to get a C64 along with a 1541 in 1983, this was one of the bundled diskettes.

At the time I never realized how lucky I was to have the floppy drive, so many poor Europeans with their tape drives.

I hope it’s been a good holiday for everyone!