aboutsummaryrefslogtreecommitdiff
path: root/src/cpu.rs
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2026-01-04 18:39:25 +0530
committerkrolxon <krolyxon@tutanota.com>2026-01-04 18:39:25 +0530
commit4809d7159f373a358da4932571e2219b39b561ed (patch)
treee4251acc18ebe6419e3b55cccf3efbf0099ee6f5 /src/cpu.rs
initial commit
Diffstat (limited to 'src/cpu.rs')
-rw-r--r--src/cpu.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cpu.rs b/src/cpu.rs
new file mode 100644
index 0000000..8b63433
--- /dev/null
+++ b/src/cpu.rs
@@ -0,0 +1,22 @@
+#[derive(Default)]
+#[derive(Debug)]
+pub struct CPU{
+ pub a: u8,
+ pub b: u8,
+ pub c: u8,
+ pub d: u8,
+
+ pub pc: u16,
+ pub sp: u16,
+
+ pub zero: bool,
+ pub carry: bool,
+
+ pub halted: bool,
+}
+
+impl CPU {
+ pub fn inc_cp(&mut self) {
+ self.pc += 1;
+ }
+}