Intel 8080 Emulator
Intel 8080 Emulator
Intel 8080 Code
Overview

An emulator for the Intel 8080, an 8-bit CPU released in 1974. It emulates all the registers, opcodes, and interrupt pins on the real CPU and runs CPU compatible programs.


Key Technologies
C
C
CLion
CLion

Creation

During my sophomore year of high school, I became interested in emulators through my project to create a Gameboy Classic emulator for my calculator (which can be found here). This project inspired me to have another go at writing an emulator with a more practical and well defined CPU.

I the idea of writing an emulator for the 8080 popped into my head while I was reading Code: The Hidden Language of Computer Hardware and Software, in which the author describes the inner workings of the 8080. The elegance of its insides inspired me to pull up the Intel manual and read more about the opcodes and registers. Through this, I decided that I wanted to give emulating this CPU a shot.

So after reading through the entire manual, I felt confident enough to start writing the code, and quickly settled on C as my language of choice so that I could gain more experience in such a fundamental language.

I started off by writing the main loop and basic registers and immediately decided that for each module and opcode that I wrote, I would write multiple unit tests. This was a huge lesson that I learned from my last attempt at writing an emulator which quickly got out of hand with bugs and unreadable code.

With the help of the 8080 manual and hours of staring at the CPU’s pin diagrams, I completed my emulator, properly emulating everything on the CPU except limiting the clock speed (I’ve tried it before, it was painful).


Takeaways

Through this project I learned a load hard skills like C, proper testing, and an understanding of assembly (despite it being a variant from forty years ago). I also came away with a lot of soft skills like proper code organization and writing a project planning for it to scale to thousands more lines of code.

GitHub


© 2018-2019 Jake Kinsella