示例#1
0
        public static void SUBLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            byte result = BitwiseSubstract(k, Data.GetRegisterW());

            Data.SetRegisterW(result);
        }
示例#2
0
        public static void ADDLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            byte result = BitwiseAdd(Data.GetRegisterW(), k);

            Data.SetRegisterW(result);
        }
示例#3
0
        public static void XORLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            byte result = (byte)(Data.GetRegisterW() ^ k);

            CheckZFlag(result);
            Data.SetRegisterW(result);
        }
示例#4
0
        public static void RETLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            Data.SetRegisterW(k);
            Data.SetPC(Data.PopStack());
            Data.SetPCLfromPC();
            SkipCycle();
        }
示例#5
0
        public static void MOVF(Data.Command com)
        {
            byte d = (byte)(com.GetLowByte() & 128);
            byte f = (byte)(com.GetLowByte() & 127);

            CheckZFlag(Data.GetRegister(Data.AddressResolution(f)));
            if (d != 128)
            {
                Data.SetRegisterW(Data.GetRegister(Data.AddressResolution(f)));
            }
        }
示例#6
0
 /// <summary>
 /// Write result according to d bit (relative address)
 /// </summary>
 /// <param name="d"></param>
 /// <param name="f"></param>
 /// <param name="result"></param>
 private static void DirectionalWrite(byte d, byte f, byte result)
 {
     //save to w register
     if (d == 0)
     {
         Data.SetRegisterW(result);
     }
     //save to f address
     else if (d == 128)
     {
         Data.SetRegister(Data.AddressResolution(f), result);
     }
 }
示例#7
0
 public static void CLRW(Data.Command com)
 {
     Data.SetRegisterW(0);
     Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.Z, true);
 }
示例#8
0
        public static void MOVLW(Data.Command com)
        {
            byte k = com.GetLowByte();

            Data.SetRegisterW(k);
        }