// -= Addition =- // ADD DST SRC // Gets next memory address for DST // Gets next memory address for SRC // Adds SRC to DST public override void Execute(Mainboard mainboard) { mainboard.GetCPU().IncrementPC(); mainboard.GetCPU().FetchInstruction(mainboard.GetRAM()); CPURegister dst = mainboard.GetCPU().GetRegister(mainboard.GetCPU().GetInstruction()); mainboard.GetCPU().IncrementPC(); mainboard.GetCPU().FetchInstruction(mainboard.GetRAM()); CPURegister src = mainboard.GetCPU().GetRegister(mainboard.GetCPU().GetInstruction()); byte[] dstValue = dst.GetValue(); Maths.AddArray(ref dstValue, dstValue.Length, src.GetValue()[0]); mainboard.GetCPU().SetRegister(dst.GetRegisterID(), dstValue); }
public void IncrementPC() { Maths.AddArray(ref programCounter, memoryWidth, 1); }