From c9a136d595c53d217148f0764c860e545b1ae303 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sat, 22 May 2021 21:05:14 +0200 Subject: [PATCH] [instructions] fixed error in auipc command --- riscemu/instructions/RV32I.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/riscemu/instructions/RV32I.py b/riscemu/instructions/RV32I.py index 20a64aa..d8681d0 100644 --- a/riscemu/instructions/RV32I.py +++ b/riscemu/instructions/RV32I.py @@ -154,8 +154,7 @@ class RV32I(InstructionSet): ASSERT_LEN(ins.args, 2) reg = ins.get_reg(0) imm = to_unsigned(ins.get_imm(1)) - self.pc += (imm << 12) - self.regs.set(reg, self.pc) + self.regs.set(reg, self.pc + (imm << 12)) def instruction_xor(self, ins: 'LoadedInstruction'): rd, rs1, rs2 = self.parse_rd_rs_rs(ins)