public static Instruct Pop(StreamReader r, int offset) { r.Save(); Instruct i = null; if (r.Seek(offset)) { i = Pop(r); } r.Restore(); return(i); }
public static Instruct Pop(StreamReader r) { var i = new Instruct((byte)r.read(8)); switch (i.Function.Script) { case Script.OneParam: i.Destination = Operand.Pop(r); break; case Script.TwoParam: case Script.ThirdState: i.Destination = Operand.Pop(r); if (!i.Destination.IsNone) { i.Source = Operand.Pop(r); } break; } r.shift(); return(i); }