diff --git a/EightBit/IntelProcessor.cs b/EightBit/IntelProcessor.cs index 292cf52..e38e719 100644 --- a/EightBit/IntelProcessor.cs +++ b/EightBit/IntelProcessor.cs @@ -70,7 +70,6 @@ namespace EightBit { RaisingHALT?.Invoke(this, EventArgs.Empty); this.HALT.Raise(); - this.PC.Increment(); RaisedHALT?.Invoke(this, EventArgs.Empty); } } diff --git a/LR35902/LR35902.cs b/LR35902/LR35902.cs index a0efed9..a05940c 100644 --- a/LR35902/LR35902.cs +++ b/LR35902/LR35902.cs @@ -13,6 +13,7 @@ namespace LR35902 { this.bus = bus; this.RaisedPOWER += this.LR35902_RaisedPOWER; + this.RaisingHALT += this.LR35902_RaisingHALT; } private readonly Bus bus; @@ -230,6 +231,7 @@ namespace LR35902 this.Execute(this.FetchInstruction()); } } + private void LR35902_RaisedPOWER(object? sender, EventArgs e) { this.RaiseWR(); @@ -238,6 +240,11 @@ namespace LR35902 this.EI = false; } + private void LR35902_RaisingHALT(object? sender, EventArgs e) + { + this.PC.Increment(); + } + protected override void HandleRESET() { base.HandleRESET();