Shortened the memory test a bit because it was longer than necessary
[Mograsim.git] / net.mograsim.machine / src / net / mograsim / machine / mi / parameters / IntegerClassification.java
index 1a5003f..c24cabe 100644 (file)
@@ -2,15 +2,18 @@ package net.mograsim.machine.mi.parameters;
 
 import java.math.BigInteger;
 
+import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.machine.mi.parameters.MicroInstructionParameter.ParameterType;
 
 public class IntegerClassification implements ParameterClassification
 {
        private final int bits;
+       private final IntegerImmediate defaultValue;
 
-       public IntegerClassification(int bits)
+       public IntegerClassification(int defaultValue, int bits)
        {
                this.bits = bits;
+               this.defaultValue = new IntegerImmediate(BitVector.from(defaultValue, bits));
        }
 
        @Override
@@ -30,4 +33,10 @@ public class IntegerClassification implements ParameterClassification
        {
                return new IntegerImmediate(new BigInteger(toParse), bits);
        }
+
+       @Override
+       public MicroInstructionParameter getDefault()
+       {
+               return defaultValue;
+       }
 }