public void Restore(StoredCode storedCode)
 {
     _stack.Deserialize(storedCode.Stack);
     _dataStack.Deserialize(storedCode.DataStack);
     _pc   = storedCode.PC;
     _flag = storedCode.Flag;
     _script.AddVariable("Arg", storedCode.Arg);
     _script.AddVariable("Result", storedCode.Result);
 }
        public StoredCode Store()
        {
            var sc = new StoredCode();

            sc.Stack     = _stack.Serialize();
            sc.DataStack = _dataStack.Serialize();
            sc.PC        = _pc;
            sc.Flag      = _flag;

            sc.Arg    = _script.GetVariable("Arg");
            sc.Result = _script.GetVariable("Result");

            return(sc);
        }