aboutsummaryrefslogtreecommitdiff
path: root/src/memory.rs
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-11 09:57:39 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-11 09:57:39 -0700
commitb26175e8eb6b4e6b12a2478e1bb5321fc5af6b72 (patch)
tree54303cbb6f1f4e3cbad2e7545e8c12510b3e4a85 /src/memory.rs
parentab4ba59cca5094f15987ab16bddbd0ca4ea50a62 (diff)
Correct ReverseMmu (map 0 to present address)
Diffstat (limited to 'src/memory.rs')
-rw-r--r--src/memory.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/memory.rs b/src/memory.rs
index 768ce59..83f53af 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -155,7 +155,7 @@ impl ReverseMmu {
impl Mmu for ReverseMmu {
fn translate(&self, address: isa::Address) -> isa::Address {
let offset = address % 4;
- (self.top - (address - offset)) + offset
+ (self.top - 4 - (address - offset)) + offset
}
}