private static MachineCode AssembleSourceInstruction([NotNull] SourceInstruction instruction) { var registry = Constants.Instructions.GetRegistry(); var native = registry.TryFind(instruction.Format); if (native == null) { throw new ArgumentException("Unknown Instruction: " + instruction.Format); } return(native.AssembleWithOperands(instruction.Operands)); }
/// <summary> /// Construct with only an instruction. /// </summary> public TokenizedSourceLine([NotNull] SourceInstruction instruction) : this(null, instruction) { }
// Constructors /////////////////////////////////////////////////////// /// <summary> /// Construct with optional label definition and instruction. /// </summary> public TokenizedSourceLine([CanBeNull] LabelDefinition label = null, [CanBeNull] SourceInstruction instruction = null) { Label = label; Instruction = instruction; }