Share instruction fetch and halt implementations

This commit is contained in:
Adrian Conlon
2025-05-04 11:41:28 +01:00
parent 2336222c97
commit 93e09c192f
6 changed files with 28 additions and 30 deletions

View File

@@ -96,6 +96,13 @@ namespace EightBit
}
}
protected override byte FetchInstruction()
{
var read = this.FetchByte();
return this.HALT.Lowered() ? (byte)0 : read;
}
protected void ResetWorkingRegisters()
{
this.AF.Word = this.BC.Word = this.DE.Word = this.HL.Word = (ushort)Mask.Sixteen;