diff options
| author | krolxon <krolyxon@tutanota.com> | 2026-01-04 18:39:25 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2026-01-04 18:39:25 +0530 |
| commit | 4809d7159f373a358da4932571e2219b39b561ed (patch) | |
| tree | e4251acc18ebe6419e3b55cccf3efbf0099ee6f5 /src/cpu.rs | |
initial commit
Diffstat (limited to 'src/cpu.rs')
| -rw-r--r-- | src/cpu.rs | 22 |
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; + } +} |
