public void UpdateCpuState(CpuState state) { Registers.First(r => r.RegisterName == "PC").Value = state.PC; Registers.Find(r => r.RegisterName == "Stack").Value = state.Stack; for (int i = 0; i < 32; i++) { Registers.Find(r => r.RegisterName == $"R{i}").Value = state.Registers[i]; } }
/// <summary>Shortcut per ottenere il registro dato un nome</summary> public Register GetRegisterByName(string name) { return(Registers.Find(r => r.Name == name)); }