private Argument(byte value, ushort? nextWord = null, Label nextLabel = null) { this.isValid = true; this.value = value; this.nextWord = nextWord; this.nextLabel = nextLabel; }
public Label DefineLabel() { AssertNotFinished(); Label label = new Label(this); labels.Add(label); return label; }
private void ValidateLabel(Label label) { if (label.Generator != this) throw new ArgumentException("Label must be defined in this generator."); }
public void MarkLabel(Label label) { AssertNotFinished(); ValidateLabel(label); if (label.MarkedPosition != null) throw new CodeGenerationException("label already marked another position."); label.MarkedPosition = checked((ushort)(CurrentBytePosition / 2)); }
public void EmitData(Label label) { AssertNotFinished(); ushort? nextWord; GetArgumentValue(label, CurrentBytePosition, out nextWord); WriteWord(stream, 0x0000); }
public static Argument Literal(ushort value, Label address = null) { if (address == null && value <= 0x1f) return new Argument((byte)(0x20 + value)); else return new Argument(0x1f, value, address); }
public static Argument Indirect(ushort offset, Label address = null) { return new Argument(0x1e, offset, address); }
public static Argument Indirect(ushort offset, Register register, Label address = null) { ValidateRegister(register); return new Argument((byte)(0x10 + register), offset, address); }