Opcodes Table

Understanding the Opcode column:

Example: The instruction 0xD123 would match with the DXYN opcode, where VX is V1, VY is V2, and N is 3 (draw a 8x3 sprite at (V1, V2))

OpcodeDescriptionNotes
0000NopDo nothing, progress to next opcode
00E0Clear screen
1NNNJump to address 0xNNN
2NNNCall 0xNNNEnter subroutine at 0xNNN, adding current PC onto stack so we can return here
3XNNSkip if VX == 0xNN
4XNNSkip if VX != 0xNN
5XY0Skip if VX == VY
6XNNVX = 0xNN
7XNNVX += 0xNNDoesn't affect carry flag
8XY0VX = VY
8XY1VX |= VY
8XY2VX &= VY
8XY3VX ^= VY
8XY4VX += VYSets VF if carry
8XY5VX -= VYClears VF if borrow
8XY6VX >>= 1Store dropped bit in VF
8XY7VX = VY - VXClears VF if borrow
8XYEVX <<= 1Store dropped bit in VF
9XY0Skip if VX != VY
ANNNI = 0xNNN
BNNNJump to V0 + 0xNNN
CXNNVX = rand() & 0xNN
DXYNDraw sprite at (VX, VY)Sprite is 0xN pixels tall, on/off based on value in I, VF set if any pixels flipped
EX9ESkip if key index in VX is pressed
EXA1Skip if key index in VX isn't pressed
FX07VX = Delay Timer
FX0AWaits for key press, stores index in VXBlocking operation
FX15Delay Timer = VX
FX18Sound Timer = VX
FX1EI += VX
FX29Set I to address of font character in VX
FX33Stores BCD encoding of VX into I
FX55Stores V0 thru VX into RAM address starting at IInclusive
FX65Filles V0 thru VX with RAM values starting at address in IInclusive

Index