Beispiel #1
0
        public override string ToString()
        {
            //string info = "AL_" + addr.ToString("X04") + " " + code.ToString();
            //if (bytes != null)
            //    info += " len=" + bytes.Length;
            //if (debugcode != null && debugline >= 0)
            //{
            //    info += "    " + debugcode + "(" + debugline + ")";
            //}

            string info = "" + addr.ToString("X04") + " " + code.ToString();

            for (var j = 0; j < 16 - code.ToString().Length; j++)
            {
                info += " ";
            }
            info += "[";
            if (bytes != null)
            {
                foreach (var c in bytes)
                {
                    info += c.ToString("X02");
                }
            }
            info += "]";

            if (debugcode != null && debugline >= 0)
            {
                info += "//" + debugcode + "(" + debugline + ")";
            }
            return(info);
        }
Beispiel #2
0
        public string GetHeader()
        {
            string name = addr.ToString("x04") + ":";

            if (op > VM.OpCode.PUSHBYTES1 && op < VM.OpCode.PUSHBYTES75)
            {
                return(name + "PUSHBYTES" + (op - VM.OpCode.PUSHBYTES1));
            }
            else
            {
                return(name + op.ToString());
            }
        }
Beispiel #3
0
        public MyJson.JsonNode_Object ToJson()
        {
            MyJson.JsonNode_Object _op = new MyJson.JsonNode_Object();
            _op.SetDictValue("addr", addr);
            _op.SetDictValue("op", op.ToString());
            if (this.stack != null)
            {
                MyJson.JsonNode_Array array = new MyJson.JsonNode_Array();
                _op.SetDictValue("stack", array);
                foreach (var r in stack)
                {
                    if (r.ind > 0)
                    {
                        array.AddArrayValue(r.type.ToString() + "|" + r.ind);
                    }
                    else
                    {
                        array.AddArrayValue(r.type.ToString());
                    }
                }
            }
            if (opresult != null)
            {
                _op.SetDictValue("result", StatkItemToJson(opresult));
            }
            if (opparam != null)
            {
                _op.SetDictValue("param", opparam.ToHexString());
            }
            if (subScript != null)
            {
                _op.SetDictValue("subscript", subScript.ToJson());
            }

            return(_op);
        }