summaryrefslogtreecommitdiff
path: root/src/instructions
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-22 18:00:15 +0100
committertaitep <taitep@taitep.se>2025-12-22 18:00:15 +0100
commit7177633477f1b9851a949c2c7b005185c3925b23 (patch)
tree937b697bee446869afcbc40924c52b3b326c4648 /src/instructions
parent48477bd8b1896aa71c6e4ea4cde218499ef5016a (diff)
WHY WAS I USING S-TYPE IMMEDIATE IN LD (also add some more debugging info on an exception)
Diffstat (limited to 'src/instructions')
-rw-r--r--src/instructions/rvi.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs
index f182e88..0920e80 100644
--- a/src/instructions/rvi.rs
+++ b/src/instructions/rvi.rs
@@ -62,7 +62,7 @@ pub fn sd(core: &mut Core, instr: Instruction) -> InstructionResult {
}
pub fn ld(core: &mut Core, instr: Instruction) -> InstructionResult {
- let addr = core.reg_read(instr.rs1()).wrapping_add(instr.imm_s());
+ let addr = core.reg_read(instr.rs1()).wrapping_add(instr.imm_i());
if !addr.is_multiple_of(std::mem::size_of::<DWord>() as Addr) {
return InstructionResult::Exception(());