1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-30 01:50:10 +00:00
6502bench/SourceGen/SGTestData/2021-external-symbols-2.sym65

42 lines
1.0 KiB
Plaintext
Raw Normal View History

Allow explicit widths in project/platform symbols, part 3 Implement multi-byte project/platform symbols by filling out a table of addresses. Each symbol is "painted" into the table, replacing an existing entry if the new entry has higher priority. This allows us to handle overlapping entries, giving boosted priority to platform symbols that are defined in .sym65 files loaded later. The bounds on project/platform symbols are now rigidly defined. If the "nearby" feature is enabled, references to SYM-1 will be picked up, but we won't go hunting for SYM+1 unless the symbol is at least two bytes wide. The cost of adding a symbol to the symbol table is about the same, but we don't have a quick way to remove a symbol. Previously, if two platform symbols had the same value, the symbol with the alphabetically lowest label would win. Now, the symbol defined in the most-recently-loaded file wins. (If you define two symbols with the same value in the same file, it's still resolved alphabetically.) This allows the user to pick the winner by arranging the load order of the platform symbol files. Platform symbols now keep a reference to the file ident of the symbol file that defined them, so we can show the symbols's source in the Info panel. These changes altered the behavior of test 2008-address-changes, which includes some tests on external addresses that are close to labeled internal addresses. The previous behavior essentially treated user labels as being 3 bytes wide and extending outside the file bounds, which was mildly convenient on occasion but felt a little skanky. (We could do with a way to define external symbols relative to internal symbols, for things like the source address of code that gets relocated.) Also, re-enabled some unit tests. Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 23:26:05 +00:00
; Copyright 2019 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
*SYNOPSIS Symbol set 2 for test 2021-external-symbols
; override 2nd and 3rd
SameName2 @ $2011
SameName3 @ $2021
SameValB_A @ $2110
SameValC_B @ $2120
SepOver1 @ $3100 4 ;$3100-3103, inclusive
; I/O direction test -- replace part of the write-only range
WriteOnly2 > $5002
;
; MULTI_MASK tests.
;
; This overlaps with an earlier declaration, but *only* for address $c010,
; not for all occurrences.
NonMultiOver @ $c010 ;winner
*MULTI_MASK $ff00 $c100 $000f ;$c100-c10f, repeats $c110-c11f, etc. to $c1ff
; Symbol in previous file overlaps with this.
; Test: C100, C110, C120
MoreMultiZero @ $c100
;
; More erroneous masks. These are in a separate file mostly to test how
; errors in multiple files are reported.
;
*MULTI_MASK $fff0 $000f $000f ;CompareValue has bits not in CompareMask
*MULTI_MASK $fff0 $fff0 $00ff ;AddressMask and CompareMask overlap
*MULTI_MASK