Ejemplo n.º 1
0
 public AdressModeData(AdressModeBase parent, byte[] rock, bool isOutput)
 {
     this.isOutput = isOutput;
     this.parent = parent;
     this.rock = rock;
 }
Ejemplo n.º 2
0
        AdressModeData[] getAddrData(OpcodeData data, int startPos, bool setParsePos)
        {
            int inputv = data.numInVariables;
            int outputv = data.numOutVariables;
            AdressModeBase[] output = new AdressModeBase[inputv + outputv];
            int parseIndex=0;

            for (int k = 0; k < (inputv + outputv); k++) //I is set elsewhere
            {

                parseIndex = (k) / 2;
                byte value;
                if (k % 2 == 0)
                {
                    value = (byte)(mainMemory[parseIndex + startPos]%16);
                }
                else
                {
                    value = (byte)(mainMemory[parseIndex + startPos] / 16);
                }
                output[k] = getAddrBase(value);
            }

            parseIndex = (inputv + outputv + 1) / 2;

            List<byte>[] values = new List<byte>[output.Length];
            for (int k=0; k<values.Length; k++)
            {
                values[k] = new List<byte>();
            }
            int j=0;
            foreach (AdressModeBase addrb in output)
            {
                for (int k=0; k < addrb.numBytes; k++) {
                    values[j].Add(mainMemory[parseIndex + startPos]);
                    parseIndex += 1;
                }
                j += 1;
            }

            AdressModeData[] newOutput = new AdressModeData[output.Length];
            for (int k=0; k<output.Length; k++)
            {
                newOutput[k] = new AdressModeData(output[k], values[k].ToArray(), k >= inputv);
            }

            if (setParsePos)
            {
                parsePos = parseIndex + startPos;
            }

            return newOutput;
        }