From 9d7d84c7f81399eb7318d6fc2d73f0686e595718 Mon Sep 17 00:00:00 2001 From: mariusmonton Date: Wed, 7 Nov 2018 18:43:10 +0100 Subject: [PATCH] bugs! --- inc/C_Instruction.h | 4 ++++ src/Execute.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/C_Instruction.h b/inc/C_Instruction.h index b898495..225f017 100644 --- a/inc/C_Instruction.h +++ b/inc/C_Instruction.h @@ -259,6 +259,10 @@ public: aux |= m_instr[6] << 7; aux |= m_instr.range(5,3) << 1; aux |= m_instr[2] << 5; + + if (m_instr[12] == 1) { + aux |= 0b1111 << 12; + } return aux; } diff --git a/src/Execute.cpp b/src/Execute.cpp index 25b4435..b99703e 100644 --- a/src/Execute.cpp +++ b/src/Execute.cpp @@ -39,7 +39,7 @@ void Execute::AUIPC(Instruction &inst) { } void Execute::JAL(Instruction &inst, bool c_extension, int m_rd) { - int32_t mem_addr = 0; + int16_t mem_addr = 0; int rd; int new_pc, old_pc;