Intel 8080 CPU Emulation In JavaScript

The Intel 8080 microprocessor is a popular chip found in many retro computing projects. The architecture of this processor, which was released in 1978, is now considered obsolete and it has been replaced by its successors the 8085 and 8086. As such, not much documentation or software exists to emulate this device on modern hardware.

This article presents an emulator for the Intel 8080 written entirely in JavaScript with no dependencies other than a browser that supports ECMAScript 5 function definitions (i.e., most browsers). It includes two examples: one emulates the MOS 6502 running at 1 MHz; another emulates the Zilog Z80 running at 2 MHz. Few lines of code are required to get these emulators up and running.

intel 8080 cpu emulation javascript

The emulator is written in an event-driven style, with the main loop being driven by timer interrupts. This allows for a high degree of flexibility and portability, as the same code can be run on different machines without having to change any of the timing-related code. The only platform-specific code is a small function that sets the initial timebase frequency (in Hz) for the emulator.

The emulator has been tested on Firefox 3.5+, Chrome 4+, Safari 5+, Opera 10.5+, and Internet Explorer 9+. It should work on any browser that supports ECMAScript 5 function definitions.

You can find the source code for the emulator on GitHub.

Please feel free to fork the repository and contribute any improvements you make!

Leave a Comment