Example #1
0
 private String initDescription() {
   StringBuffer buf = new StringBuffer();
   buf.append(getName());
   buf.append(spaces);
   buf.append(addr.toString());
   return buf.toString();
 }
 protected String getDescription() {
   StringBuffer buf = new StringBuffer();
   buf.append(getName());
   buf.append(spaces);
   buf.append(rs1.toString());
   buf.append(comma);
   if (operand2.isRegister()) {
     buf.append(operand2.toString());
   } else {
     int value = ((Immediate) operand2).getNumber().intValue();
     buf.append(Integer.toHexString(value));
   }
   buf.append(comma);
   buf.append(getPrivilegedRegisterName(regNum));
   return buf.toString();
 }
Example #3
0
 // capital letters in template are macros
 private String getCorrectOpcodeName(
     String oldName, int prefixes, boolean operandSize, boolean addrSize) {
   StringBuffer newName = new StringBuffer(oldName);
   int index = 0;
   for (index = 0; index < oldName.length(); index++) {
     switch (oldName.charAt(index)) {
       case 'C': /* For jcxz/jecxz */
         if (addrSize) newName.setCharAt(index, 'e');
         index++;
         break;
       case 'N':
         if ((prefixes & PREFIX_FWAIT) == 0) newName.setCharAt(index, 'n');
         index++;
         break;
       case 'S':
         /* operand size flag */
         if (operandSize == true) newName.setCharAt(index, 'l');
         else newName.setCharAt(index, 'w');
         index++;
         break;
       default:
         break;
     }
   }
   return newName.toString();
 }