1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-05-31 22:41:37 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Andy McFadden
e6c5c7f8df ORG rework, part 6
Added support for non-addressable regions, which are useful for things
like file headers stripped out by the system loader, or chunks that
get loaded into non-addressable graphics RAM.  Regions are specified
with the "NA" address value.  The code list displays the address field
greyed out, starting from zero (which is kind of handy if you want to
know the relative offset within the region).

Putting labels in non-addressable regions doesn't make sense, but
symbol resolution is complicated enough that we really only have two
options: ignore the labels entirely, or allow them but warn of their
presence.  The problem isn't so much the label, which you could
legitimately want to access from an extension script, but rather the
references to them from code or data.  So we keep the label and add a
warning to the Messages list when we see a reference.

Moved NON_ADDR constants to Address class.  AddressMap now has a copy.
This is awkward because Asm65 and CommonUtil don't share.

Updated the asm code generators to understand NON_ADDR, and reworked
the API so that Merlin and cc65 output is correct for nested regions.

Address region changes are now noted in the anattribs array, which
makes certain operations faster than checking the address map.  It
also fixes a failure to recognize mid-instruction region changes in
the code analyzer.

Tweaked handling of synthetic regions, which are non-addressable areas
generated by the linear address map traversal to fill in any "holes".
The address region editor now treats attempts to edit them as
creation of a new region.
2021-09-30 21:11:26 -07:00
Andy McFadden
49f4017410 Rename "hints" to "analyzer tags"
Variables, types, and comments have been updated to reflect the new
naming scheme.

The project file serialization code is untouched, because the data
is output as serialized enumerated values.  Adding a string conversion
layer didn't seem worthwhile.

No changes in behavior.

(issue #89)
2020-10-15 16:55:29 -07:00
Andy McFadden
908a1c9900 Rename "hint" in UI and documentation
Before:
 Hint As Code Entry Point
 Hint As Data Start
 Hint As Inline Data
 Remove Hints

After:
 Tag Address As Code Start Point
 Tag Address As Code Stop Point
 Tag Bytes As Inline Data
 Remove Analyzer Tags

The goal is to reduce confusion.  The old nomenclature was causing
problems because it's inaccurate -- they're directives, not hints --
and made it look like you need to mark data items explicitly.  The
new action names emphasize the idea that you should be tagging a
single address for start/stop, not blanketing a region.

This change updates the user interface, manual, and tutorials, but
does not change how the items are referred to in code, and does not
change how the program works.

(issue #89)
2020-10-14 15:02:53 -07:00
Andy McFadden
2ec2917da5 Fix inline BRK no-no-continue flag
Inline BRK instructions have a problem similar to the one fixed
for JSR/JSL back in 63d7a487, but the same fix won't work because
JSR/JSL are assumed "continue", while BRK is assumed "no-continue",
and must therefore set a no-no-continue flag.  For now, we just
re-evaluate the BRK on every visit to the code.

A review of the previous fix revealed an opportunity to use the
NoContinueScript flag on subsequent visits to improve consistency.
2020-08-22 13:47:52 -07:00
Andy McFadden
18e6951f17 Add Data Bank Register management, part 1
On the 65816, 16-bit data access instructions (e.g. LDA abs) are
expanded to 24 bits by merging in the Data Bank Register (B).  The
value of the register is difficult to determine via static analysis,
so we need a way to annotate the disassembly with the correct value.
Without this, the mapping of address to file offset will sometimes
be incorrect.

This change adds the basic data structures and "fixup" function, a
functional but incomplete editor, and source for a new test case.
2020-07-08 17:56:27 -07:00
Andy McFadden
f4fe3af050 Fix application of reloc info in data areas
The test wasn't correctly excluding instructions, so it was possible
to create a situation where a two-byte data item had an instruction
starting in the second byte.

We also weren't checking the length of the instruction to ensure that
it was wider than the reloc data.  This could get weird for an
immediate constant when the M/X flags are wrong.  When in doubt, don't
overwrite.
2020-07-07 11:48:51 -07:00
Andy McFadden
63d7a48705 Fix bug in inline JSR/JSL no-continue handling
JSR/JSL calls with inline data have the option of reporting that
they don't continue, which causes the code analyzer to treat them
as JMPs instead.  There was a bug that was causing the no-continue
flag to be lost in certain circumstances.

The code now explicitly records the plugin's response in an Anattrib
flag.  Test 2022-extension-scripts has been updated with a test case
that exercises this situation.
2020-05-08 17:41:26 -07:00
Andy McFadden
b6e571afc2 Correctly handle embedded instruction edge case
This began with a change to support "BRK <operand>" in cc65.  The
assembler only supports this for 65816 projects, so we detect that
and enable it when available.

While fiddling with some test code an assertion fired.  This
revealed a minor issue in the code analyzer: when overwriting inline
data with instructions, we weren't resetting the format descriptor.

The code that exercises it, which requires two-byte BRKs and an
inline BRK handler in an extension script, has been added to test
2022-extension-scripts.

The new regression test revealed a flaw in the 64tass code
generator's character encoding scanner that caused it to hang.
Fixed.
2019-10-19 17:28:45 -07:00
Andy McFadden
8727d49f43 Minor tweaks 2019-09-06 13:47:23 -07:00
Andy McFadden
c64f72d147 Move WPF code from SourceGenWPF to SourceGen 2019-07-20 13:28:37 -07:00
Andy McFadden
e3906e021b Move WinForms code to SourceGenWF 2019-07-20 13:02:54 -07:00
Andy McFadden
2c6212404d Initial file commit 2018-09-28 10:05:11 -07:00