Esempio n. 1
0
File: Mov.cs Progetto: embix/TIS100
        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;
        }
Esempio n. 2
0
File: Mov.cs Progetto: embix/TIS100
 public Mov(RWRef source, RWRef destination)
 {
     this.Source = source;
     this.Destination = destination;
     this.state = MovState.Reading;
 }