예제 #1
0
 public static void RETFIE(Data.Command com)
 {
     Data.SetPC(Data.PopStack());
     Data.SetPCLfromPC();
     Data.SetRegisterBit(Data.Registers.INTCON, Data.Flags.Intcon.GIE, true); //Re-enable Global-Interrupt-Bit
     SkipCycle();
 }
예제 #2
0
 public static void SLEEP(Data.Command com)
 {
     CLRWDT(null);
     Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.TO, true);
     Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.PD, false);
     Data.SetSleeping(true);
     Data.SetPC(Data.GetPC() - 1);
 }
예제 #3
0
        public static void RETLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            Data.SetRegisterW(k);
            Data.SetPC(Data.PopStack());
            Data.SetPCLfromPC();
            SkipCycle();
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public static void RETURN(Data.Command com)
 {
     Data.SetPC(Data.PopStack());
     Data.SetPCLfromPC();
     SkipCycle();
 }