Classic Computer Magazine Archive COMPUTE! ISSUE 95 / APRIL 1988 / PAGE 43

MS-DOS Emulation For The 64

Can a Commodore 64 emulate MS-DOS? Speed is not important. If it can emulate MS-DOS, could you suggest any manufacturers that might have such an emulator?

Mike Warick

Yes, it's possible for a 64 to emulate an IBM PC, in the same sense that it's possible to bail out Lake Michigan with a teaspoon. Unfortunately (or perhaps fortunately), both are impractical. We understand why readers are so interested in emulators, but when it comes to emulators, the news is rarely good.

Emulation is a complex business, but here's one rule of thumb: The only way to successfully emulate a machine is with a much more powerful machine. An IBM PC would be a better candidate for emulating a 64 than vice versa (even then, the graphics and sound emulation would be embarrassing, at best.) Let's look at two examples.

First, there are emulators that allow Commodore's Amiga to emulate a Commodore 64. The Amiga uses a 32-bit 68000 microprocessor running at about 7 MHz and has vast amounts of memory. When the powerful Amiga emulates the 64's 1 MHz 6502, the results are disappointing. The emulation runs at about one-fourth a 64's normal speed. Much too slow for games and irritatingly sluggish for most other applications.

Another emulator allows an MS-DOS 8086-based computer to emulate CP/M Z80. This emulation results in an 8-MHz 8086 emulating Z80 running at between 1 and 2 MHz. This emulation is fairly successful because the 8086 family of microprocessors is somewhat compatible with the 8080/Z80 family. Even though this emulation is usable for some applications, it is too slow for many others.

Why are emulators so much slower? A computer's microprocessor is an interpreter of machine language. It fetches an instruction, decodes it, and executes it. A software emulation of this procedure must follow the same process of interpreting individual machine language instructions, with the result that the code is interpreted twice—once by the software emulator and once by the host's microprocessor.

Microprocessor emulation is a formidable, task, but it is only the first problem to face when designing an emulator. In addition to the microprocessor, a computer system has its own special memory organization, input, and output.

When considering I/O, some emulations are impossible. The 64's video cannot emulate a Hercules Graphic Card or IBM's EGA (Enhanced Graphic Adapter); the hardware just isn't there. With disks, the problem is sufficiently complex to be considered impossible. Imagine trying to simulate a 20-megabyte hard disk with 125 subdirectories and 600 user files on a Commodore 1571 with 15 boxes of floppies.

When imagining a 64 or 128 emulating a 512K 8086-based MS-DOS computer, a few back-of-the-envelope calculations show a speed degradation of about 1000:1. This means that a program that normally takes 30 seconds to load on an IBM PC would take over eight hours on a 64 emulating an MS-DOS machine. So, although it might be possible for a 64 or 128 to emulate an MS-DOS machine, by the time the emulation software's been developed and you've run your first program, MS-DOS may no longer be the popular operating system it is today.