From 5d852e3ea60f7ac72d6bdfa3a72dfd4f90cecf2d Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 18 Mar 2020 07:58:15 -0700 Subject: [PATCH] Don't show adjustment in constant cross-references The change to properly display adjustments to project/platform symbol cross-references also added them to constants, but based on the reference address rather than the operand value. We could generate an adjustment from the value, but I'm not sure if that's actually useful. --- SourceGen/DisasmProject.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SourceGen/DisasmProject.cs b/SourceGen/DisasmProject.cs index 788455f..13746b1 100644 --- a/SourceGen/DisasmProject.cs +++ b/SourceGen/DisasmProject.cs @@ -1542,7 +1542,14 @@ namespace SourceGen { DefSymbol defSym = sym as DefSymbol; int adj = 0; Debug.Assert(operandOffset < 0); // outside file scope - adj = defSym.Value - attr.OperandAddress; + if (sym.SymbolType != Symbol.Type.Constant) { + adj = defSym.Value - attr.OperandAddress; + } else { + // We could compute the operand's value and display + // the difference, so "LDA #$00" --> "LDA #FOO" when + // FOO is 1 would display "FOO -1" in the xref table. + // Not sure if that's useful. + } defSym.Xrefs.Add( new XrefSet.Xref(offset, true, xrefType, accType, adj)); } else {