Define CPU registers

This commit is contained in:
Franco Colmenarez 2021-10-11 10:53:02 -05:00
parent c6246a9502
commit 9818c57854
2 changed files with 29 additions and 0 deletions

28
src/cpu.rs Normal file
View File

@ -0,0 +1,28 @@
pub enum Register {
A(u8),
B(u8),
C(u8),
D(u8),
E(u8),
F(u8),
H(u8),
L(u8),
SP(u16),
PC(u16),
}
pub struct Registers {
a: Register,
b: Register,
c: Register,
d: Register,
e: Register,
f: Register,
h: Register,
sp: Register,
pc: Register,
}
pub struct CPU {
registers: Registers,
}

View File

@ -0,0 +1 @@
pub mod cpu;