Esempio n. 1
0
            public int Compare(object v1, object v2)
            {
                AddressLabelPair p1 = (AddressLabelPair)v1;
                AddressLabelPair p2 = (AddressLabelPair)v2;

                return((int)p1.Address - (int)p2.Address);
            }
Esempio n. 2
0
        }//LabelToAddress

        /// <summary>
        /// Return a list of address-label pairs sorted by address
        /// </summary>
        public AddressLabelPair[] CodeLabelList()
        {
            int size = 0;
            IDictionary <string, uint> cl;

            foreach (string filename in _fileSections.Keys)
            {
                cl    = CodeSectionLabels(filename);
                size += cl.Count;
                cl    = DataSectionLabels(filename);
                size += cl.Count;
            }
            AddressLabelPair[] result = new AddressLabelPair[size];
            int len = 0;

            System.Collections.IComparer cmp = new AddressPairComparer();
            foreach (string filename in _fileSections.Keys)
            {
                cl = CodeSectionLabels(filename);
                foreach (string x in cl.Keys)
                {
                    uint y = cl[x];
                    result[len++] = new AddressLabelPair(y, x);
                }
                cl = DataSectionLabels(filename);
                foreach (string x in cl.Keys)
                {
                    uint y = cl[x];
                    result[len++] = new AddressLabelPair(y, x);
                }
            }
            Array.Sort(result, cmp);
            return(result);
        }