public int Shift(int tms, int tdi) { if (tms != 0) { tms = 1; } if (tdi != 0) { tdi = 1; } _sp.Write((byte)(0x80 | (tms << 1) | tdi)); byte ret = _sp.Read(); if (_verbose) { Console.WriteLine("tms = {0}, tdi = {1}, tdo = {2}", tms, tdi, ret); } return(ret); }