+ public default MicroInstruction createDefaultInstruction()
+ {
+ int size = size();
+ MicroInstructionParameter[] params = new MicroInstructionParameter[size];
+ ParameterClassification[] classes = getParameterClassifications();
+ for(int i = 0; i < size; i++)
+ {
+ MicroInstructionParameter newParam;
+ ParameterClassification classification = classes[i];
+ ParameterType type = classification.getExpectedType();
+ switch(type)
+ {
+ case BOOLEAN_IMMEDIATE:
+ case MNEMONIC:
+ newParam = ((MnemonicFamily) classification).get(0);
+ break;
+ case INTEGER_IMMEDIATE:
+ newParam = new IntegerImmediate(BigInteger.valueOf(0), ((IntegerClassification) classification).getExpectedBits());
+ break;
+ default:
+ throw new IllegalStateException("Unknown ParameterType " + type);
+ }
+ params[i] = newParam;
+ }
+ return new StandardMicroInstruction(params);
+ }
+