1 package net.mograsim.machine.mi;
3 import net.mograsim.logic.core.types.BitVector;
4 import net.mograsim.machine.mi.parameters.MicroInstructionParameter;
5 import net.mograsim.machine.mi.parameters.Mnemonic;
7 public interface MicroInstruction
10 public MicroInstructionParameter getParameter(int index);
12 public void setParameter(int index, MicroInstructionParameter param);
15 * @return The amount of {@link Mnemonic}s, the instruction is composed of
19 public static MicroInstruction create(Runnable updateCallback, MicroInstructionParameter... parameters)
21 return new StandardMicroInstruction(updateCallback, parameters);
24 default BitVector toBitVector()
26 BitVector vector = BitVector.of();
28 for (int i = 0; i < size; i++)
29 vector = vector.concat(getParameter(i).getValue());