diff options
author | Oxore <oxore@protonmail.com> | 2019-07-14 01:30:57 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2019-07-14 13:59:20 +0300 |
commit | 24e3ef936efd5b9239de76088efa02d06537ceb6 (patch) | |
tree | 2ec8875dcd264e9b145946cdc9f21d86f2da5d27 /src/core.rs |
Initial commit
Implement CLI and CPU core skeletons
Diffstat (limited to 'src/core.rs')
-rw-r--r-- | src/core.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core.rs b/src/core.rs new file mode 100644 index 0000000..0062e1c --- /dev/null +++ b/src/core.rs @@ -0,0 +1,14 @@ +pub struct Core { + pc: u16, +} + +impl Core { + pub fn new() -> Self { + Core { pc: 0 } + } + + pub fn step(&mut self) -> u16 { + self.pc += 1; + self.pc + } +} |