public LabelArg(string[] args, Chip chip) { if (args.Length != 1) { throw new InstructionValidationException("Must take a single label arg"); } if (!chip.HasLabel(args[0])) { throw new InstructionValidationException($"The label {args[0]} does not exist."); } Label = args[0]; }
public JmpInstruction(Chip chip, string[] args, int relativePos, int actualPos, TestPrefix testPrefix) : base(chip, relativePos, actualPos, testPrefix) { if (args.Length != 1) { throw new InstructionValidationException("Must take a single label arg"); } if (!chip.HasLabel(args[0])) { throw new InstructionValidationException($"The label {args[0]} does not exist."); } label = args[0]; }