mirror of
https://github.com/FranLMSP/rmg-001.git
synced 2024-11-23 10:12:11 +00:00
Define CPU registers
This commit is contained in:
parent
c6246a9502
commit
9818c57854
28
src/cpu.rs
Normal file
28
src/cpu.rs
Normal 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,
|
||||
}
|
@ -0,0 +1 @@
|
||||
pub mod cpu;
|
Loading…
Reference in New Issue
Block a user