basic memory and cpu

This commit is contained in:
radumacocian
2025-04-17 18:02:33 +02:00
parent e955649be0
commit 6948e84b32
8 changed files with 138 additions and 2 deletions

29
cpu/cpu.go Normal file
View File

@@ -0,0 +1,29 @@
package cpu
import (
"radu.macocian.me/goboy/memory"
)
type cpu_struct struct {
A int8
F int8
B int8
C int8
D int8
E int8
H int8
L int8
IR int8
IE int8
PC int16
SP int16
}
var cpu = new(cpu_struct)
func Execute(addr int) {
instr := memory.Read(addr + int(cpu.PC))
cpu.PC++
print(string(instr))
}