October 2025
Beginner to intermediate
456 pages
10h 39m
English
The DMG CPU has 500 operation codes, or opcodes, each of which corresponds to a single action that the CPU can perform. Table B-1 contains a few examples, just to give you an idea of what they look like.
Opcode |
Operation |
|---|---|
$80 |
Add register b to register a. |
$81 |
Add register c to register a. |
$CBC7 |
Set bit 0 in register a. |
$CBCF |
Set bit 1 in register a. |
$CBD7 |
Set bit 2 in register a. |
The opcodes are quite granular. There is no generic opcode to add any register to register a. Instead, there is one opcode to add a to a, one opcode to add b to a, one opcode to add c to a, and so on. The purpose of this granularity is to save ROM space. When the DMG was first released, memory was pretty expensive ...
Read now
Unlock full access