summaryrefslogtreecommitdiff
path: root/src/mem.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-30 20:18:23 +0100
committertaitep <taitep@taitep.se>2025-12-30 20:18:23 +0100
commit5a383956c9ee27d50452aa237a9f34b7f75e8f7c (patch)
treed49a782dfb068e3165825569084c23872ca9d83d /src/mem.rs
parent6a0e5e63c13c4cb480233106d2043f2706bd5183 (diff)
Improve exception dumps and general debug info, make the emulator capable of running the riscv ISA tests, and perform some general fixes i found while making it pass the tests for RV64I
Diffstat (limited to 'src/mem.rs')
-rw-r--r--src/mem.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mem.rs b/src/mem.rs
index e3cbe82..a3b087c 100644
--- a/src/mem.rs
+++ b/src/mem.rs
@@ -263,8 +263,8 @@ impl Ram {
if !addr.is_multiple_of(8) {
let high_word_addr = addr.wrapping_add(4);
- let low_word = self.read_byte(addr)?;
- let high_word = self.read_byte(high_word_addr)?;
+ let low_word = self.read_word(addr)?;
+ let high_word = self.read_word(high_word_addr)?;
return Ok((low_word as u64) | (high_word as u64) << 32);
}