def convert2asm(self):
    asm = name = self.solution[self.instr_name]
    format = self.solution[self.instr_format]
    category = self.solution[self.instr_category]
    src2 = self.solution[self.instr_src2]
    src1 = self.solution[self.instr_src1]
    destination = self.solution[self.instr_rd]
    csr = self.solution[self.csr]

    if category != "SYSTEM":
      if format == "J_FORMAT" or format == "U_FORMAT":
        asm += " {}, {}".format(destination, self.get_imm())
      elif format == "I_FORMAT":
        if name == "NOP":
          asm = "nop"
        elif name == "FENCE":
          asm = "fence"
        elif name == "FENCEI":
          asm = "fence.i"
        elif category == "LOAD":
          asm += " {}, {}({})".format(destination, self.get_imm(), src1)
        elif category == "CSR":
          asm += " {}, {}, {}".format(destination, hex(csr), self.get_imm())
        else:
          asm += " {}, {}, {}".format(destination, src1, self.get_imm())
      elif format == "S_FORMAT" or format == "B_FORMAT":
        if category == "STORE":
          asm += " {}, {}({})".format(src2, self.get_imm(), src1)
        else:
          asm += " {}, {}, {}".format(src1, src2, self.get_imm())
      elif format == "R_FORMAT":
        if category == "CSR":
          asm += " {}, {}, {}".format(destination, hex(csr), src1)
        else:
          asm += " {}, {}, {}".format(destination, src1, src2)
    else:
      if name == "BREAK":
        asm = ".option norvc;ebreak;.option rvc;"
    if self.comment != "":
      asm += " # {}".format(self.comment)
    return asm.lower()