Exemplo n.º 1
0
        private FormattedSymbol CreateFormattedSymbol(DefSymbol defSym)
        {
            string typeStr;

            if (defSym.IsConstant)
            {
                typeStr = Res.Strings.ABBREV_CONSTANT;
            }
            else
            {
                typeStr = Res.Strings.ABBREV_ADDRESS;

                if (defSym.Direction == DefSymbol.DirectionFlags.Read)
                {
                    typeStr += "<";
                }
                else if (defSym.Direction == DefSymbol.DirectionFlags.Write)
                {
                    typeStr += ">";
                }
            }

            FormattedSymbol fsym = new FormattedSymbol(
                defSym,
                defSym.GenerateDisplayLabel(mFormatter),
                mFormatter.FormatValueInBase(defSym.Value, defSym.DataDescriptor.NumBase),
                typeStr,
                defSym.HasWidth ? defSym.DataDescriptor.Length.ToString() : NO_WIDTH_STR,
                defSym.Comment);

            return(fsym);
        }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (mOldSym != null)
            {
                Label = mOldSym.GenerateDisplayLabel(mNumFormatter);
                Value = mNumFormatter.FormatValueInBase(mOldSym.Value,
                                                        mOldSym.DataDescriptor.NumBase);
                if (mOldSym.HasWidth)
                {
                    VarWidth = mOldSym.DataDescriptor.Length.ToString();
                }
                Comment = mOldSym.Comment;

                if (mOldSym.IsConstant)
                {
                    IsConstant = true;
                }
                else
                {
                    IsAddress = true;
                }

                if (mOldSym.Direction == DefSymbol.DirectionFlags.Read)
                {
                    IsReadChecked = true;
                }
                else if (mOldSym.Direction == DefSymbol.DirectionFlags.Write)
                {
                    IsWriteChecked = true;
                }
                else
                {
                    IsReadChecked = IsWriteChecked = true;
                }
            }
            else
            {
                IsAddress = IsReadChecked = IsWriteChecked = true;
            }

            UpdateControls();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads entries from the work table into the items source.
        /// </summary>
        private FormattedSymbol CreateFormattedSymbol(DefSymbol defSym)
        {
            string typeStr;

            if (defSym.IsConstant)
            {
                typeStr = Res.Strings.ABBREV_STACK_RELATIVE;
            }
            else
            {
                typeStr = Res.Strings.ABBREV_ADDRESS;
            }

            FormattedSymbol fsym = new FormattedSymbol(
                defSym,
                defSym.GenerateDisplayLabel(mFormatter),
                mFormatter.FormatValueInBase(defSym.Value, defSym.DataDescriptor.NumBase),
                typeStr,
                defSym.DataDescriptor.Length,
                defSym.Comment);

            return(fsym);
        }