Skip to content

Commit

Permalink
Fix incorrect disassembly of LUI and AUIPC instructions (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkevin-arch committed Feb 28, 2020
1 parent 2c87904 commit f65fd44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/utils/disassembler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ object Disassembler {
*
*/
def parseAuipc(instr:Instruction):String={
"lui x" + instr.rd + " " + instr.uImm
"auipc x" + instr.rd + " " + instr.uImm
}

/** Decodes Lui instruction
*
*/
def parseLui(instr:Instruction):String={
"auipc x" + instr.rd + " " + instr.uImm
"lui x" + instr.rd + " " + instr.uImm
}

/** Disassembles any of the RV32I instructions
Expand All @@ -181,8 +181,8 @@ object Disassembler {
case BRANCH_OPCODE => parseBranch(instr)
case JAR_OPCODE => parseJal(instr)
case JALR_OPCODE => parseJalr(instr)
case AUIPC_OPCODE => parseBranch(instr)
case LUI_OPCODE => parseBranch(instr)
case AUIPC_OPCODE => parseAuipc(instr)
case LUI_OPCODE => parseLui(instr)
case _ => "Unknown"
}
}
Expand Down

0 comments on commit f65fd44

Please sign in to comment.