Пример #1
0
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var            lbi  = (ListBoxItem)value;
            AsmListBoxItem item = (AsmListBoxItem)lbi.Content;

            AddressItem addressItem = item as AddressItem;
            string      operand     = addressItem.Operand ?? "";

            Console.WriteLine(operand);

            int padding;

            operand = int.TryParse(parameter.ToString(), out padding) ? operand.PadRight(padding) : operand;

            AsmLine asmLine = item.AsmLine;

            if (asmLine.HasOperandArgument())
            {
                if (asmLine.OperandArgument.HasLabel())
                {
                    if (!(asmLine.IsJumpOperation() || asmLine.IsBranchOperation() || asmLine.Opcode == "rts"))
                    {
                        string label = asmLine.OperandArgument.Label;
                        operand = operand.Replace(label, "<Run Foreground=\"DarkOrange\">" + label + "</Run>");
                    }
                }
            }


            return(operand.Replace("&", "&amp;"));
        }
Пример #2
0
 private string ColorOpcodeOperand(AsmLine asmLine, string paddedOperand)
 {
     if (asmLine.HasOperandArgument())
     {
         if (asmLine.OperandArgument.HasLabel())
         {
             if (!(asmLine.IsJumpOperation() || asmLine.IsBranchOperation() || asmLine.Opcode == "rts"))
             {
                 string label = asmLine.OperandArgument.Label;
                 paddedOperand = "<Span>" + paddedOperand.Replace(label, "<Run Foreground=\"DarkOrange\">" + label + "</Run>").Replace("&", "&amp;") + "</Span>";
             }
         }
     }
     return(paddedOperand.Replace("&", "&amp;"));
 }
Пример #3
0
        private void FollowJumpImmediate()
        {
            AsmLine asmLine = SelectedAsmLine();

            if (!asmLine.IsJumpOperation())
            {
                return;
            }
            _addressStack.Push(asmLine.DecimalAddress);

            string label = asmLine.OperandArgument.Label;
            int    address;

            if (!AsmReader.AddressByLabelDictionary().TryGetValue(label, out address))
            {
                return;
            }
            ScrollToAddress(address, ScrollMode.ScrollToCenterOfView);
        }