diff options
author | Oxore <oxore@protonmail.com> | 2019-11-19 01:38:14 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2019-11-19 01:38:14 +0300 |
commit | 1cbcbb5e2912c59b9c176dfd46e863e2bee045e1 (patch) | |
tree | 1df87343a9509fcac8de6765ee34cff299a4df13 /src/core.rs | |
parent | 2376146fe9ceee4429b77c4364eaf52ce57dd80c (diff) |
Implement getter for PC in Core, print offset for each instruction
Diffstat (limited to 'src/core.rs')
-rw-r--r-- | src/core.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core.rs b/src/core.rs index 1ec7bae..a3b4541 100644 --- a/src/core.rs +++ b/src/core.rs @@ -328,6 +328,11 @@ impl Core { self.pc } + /// Get current Program Counter value + pub fn pc(&self) -> u16 { + self.pc + } + /// Get current instruction pub fn op(&self) -> Op { let op = IncompleteOp::from_u8(self.rom.array[self.pc as usize]); |