Пример #1
0
        // -= 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);
        }
Пример #2
0
 public void IncrementPC()
 {
     Maths.AddArray(ref programCounter, memoryWidth, 1);
 }