Emulating older computers on modern, much faster systems, is very common nowadays – but how about emulating the Intel 8080 (1974) on a MOS 6502 system like the KIM-1 (1975)? The “8080 Simulator for the 6502” by Dann McCreary from 1978 does exactly that.
Why imitate one microprocessor with another? You probably purchased this 8080 simulator package to do one or more of the following:
The emulator is extremely size-optimized and fits in less than 1 KB of RAM. This was done by compressing the 256-entry opcode space into 25 sections of similar instructions that could be handled by one generic function.
The four-page article “8080 Simulation with a 6502” (MICRO – The 6502 Journal, issue 16, September 1979) explains the motivation and design of the software in detail:
Dann McCreary: 8080 Simulation with a 6502 
And here is the original commented source code with usage instructions:
Dann McCreary: An 8080 Simulator for the 6502, KIM-1 Version 
Thanks a lot to Dann McCreary, who provided scans of his original work, as well as additional insights:
I wrote this by hand, pencil and paper assembly (BTW, did you ever read Carl Helmer’s article about pencil and paper in one of the very early issues of BYTE magazine? ;) and much of the simulator was written as I rode the bus to and from work… ;)
About the tools used to create this program:
Honestly, I don’t remember for certain… BUT… MORE THAN LIKELY, it is
a FAKE – i.e., I probably just text-edited a listing in “assembler
listing” format for the purpose of publishing the code and “looking
CONSEQUENTLY, be on the lookout for typographical (and thus operational)
errors that could be “in there” …
The all-upper-case makes me think I printed this stuff out on an old
drum printer that I resurrected from the American Surplus Computer
company in Boston back in the ’70s… And there’s yet another story! :)
The text editor may likely have been running on my Apple ][…. or maybe
“borrowed” from some company where I was working at the time?
Dann later ported the simulator to the Apple-][. The tape dump of the resulting product “Apple-80” can be found at brutaldeluxe.fr.
6 thoughts on “Emulating the Intel 8080 on a MOS 6502”
thanks, very nice :) I am just now dreaming about 6502 too – back in 1988 at high-school I wrote the same thing for Atari 800 XL using macroassembler Atmas-II, just with curiosity if/how it will work – mine was under 4kB binary with 2 per-opcode tables (pointers to opcode routines and PC-advance), so main loop was primitive and very fast, having source code done DRY using macros where possible; I had only cassete recorder for backups and source code tape is already gone, but the school contest thesis exists, so may be I will post it someday for memory of STILL COOL 6502 and golden times ;-)
WOW. I was heavily into 6502 and 8080 (well Z80) in the early 1980’s but was not aware of that program!Probably because the Kim1 was ‘old hat’ by then compared to the PET’s and Superboards. Would definitely have looked into it if I had known about it.
I actually designed and built an add on Z80 board for my 6502n Superboard/UK101. It sat in the 6502 socket and connected the main board to either the original 6502 chip (via some tri-state buffers) or to a Z80 (which tristated itself when ‘off”). Since the reset address was low for the Z80, where the main board ram was, i could preload the Z80 ‘firmware’ monitor into ram in 6502 mode then switch to Z80 mode .
Worked surprisingly well
The article he mentions on assembling programs by hand with pencil and paper was from BYTE Magazine’s March 1976 issue on page 52 by Carl Helmers.