// DEC static byte[] DEC(string ins) { try { byte[] b = new byte[2]; var dst = ins.Split(' ')[1].Split(',')[0]; b[0] = Consts.DEC; b[1] = Consts.GetByName(dst); return(b); } catch (Exception) { Error = "Fail to decode DEC"; } return(null); }
// OUT static byte[] OUT(string ins) { try { byte[] b = new byte[3]; var dst = ins.Split(' ')[1].Split(',')[0]; var val = ins.Split(' ')[1].Split(',')[1]; b[0] = Consts.OUT; b[1] = Consts.GetByName(dst); b[2] = Consts.GetByName(val); return(b); } catch (Exception) { Error = "Fail to decode OUT"; } return(null); }
// MOV static byte[] MOV(string ins) { try { byte[] b = new byte[3]; var dst = ins.Split(' ')[1].Split(',')[0]; var val = ins.Split(' ')[1].Split(',')[1]; b[0] = Consts.MOV; b[1] = Consts.GetByName(dst); b[2] = Convert.ToByte(val, 16); return(b); } catch (Exception) { Error = "Fail to decode MOV"; } return(null); }