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.
Instruction | Description | Relevant Posts |
0MMM | Calls a machine code subroutine at the address 0x0MMM | Machie Code Integration |
00E0 | Clears the screen | Machine Code Integration |
00EE | Returns from a subroutine | Machine Code Integration Branch and Call Instructions |
1MMM | Branches to the instruction at address 0x0MMM | Branch and Call Instructions |
2MMM | Calls a subroutine at address 0x0MMM | Branch and Call Instructions |
3XNN | Skip if VX = NN | Skip Instructions |
4XNN | Skip if VX ≠ NN | Skip Instructions |
5XY0 | Skip if VX = VY | Skip Instructions |
6XNN | Load VX with NN | Loading and Saving Variables |
7XNN | Add NN to VX | Arithmetic and Logic Instructions |
8XY0 | Load VX with VY | Loading and Saving Variables |
8XY1 | OR VY with VX | Arithmetic and Logic Instructions |
8XY2 | AND VY with VX | Arithmetic and Logic Instructions |
8XY3 | XOR VY with VX | Arithmetic and Logic Instructions |
8XY4 | Add VY to VX, load VF with carry bit | Arithmetic and Logic Instructions |
8XY5 | Subtract VY from VX, load VF with carry bit | Arithmetic and Logic Instructions |
8XY6 | Shift VY one bit right, load VX with result, load VF with bit 0 | Arithmetic and Logic Instructions |
8XY7 | Subtract VX from VY, load VX with result | Arithmetic and Logic Instructions |
8XYE | Shift VY one bit left, load VX with result, load VF with bit 7 | Arithmetic and Logic Instructions |
9XY0 | Skip if VX ≠ VY | Skip Instructions |
AMMM | Load I with the address 0MMM | Loading and Saving Variables Indexing the Memory |
BMMM | Branch to the address calculated by adding 0x0MMM to Chip-8 variable V0 | Branch and Call Instructions |
CXNN | Load VX with a random number from 0 to 255 ANDed with NN | Generating Random Numbers |
DXYN | Draw 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×00 | Drawing Sprites |
EX9E | Skip if VX = current key press | Skip Instructions Keyboard Input |
EXA1 | Skip if VX ≠ current key press | Skip Instructions Keyboard Input |
FX07 | Get the current value of the timer into VX | The General Purpose Timer |
FX0A | Wait for a keypress and store the value in VX | Keyboard Input |
FX15 | Set the timer with the value of VX | The General Purpose Timer |
FX18 | Set the sound timer with the value in VX | Sound |
FX1E | Add value in VX to I | Indexing the Memory |
FX29 | Load I with address of sprite for the character in VX | The Character Set Binary Coded Decimal |
FX33 | Store the BCD representation of the value in VX at I, I+1 and I+2 | Binary Coded Decimal |
FX55 | Save variables V0 through VX starting at the address in I | Loading and Saving Variables |
FX65 | Load variables V0 through VX from memory starting at the address in I | Loading and Saving Variables |
Here is a PDF with the complete CHIP-8 Interpreter Disassembly.
Be First to Comment