1 package net.mograsim.machine.mi.parameters;
3 import net.mograsim.logic.core.types.BitVector;
4 import net.mograsim.machine.mi.parameters.MicroInstructionParameter.ParameterType;
6 public class BooleanClassification extends MnemonicFamily
8 String trueName, falseName;
10 public BooleanClassification(boolean defaultValue, String trueName, String falseName)
12 super(defaultValue ? trueName : falseName, new MnemonicPair("X", BitVector.SINGLE_0),
13 new MnemonicPair(trueName, BitVector.SINGLE_1), new MnemonicPair(falseName, BitVector.SINGLE_0));
14 this.trueName = trueName;
15 this.falseName = falseName;
18 public BooleanClassification(String trueName, String falseName)
20 super("X", new MnemonicPair("X", BitVector.SINGLE_0), new MnemonicPair(trueName, BitVector.SINGLE_1),
21 new MnemonicPair(falseName, BitVector.SINGLE_0));
22 this.trueName = trueName;
23 this.falseName = falseName;
26 public Mnemonic get(boolean value)
28 return get(value ? trueName : falseName);
32 public ParameterType getExpectedType()
34 return ParameterType.BOOLEAN_IMMEDIATE;
38 public int getExpectedBits()