diff options
| author | taitep <taitep@taitep.se> | 2025-12-22 18:28:31 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-22 18:28:31 +0100 |
| commit | e00103375ddf2ccece47a7db0ee5fca3fc3d3502 (patch) | |
| tree | f8ca20be167a6503907bb38bec7f152234bca6a6 | |
| parent | 7177633477f1b9851a949c2c7b005185c3925b23 (diff) | |
Fix page offset miscalculation in instruction fetch
| -rw-r--r-- | src/core.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.rs b/src/core.rs index 08f029b..27ccf3f 100644 --- a/src/core.rs +++ b/src/core.rs @@ -38,7 +38,7 @@ impl Core { pub fn run(&mut self) { loop { let page = (self.pc / 4096) as usize; - let offset = (self.pc / 4) as u16; + let offset = (self.pc % 4096 / 4) as u16; if !self.pc.is_multiple_of(4) { //replace eprint with logging, replace break with exception eprintln!("PC not aligned"); |
