Small side projects are always a nice way of testing code design ideas, and it feels good to reach a tangible result over an evening hacking session. When doing some research for a potential AltDevBlogADay post, I decided to redo an old project of mine: a CHIP-8 interpreter. The idea I was trying to validate didn’t turn out so well, but the project was entertaining, so I’ll focus my post on it instead. The screenshots at the bottom of this page are from my implementation, which only took a few hours to knock together.
CHIP-8 is a programming language, but it is better described as bytecode. It was designed to simplify the creation of games for the COSMAC VIP computer (1977), which used an 8 bit RCA 1802 microprocessor, had 4096 bytes of RAM and an hexadecimal keyboard. The video output was monochrome and usually had a resolution of 64×32 or 64×64. Given the limitations of the system and the low-level aspects of the language, writing a CHIP-8 interpreter is often used as an introduction to emulation programming.