diff options
Diffstat (limited to 'qtmips_machine/alu.cpp')
-rw-r--r-- | qtmips_machine/alu.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qtmips_machine/alu.cpp b/qtmips_machine/alu.cpp index 36b1ac7..176a9a5 100644 --- a/qtmips_machine/alu.cpp +++ b/qtmips_machine/alu.cpp @@ -21,9 +21,11 @@ std::uint32_t machine::alu_operate(enum AluOp operation, std::uint32_t s, std::u // Note: same note as in case of SRA return (std::int32_t)t >> s; case ALU_OP_JR: - case ALU_OP_JALR: // Do nothing as we solve this when we are handling program counter in instruction decode (handle_pc) return 0; + case ALU_OP_JALR: + // Pass return value in rt to save PC after isntruction, program counter is handled in handle_pc + return t; case ALU_OP_MOVZ: // We do this just to implement valid alu operation but we have to evaluate comparison outside of this function to disable register write return t == 0 ? s : 0; |