public static void CALL(Data.Command com) { byte k1 = com.GetLowByte(); byte k2 = (byte)(com.GetHighByte() & 7); byte merge = (byte)((Data.GetRegister(Data.Registers.PCLATH) & 24) + k2); Data.PushStack(); Data.SetPCFromBytes(merge, k1); Data.SetPCLfromPC(); SkipCycle(); }
private static void CallInterrupt() { Data.PushStack(); Data.SetPC(0x04); //Fixed interrupt routine address Data.SetRegisterBit(Data.Registers.INTCON, Data.Flags.Intcon.GIE, false); //Disable Global-Interrupt-Bit if (Data.IsSleeping()) { Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.TO, true); Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.PD, false); Data.IncPC(); Data.SetSleeping(false); } }