This commit is contained in:
Michael Smith
2025-08-13 17:54:55 +02:00
parent 3cb7e3a5c9
commit b72667947f
7 changed files with 210 additions and 39 deletions

22
gb/instructions.go Normal file
View File

@@ -0,0 +1,22 @@
package gb
import (
"fmt"
)
var instructions = map[byte]string{
0x00: "NOP",
0x01: "FOO",
}
type Instruction struct {
}
func InstructionByOpcode(opcode byte) (string, error) {
instruction, ok := instructions[opcode]
if !ok {
return "", fmt.Errorf("Unknown opcode: %02X", opcode)
}
return instruction, nil
}