asm_mnemonic = "t"+common_opt+"i";
asm_mnemonic = ((opcode == 2) ? "td" : "tw")+common_opt+"i";
  static String decode_Dform(int inst, int opcode)  {    int rt, RA, TO, BF, FRT,ufield;    int sfield;    opcode_tab opcode_info;    String datafield, mnemonic, asm_mnemonic, common_opt;        rt = TO = FRT = bits(inst, 6, 10);    RA = bits(inst, 11, 15);    BF = bits(inst,6,8);    ufield = inst & 0xffff;    sfield = (inst << 16) >> 16;    if (sfield < 0) {      datafield = ""+sfield;    } else {      datafield = intAsHexString(sfield);    }    opcode_info = Dform[opcode];    mnemonic = opcode_info.mnemonic;        switch(opcode_info.format)      {      case 0:        if (opcode != 15) {          return "        ".substring(mnemonic.length()) + mnemonic +            "   "+rname(rt)+","+rname(RA)+","+datafield;        } else {          if (RA != 0) {            return "        ".substring(mnemonic.length()) + mnemonic +              "   "+rname(rt)+","+rname(RA)+","+intAsHexString(ufield);          } else {            return "     liu   "+              rname(rt)+","+intAsHexString(ufield);          }        }      case 1:        return "        ".substring(mnemonic.length()) + mnemonic +          "   "+rname(RA)+","+rname(rt)+","+intAsHexString(ufield);      case 2:        if ((opcode == 14) && (RA == 0)) {          return "     lil" +            "   "+rname(rt)+","+datafield;        } else {          return "        ".substring(mnemonic.length()) + mnemonic +            "   "+rname(rt)+","+datafield+"("+rname(RA)+")";        }      case 3: /* Trap immediate */        common_opt = TO_ext(TO);        asm_mnemonic = "t"+common_opt+"i";        if (common_opt!=null) {          return "        ".substring(asm_mnemonic.length()) + asm_mnemonic +            "   "+rname(RA)+","+datafield;        } else {          return "        ".substring(mnemonic.length()) + mnemonic +            "   "+TO+","+rname(RA)+","+datafield;        }      case 4:        int L = inst & 0x00200000;        if (opcode == 11) {          return "       ".substring(mnemonic.length()) + mnemonic + ((L==0)?"W":"D") +            "   cr"+BF+","+rname(RA)+","+datafield;        } else {          return "       ".substring(mnemonic.length()) + mnemonic + ((L==0)?"W":"D") +            "   cr"+BF+","+rname(RA)+","+ufield;        }      case 5:        return "        ".substring(mnemonic.length()) + mnemonic +          "   fr"+FRT+","+rname(RA)+","+datafield;      default:        return "    Invalid opcode";      }  }