Isolate program counter increment/decrement (to be used for HALT processing)

This commit is contained in:
Adrian Conlon
2025-05-03 23:25:06 +01:00
parent 2501bdfd28
commit cbe871d365
6 changed files with 23 additions and 30 deletions

View File

@@ -220,10 +220,14 @@ namespace EightBit
protected virtual byte BusRead() => this.Bus.Read(); // N.B. Should be the only real call into the "Bus.Read" code.
protected virtual void IncrementPC() => ++this.PC.Word;
protected virtual void DecrementPC() => --this.PC.Word;
protected virtual byte FetchByte()
{
this.Bus.Address.Assign(this.PC);
this.PC.Word++;
IncrementPC();
return this.MemoryRead();
}