public static void ADDWF(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            byte regValue = RAM.getRegisterValue(bank, (byte)(Befehl & 0x7F));

            if ((regValue + RAM.W) > 0xFF)
            {
                RAM.CarryBit(bank, 1);
            }
            else
            {
                RAM.CarryBit(bank, 0); //C
            }
            if (((RAM.W & 0xF) + (regValue & 0xF)) > 0xF)
            {
                RAM.DigitCarryBit(bank, 1);
            }
            else
            {
                RAM.DigitCarryBit(bank, 0); //DC, wenn die beiden Low Byte addiert >15 sind
            }
            if ((Befehl & 0x80) == 0)
            {
                RAM.ChangeW((byte)(RAM.W + regValue));
                RAM.ZeroBit(bank);
            }
            else
            {
                RAM.ChangeRegister(bank, (byte)(Befehl & 0x7F), (byte)(RAM.W + regValue));
                RAM.ZeroBit(bank, Befehl);
            }

            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }
        static void SUBWF(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            byte regValue = RAM.getRegisterValue(bank, (byte)(Befehl & 0x7F));

            if (regValue >= RAM.W)
            {
                RAM.CarryBit(bank, 1);
            }
            else
            {
                RAM.CarryBit(bank, 0); //C
            }
            if ((regValue & 0x0F) >= (RAM.W & 0x0F))
            {
                RAM.DigitCarryBit(bank, 1);
            }
            else
            {
                RAM.DigitCarryBit(bank, 0); //DC, wenn Low Byte von W
            }
            if ((Befehl & 0x80) == 0)
            {
                RAM.ChangeW((byte)(regValue - RAM.W));
                RAM.ZeroBit(bank);
            }
            else
            {
                RAM.ChangeRegister(bank, (byte)(Befehl & 0x7F), (byte)(regValue - RAM.W));
                RAM.ZeroBit(bank, Befehl);
            }

            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }
 public static void MOVF(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
 {
     if ((Befehl & 0x80) == 0)
     {
         RAM.ChangeW(bank, (byte)(Befehl & 0x7F));
         RAM.ZeroBit(bank);
     }
     else
     {
         RAM.ZeroBit(bank, Befehl);                      //lediglich Test auf Zero Bit
     }
     RAM.incInternalTimer(1);
     ++RAM.RAM[bank, 2];
 }
        public static void ADDLW(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            if (((0xFF & Befehl) + RAM.W) > 0xFF)
            {
                RAM.CarryBit(bank, 1);
            }
            else
            {
                RAM.CarryBit(bank, 0);                                 //C
            }
            if (((RAM.W & 0xF) + (Befehl & 0xF)) > 0xF)
            {
                RAM.DigitCarryBit(bank, 1);
            }
            else
            {
                RAM.DigitCarryBit(bank, 0);                              //DC, wenn die beiden Low Byte addiert >15 sind
            }
            RAM.ChangeW((byte)((0xFF & Befehl) + RAM.W));

            RAM.ZeroBit(bank);


            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }
        public static void SUBLW(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            byte tempW = RAM.W;

            if ((0xFF & Befehl) >= RAM.W)
            {
                RAM.CarryBit(bank, 1);
            }
            else
            {
                RAM.CarryBit(bank, 0);                          //C
            }
            if ((Befehl & 0x0F) >= (RAM.W & 0x0F))
            {
                RAM.DigitCarryBit(bank, 1);                                    //DC, Komplement des Subtrahenten wird addiert
            }
            else
            {
                RAM.DigitCarryBit(bank, 0);
            }

            RAM.ChangeW((byte)((0xFF & Befehl) - RAM.W));

            RAM.ZeroBit(bank);



            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }
 public static void XORLW(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
 {
     RAM.ChangeW((byte)((0xFF & Befehl) ^ RAM.W));
     RAM.ZeroBit(bank);
     ++RAM.RAM[bank, 2];
     RAM.incInternalTimer(1);
 }
 public static void CLRF(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
 {
     RAM.ChangeRegister(bank, (byte)(Befehl & 0x007F), 0);
     RAM.ZeroBit(bank, Befehl);
     ++RAM.RAM[bank, 2];
     RAM.incInternalTimer(1);
 }
        public static void CLRW(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            RAM.ChangeW(0);
            RAM.ZeroBit(bank, 0);

            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }
        public static void ANDWF(UInt16 Befehl, Arbeitsspeicher RAM, byte bank)
        {
            byte regValue = RAM.getRegisterValue(bank, (byte)(Befehl & 0x7F));

            if ((Befehl & 0x80) == 0)
            {
                RAM.ChangeW((byte)(RAM.W & regValue));
                RAM.ZeroBit(bank);
            }
            else
            {
                RAM.ChangeRegister(bank, (byte)(Befehl & 0x7F), (byte)(RAM.W & regValue));
                RAM.ZeroBit(bank, Befehl);
            }

            ++RAM.RAM[bank, 2];
            RAM.incInternalTimer(1);
        }