public bool Step(bool updateGUI) { prevClock = clock; if (CheckInterrupt()) { if (updateGUI) { OnStepGUIUpdate(new UpdateEventArgs <byte>()); } return(true); } UInt16 data = CodeExecution.Fetch(); if (data == UInt16.MaxValue) { return(false); //end of code has been reached } this.pc++; //increment pc after fetch CodeExecution.Instruction instruction = CodeExecution.Decode(data); bool success = CodeExecution.Execute(instruction, data); //refresh gui after if (updateGUI) { OnStepGUIUpdate(new UpdateEventArgs <byte>()); } return(success); }
private async void ExecuteButtonClick(object sender, RoutedEventArgs e) { stopButton.IsEnabled = true; executeButton.IsEnabled = false; token = new CancellationTokenSource(); ct = token.Token; var codeExe = new CodeExecution(); void Action(string str) => this.Dispatcher.Invoke(delegate { this.Console.SendMessage(str); }); await Task.Factory.StartNew(() => codeExe.Execute(scene.Graph, Action), ct); stopButton.IsEnabled = false; executeButton.IsEnabled = true; }
private async void ExecuteButtonClick(object sender, RoutedEventArgs e) { this.stopButton.IsEnabled = true; this.executeButton.IsEnabled = false; this.token = new CancellationTokenSource(); this.cancellationToken = this.token.Token; var codeExe = new CodeExecution(); var t = this.model.Repo.Model("AirSimModel"); void Action(string str) => this.Dispatcher.Invoke(() => this.Console.SendMessage(str)); await Task.Factory.StartNew(() => codeExe.Execute(t, Action), this.cancellationToken); this.stopButton.IsEnabled = false; this.executeButton.IsEnabled = true; }
void Interrupt() { dataMem.ClearFlag((byte)RegisterAddress.INTCON, 7); CodeExecution.Execute(CodeExecution.Instruction.CALL, 0b_00100000_00000100); }