In this series of posts we will be building an emulator for the Chip-8 system. If you are already interested in the Chip-8, or want to learn how emulators work, this is a great place to start.
If you are more familiar with emulators and instead want to learn about a more involed system, take a look at our NES series instead.
The Chip-8 is a very simple system, but has all the same parts as more complex systems. This presents a nice smaller project to work on while learning about digital systems and emulation. Now let’s dive in.
The Chip-8, like a physical CPU, is designed to execute programs. A program is a carefully selected list of instructions, which combine to accomplish some goal.
An instruction can be thought of as one of the operation buttons on a calculator. Each instruction does a basic operation, possibily involving some input data. The secret to a programmable system is that each of these instructions is given a representation as a number. The system has a way to run these instructions (like a calculator) but also has a way to look at a program and decide which of its “buttons” to press.
To better understand the layout of Chip-8 programs, we’ll need to understand how computers represent numbers. If you already know binary and hexadecimal, feel free to skip this section.