Skip to content

Chip 8 on the COSMAC VIP: Instruction Index

This is a series of posts in which I analyse the Chip-8 interpreter as implemented on the RCA COSMAC VIP. They are primarily intended to be of use to anyone writing a Chip-8 interpreter for another platform. However, they will also be of use to anyone wanting to know more about the COSMAC VIP in general.

This post indexes the other posts in this series by their relevance to Chip-8 instructions. There is also a simple index.

InstructionDescriptionRelevant Posts
0MMMCalls a machine code subroutine at the address 0x0MMMMachie Code Integration
00E0Clears the screenMachine Code Integration
00EEReturns from a subroutineMachine Code Integration

Branch and Call Instructions
1MMMBranches to the instruction at address 0x0MMMBranch and Call Instructions
2MMMCalls a subroutine at address 0x0MMMBranch and Call Instructions
3XNNSkip if VX = NNSkip Instructions
4XNNSkip if VX ≠ NNSkip Instructions
5XY0Skip if VX = VYSkip Instructions
6XNNLoad VX with NNLoading and Saving Variables
7XNNAdd NN to VXArithmetic and Logic Instructions
8XY0Load VX with VYLoading and Saving Variables
8XY1OR VY with VXArithmetic and Logic Instructions
8XY2AND VY with VXArithmetic and Logic Instructions
8XY3XOR VY with VXArithmetic and Logic Instructions
8XY4Add VY to VX, load VF with carry bitArithmetic and Logic Instructions
8XY5Subtract VY from VX, load VF with carry bitArithmetic and Logic Instructions
8XY6Shift VY one bit right, load VX with result, load VF with bit 0Arithmetic and Logic Instructions
8XY7Subtract VX from VY, load VX with resultArithmetic and Logic Instructions
8XYEShift VY one bit left, load VX with result, load VF with bit 7Arithmetic and Logic Instructions
9XY0Skip if VX ≠ VYSkip Instructions
AMMMLoad I with the address 0MMMLoading and Saving Variables

Indexing the Memory
BMMMBranch to the address calculated by adding 0x0MMM to Chip-8 variable V0Branch and Call Instructions
CXNNLoad VX with a random number from 0 to 255 ANDed with NNGenerating Random Numbers
DXYNDraw the N byte sprite stored at the address pointed to by I on the display at location X and Y. Set VF to 0×01 if any set pixel in the sprite overwrites an existing set pixel on the display, otherwise set VF to 0×00Drawing Sprites
EX9ESkip if VX = current key pressSkip Instructions

Keyboard Input
EXA1Skip if VX ≠ current key pressSkip Instructions

Keyboard Input
FX07Get the current value of the timer into VXThe General Purpose Timer
FX0AWait for a keypress and store the value in VXKeyboard Input
FX15Set the timer with the value of VXThe General Purpose Timer
FX18Set the sound timer with the value in VXSound
FX1EAdd value in VX to IIndexing the Memory
FX29Load I with address of sprite for the character in VXThe Character Set

Binary Coded Decimal
FX33Store the BCD representation of the value in VX at I, I+1 and I+2Binary Coded Decimal
FX55Save variables V0 through VX starting at the address in ILoading and Saving Variables
FX65Load variables V0 through VX from memory starting at the address in ILoading and Saving Variables
A table indexing ‘Chip-8 on the COSMAC VIP’ posts by relevance to Chip-8 instructions

Here is a PDF with the complete CHIP-8 Interpreter Disassembly.

Published inProgrammingRetro Computing

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *