public static void SUBLW(Data.Command com) { byte k = com.GetLowByte(); byte result = BitwiseSubstract(k, Data.GetRegisterW()); Data.SetRegisterW(result); }
public static void ADDLW(Data.Command com) { byte k = com.GetLowByte(); byte result = BitwiseAdd(Data.GetRegisterW(), k); Data.SetRegisterW(result); }
public static void XORLW(Data.Command com) { byte k = com.GetLowByte(); byte result = (byte)(Data.GetRegisterW() ^ k); CheckZFlag(result); Data.SetRegisterW(result); }
public static void RETLW(Data.Command com) { byte k = com.GetLowByte(); Data.SetRegisterW(k); Data.SetPC(Data.PopStack()); Data.SetPCLfromPC(); SkipCycle(); }
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))); } }
/// <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); } }
public static void CLRW(Data.Command com) { Data.SetRegisterW(0); Data.SetRegisterBit(Data.Registers.STATUS, Data.Flags.Status.Z, true); }
public static void MOVLW(Data.Command com) { byte k = com.GetLowByte(); Data.SetRegisterW(k); }