Ejemplo n.º 1
0
        public override Executable Load(byte[] Input)
        {
            DIFExecuteable Return = new DIFExecuteable();
            DIFInstruction cInst = new DIFInstruction(Instruction.OpType.Null);
            byte           cNow; int cPos = 0;

            while (cPos < Input.Length)
            {
                cNow = Input[cPos];
                switch (cNow)
                {
                case 0:
                    if (cInst.Op == Instruction.OpType.Null)
                    {
                        cInst = new DIFInstruction(OpTypeFromByte(Input[++cPos]));
                    }
                    else
                    {
                        cInst.Param.Add(cNow);
                    }
                    break;

                case 255:
                    Return.AddInst(cInst);
                    cInst = new DIFInstruction(Instruction.OpType.Null);
                    break;

                default:
                    cInst.Param.Add(cNow);
                    break;
                }
                cPos++;
            }
            return(Return);
        }
Ejemplo n.º 2
0
 public void AddInst(DIFInstruction ins)
 {
     insts.Add(ins);
 }