Ejemplo n.º 1
0
        public static int Compare(ObjectCodeInfo info1, ObjectCodeInfo info2)
        {
            int compareOperator = info1.m_operator.CompareTo(info2.m_operator),
                compare1        = CompareObject(info1.m_value1, info2.m_value1),
                compare2        = CompareObject(info1.m_value2, info2.m_value2),
                compare3        = CompareObject(info1.m_value3, info2.m_value3);

            if (compareOperator == 0)
            {
                if (compare1 == 0)
                {
                    if (compare2 == 0)
                    {
                        return(compare3);
                    }
                    else
                    {
                        return(compare2);
                    }
                }
                else
                {
                    return(compare1);
                }
            }
            else
            {
                return(compareOperator);
            }
        }
Ejemplo n.º 2
0
        public static List <byte> LookupByteArray(AssemblyOperator objectOp,
                                                  object operand1 = null, object operand2 = null,
                                                  object operand3 = null)
        {
            if ((objectOp == AssemblyOperator.shl) ||
                (objectOp == AssemblyOperator.shr))
            {
                operand1 = (operand1 is BigInteger) ? 0L : operand1;
                operand2 = (operand2 is BigInteger) ? 0L : operand2;
                operand3 = (operand3 is BigInteger) ? 0L : operand3;
            }

            ObjectCodeInfo info =
                new ObjectCodeInfo(objectOp, operand1, operand2, operand3);

            byte[] byteArray = ObjectCodeTable.MainArrayMap[info];
            Assert.ErrorXXX(byteArray != null);
            List <byte> byteList = new List <byte>();

            foreach (byte b in byteArray)
            {
                byteList.Add(b);
            }

            return(byteList);
        }