CHIP-8 as an Abstract Machine

Published on 17 January 2026

I’ve been self-studying computer architecture for quite some time now and have decided to start working on an emulation project. Before getting started on the actual implementation, I decided to learn about the history of CHIP-8. This post will explore the origins of CHIP-8, as well as discuss the concept of abstract machines.

Back in 1977, an interpreted programming language called CHIP-8 was developed for the RCA 1802 microprocessor. It was originally created by engineer Joseph Weisbecker to simplify game development for early microcomputers like the RCA COSMAC VIP and was first specified in RCA COSMAC VIP CDP18S711 Instruction Manual. A few months later it was also discussed in Byte Magazine Volume 3 Number 12.

Unlike the COSMAC VIP, CHIP-8 is still quite popular and widely used. To understand how CHIP-8 survived independently of the hardware it was developed for, it’s important to understand the concept of an abstract machine. In his course Programming Languages (Spring 2013), Hrafn Loftsson gave the following definition for an abstract machine:

Assume that we are given a programming language $\mathcal{L}$. An abstract machine for $\mathcal{L}$, denoted by $\mathcal{M}_\mathcal{L}$, is any set of data structures and algorithms which can perform the storage and execution of programs written in $\mathcal{L}$.

Creating a CHIP-8 emulator thus means implementing such an abstract machine.

Let’s now examine the properties the abstract machine must satisfy, as defined by the CHIP-8 specification in the COSMAC VIP Instruction Manual:

  1. The abstract machine must be able to decode and execute the CHIP-8 instructions (2 bytes each). The original specification mentions 31 opcodes, while later specifications mention 35 or more opcodes.

  2. The abstract machine requires a state consisting of at least 4,096 bytes of addressable memory, as is dictated by the 12-bit addresses found in some instructions. Additionally, storage is needed for the 16 general-purpose 8-bit registers, one 16-bit index register, one 16-bit program counter, one 8-bit stack pointer, and two 8-bit timers. Finally, the machine requires a stack to store return addresses. The CHIP-8 specification does not specify any size, but let’s follow Cowgod’s Chip-8 Technical Reference and assume the stack should be able to hold 32 bytes.

  3. A frame buffer that supports a resolution of 64×32 monochrome pixels. The state of this frame buffer is modified via drawing instructions.

  4. An input state that keeps track of the current status (pressed/released) of 16 independent keys.

Based on these properties, I created a CHIP-8 emulator. To ensure the emulator is accessible and portable, I decided to implement the emulator using JavaScript.

You can try it out here: emulator.noavermeers.ch.