1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-09-25 03:27:01 +00:00

Change some EQU handling

Changed the sort order on EQU lines so that constants come before
address definitions.  This caused trivial changes to three of the
regression tests.

Added the ability to jump directly to an EQU line when an opcode
is double-clicked on.
This commit is contained in:
Andy McFadden
2019-10-10 13:49:21 -07:00
parent 475c31b886
commit 6d886ecc3a
14 changed files with 96 additions and 64 deletions

View File

@@ -772,12 +772,13 @@ namespace SourceGen {
}
/// <summary>
/// Generates a synthetic offset for the FileOffset field from an index value. The
/// index arg is the index of an entry in the DisasmProject.ActiveDefSymbolList.
/// Generates a synthetic offset for the FileOffset field from an index value.
/// (The exact algorithm isn't too important, as these offsets are not stored in the
/// project file.)
/// </summary>
private static int DefSymOffsetFromIndex(int index) {
/// <param name="index">Index into DisasmProject.ActiveDefSymbolListlist.</param>
/// <returns>Synthetic file offset. Value will be < 0.</returns>
public static int DefSymOffsetFromIndex(int index) {
Debug.Assert(index >= 0 && index < (1 << 24));
return index - (1 << 24);
}
@@ -786,6 +787,8 @@ namespace SourceGen {
/// Returns the DisasmProject.ActiveDefSymbolList index for an EQU line with
/// the specified file offset.
/// </summary>
/// <param name="offset">Synthetic file offset, from DefSymOffsetFromIndex().</param>
/// <returns>Index into DisasmProject.ActiveDefSymbolListlist.</returns>
public static int DefSymIndexFromOffset(int offset) {
Debug.Assert(offset < 0);
return offset + (1 << 24);