public IOperationResult Execute(AssemblyChip chip) { var source = Source.Reference(chip); var destination = Destination.Reference(chip); if (state == MovState.Reading && source.IsReadyToRead()) { destination.Write(source.Read()); state = MovState.Writing; } if (state == MovState.Writing && destination.IsDoneWriting()) { state = MovState.Reading; return OperationResult.Advance; } return OperationResult.Block; }
public Mov(RWRef source, RWRef destination) { this.Source = source; this.Destination = destination; this.state = MovState.Reading; }