Commit Graph

901 Commits

Author SHA1 Message Date
Andy McFadden 8109396c48 Rework 201XX-char-encoding-X tests
We have a single character-encoding test that is cloned 3x so we can
exercise the different values for the project's default character
set.  It was a 65816 test because it tested 16-bit immediate char
operands, but that's a very small part of it.

The 65816-specific portion is now 20122-char-encoding.  The rest is
now 201{2,3,4}0-char-encoding-X.
2020-10-19 15:01:02 -07:00
Andy McFadden 7ae4b63fa3 Tweak wording 2020-10-19 14:59:27 -07:00
Andy McFadden 17dc908420 Refactor tests 1002x and 1003x
Tests 10022-embedded-instructions and 10032-flags-and-branches were
a mix of 6502 and 65816 code.  The 6502 code has been separated into
its own file, so that the tests can be run on 8-bit-only assemblers.
2020-10-18 20:30:42 -07:00
Andy McFadden 74ab1c8137 Fix regression test copier
The filename pattern for test cases was still expecting four-digit
test numbers, so the regression tests weren't being copied into the
distribution directory.
2020-10-18 15:57:58 -07:00
Andy McFadden e9fbc6c96c Change Merlin 32 output suffix
We append an assembler identifier to generated code.  For Merlin 32,
this was "_Merlin32".  All of the other assemblers use a lower-case
string, which makes Merlin look a little weird, so it has been
changed to "_merlin32".

Windows filesystems are generally case-insensitive, so this won't
likely affect anything.
2020-10-18 15:47:11 -07:00
Andy McFadden cac03e6a25 Version 1.7.3-dev2 2020-10-18 13:43:44 -07:00
Andy McFadden 49603ba417 Refine handling of C64 PRG header
A few tweaks:
- Test now requires an ORG on offset +000002, not just a correct
  address.
- Suppress on-screen display of the initial ORG directive when
  a PRG file is detected.  Subtle, but helpful.
- In new project setup, fix initial address for PRG projects that
  load at $0000.
- In new project setup, add a "load address" comment to the first line.

Also, fix some out-of-date documentation.

(issue #90)
2020-10-18 13:22:24 -07:00
Andy McFadden 2afb280472 Rename test 10042
The 10042-data-recognition test has no 65816-specific content, so it
should be named 10040-data-recognition.

Also, remove header comment from 20102-label-dp.
2020-10-18 09:16:50 -07:00
Andy McFadden 99cd0d3ac1 Improve handling of C64 PRG header
C64 PRG files are pretty common.  Their salient feature is that they
start with a 16-bit value that is used as the load address.  The
value is commonly generated by the assembler itself, rather than
explicitly added to the source file.

Not all assemblers know what a PRG file is, and some of them handle
it in ways that are difficult to guarantee in SourceGen.  ACME adds
the 16-bit header when the output file name ends in ".prg", cc65
uses a modified config file, 64tass uses a different command-line
option, and Merlin 32 has no idea what they are.

This change adds PRG file detection and handling to the 64tass code
generator.  Doing so required making a few changes to the gen/asm
interfaces, because we now need to have the generator pass additional
flags to the assembler, and sometimes we need code generation to
start somewhere other than offset zero.  Overall the changes were
pretty minor.

The 20042-address-changes test needed a 6502-only variant.  A new test
(20040-address-changes) has been added and given a PRG header.  As
part of this change the 65816 variant was changed to use addresses
in bank 2, which uncovered a code generation bug that this change
also fixes.

The 64tass --long-address flag doesn't appear to be necessary for
files <= 65536 bytes long, so we no longer emit it for those.

(issue #90)
2020-10-17 16:45:13 -07:00
Andy McFadden ae4c90d838 Warn about multi-line start/stop tags
One of the most confusing things you can do is select a bunch of
lines and apply a code start tag (nee "code hint").  We now ask for
confirmation when applying start/stop hints to multiple lines.

(issue #89)
2020-10-15 17:18:49 -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 0d164e1719 Fix PCRel sample in instruction chart
Relative branches should display as $xxxx, not $xx.
2020-10-14 15:02:13 -07:00
Andy McFadden 5015a4b4c6 Version 1.7.3-dev1 2020-10-11 18:46:37 -07:00
Andy McFadden 728966f8d2 Add W65C02S support, part 4 (of 4)
Added 20233-rockwell unit test to exercise the new opcodes.  Nothing
too fancy.

Fixed branch offset computation.

(issue #87)
2020-10-11 18:43:00 -07:00
Andy McFadden 34ba47e71d Add W65C02S support, part 3
Modified the asm source generators and on-screen display to show the
DP arg for BBR/BBS as hex.  The instructions are otherwise treated
as relative branches, e.g. the DP arg doesn't get factored into the
cross-reference table.

ACME/cc65 put the bit number in the mnemonic, 64tass wants it to be
in the first argument, and Merlin32 wants nothing to do with any of
this because it's incompatible with the 65816.

Added an "all ops" test for W65C02.
2020-10-11 14:35:17 -07:00
Andy McFadden 70ee8793ae Add W65C02S support, part 2
Created the "all ops" tests for W65C02.  Filled in enough of the
necessary infrastructure to be able to create the project and
disassemble the file, though we're not yet handling the instructions
correctly.
2020-10-10 18:34:19 -07:00
Andy McFadden b60dc4fee4 Add W65C02S support, part 1
We were claiming W65C02S, but it turns out that CPU has the Rockwell
extensions and the STP/WAI instructions.  We need to change existing
references to be "WDC 65C02", and add a new CPU definition for the
actual W65C02S chip.

This adds the new CPU definition, the instruction definitions for
the Rockwell extensions, and updates the selectors in project properties
and the instruction chart tool.

This change shouldn't affect any existing projects.  Still more to do
before W65C02 works though, mostly because the Rockwell instructions
introduced a new two-argument address mode that has to be handled in
various places.
2020-10-10 15:46:34 -07:00
Andy McFadden 9ffc4a9383 Version 1.7.2 2020-09-24 12:51:43 -07:00
Andy McFadden 9548b5c27c Add link to ToC 2020-09-20 17:42:40 -07:00
Andy McFadden 3f154406d4 Fix multi-byte local var xrefs
The cross-references for multi-byte local variable table entries were
not showing adjustment values.
2020-09-05 18:18:55 -07:00
Andy McFadden d984e8013a Mention VS2017 icon library usage
Should be mentioned in LegalStuff.txt.
2020-09-04 18:20:26 -07:00
Andy McFadden e411cca485 Minor style change to "back" link
Smaller font, (parenthesis).
2020-09-04 18:17:01 -07:00
Andy McFadden b962d8715d Add toolbar button for "show cycle counts"
Sometimes you just want to turn cycle counts on for a bit, and going
through app settings is tiresome.  Now there's a toolbar checkbox
for it.  The icon isn't ideal, but it'll do.
2020-09-04 17:49:28 -07:00
Andy McFadden f30780a9de Fix Message update when broken symbolic ref is fixed
Renaming a user label doesn't cause a re-analysis, just a display
update, because nothing structural is changing.  However, that's not
quite true when you have a reference to a non-existent label (e.g.
"LDA hoser"), and you rename a label to match (e.g. change "blah"
to "hoser").  The most obvious consequence was that the Message list,
which enumerates the broken symbolic references, was not being
updated.

We now identify broken references during the refactoring rename, and
change the reanalysis mode accordingly.

There is a deeper problem, where undoing the label rename does the
wrong thing with the previously-broken symbolic references (in the
earlier example, it "undoes" them to "blah" rather than back to
"hoser").  I added some notes about that, but it's harder to fix.

Also, clean up some code that was still treating ReanalysisScope as
if it were bit flags.
2020-09-04 15:21:47 -07:00
Andy McFadden bd5b556a7f Show "ptr" for pointer use in cross-reference list
Consider:
 LDA $00 loads a value from address $00
 LDA $00,X might load from $00, or might not
 LDA ($00),Y dereferences $00 as a 16-bit pointer
 LDA ($00,X) dereferences a pointer, not necessarily from $00

When perusing the cross-reference list, it's useful to be able to
tell whether an instruction is accessing the location, using it as a
base address, or deferencing it as a pointer.  We now show "ptr" in
the list for pointer dereferences.  (We already showed "idx" for
indexed accesses.)
2020-09-04 13:26:41 -07:00
Andy McFadden 7c506dceb6 Add Ctrl+Enter as a way to close the LVTable edit dialog
When editing local variables, the data grid generally has the input
focus, so hitting Enter doesn't close the dialog.  Rather than play
games with the focus, just take Ctrl+Enter as a shortcut to close
the dialog (same as notes and long comments).

(I found myself hitting Ctrl+Enter automatically, and being annoyed
when it didn't work, so I figured I'd make it official.)
2020-08-27 17:09:18 -07:00
Andy McFadden 69a9e98a43 Split "show cycle counts" in two
The "show cycle counts in comments" setting is the only one that
affects both the on-screen display and generated source code.  This
felt a little weird, so it's now two independent settings.  This
also provided an opportunity to move it to the initial tab, so it's
easier to toggle on and off.  Overall it feels less confusing to have
two settings for essentially the same thing, because code generation
is distinct from everything else.

The "spaces between bytes" setting was moved to the Display Format
tab, which seems a better fit.

Documentation and tutorial have been updated.

Also did a little bit of cleanup in EditAppSettings.
2020-08-27 13:59:53 -07:00
Andy McFadden 575b4f25a7 Add screen holes to Apple II text memory chart
The page 1 screen holes are used by peripherals, so it's useful to
call out their locations.
2020-08-24 14:00:08 -07:00
Andy McFadden 24bc7326e6 Version 1.7.2-dev1 2020-08-23 10:55:43 -07:00
Andy McFadden 53857089e9 Update Apple /// SOS definitions
- Added SOS parameter block formatting.
- Normalized SOS call names to values in SOS Reference Manual.
- Added SOS call error code constants.
- (from robjustice) Added more to A3-IO.sym65.

Also, rearranged the ProDOS code slightly.

(issue #85)
2020-08-22 18:41:24 -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 ba35f88d02 Mark flags as indeterminate for inline BRK
We weren't altering the status flags after a BRK because of the
assumption that a BRK was a crash.  For an inline BRK, such as a SOS
call, execution continues.  We need to mark NVZC indeterminate or
we may incorrectly handle conditional branches that follow.

The BRK instruction now uses the same flag updater as JSR, since it's
effectively a subroutine call to unknown code.  If execution doesn't
continue across the BRK then the flags don't matter.

Updated 20182-extension-scripts to exercise this.
2020-08-22 08:56:38 -07:00
Andy McFadden 30cb96f737 Update Apple II definitions
Picked some names to fill the gaps in the language card I/O
location list.

Tweaked the hi-res sprite sheet slightly.
2020-08-21 20:01:41 -07:00
Andy McFadden 2dfdb3234b Add Apple II screen memory chart
Show mapping between lines on the text and hi-res screens and
locations in memory.
2020-08-20 17:24:28 -07:00
Andy McFadden b168db7750 Add serialization constructor for exception
Plugins can throw AddressTranslateException, but it didn't have a
serialization constructor, so it couldn't be reconstituted on the
app side.
2020-08-18 15:10:58 -07:00
Andy McFadden a2e7c88fc9 Update Apple II definitions
Added explicit widths to the 6502 vectors.

Two changes to Apple II hi-res visualization:

(1) Allow the row stride to be any value >= 1.  This is useful
when data is stored in column-major order, i.e. it's a two-byte-wide
shape, with all of the data for the first column stored before the
data for the second column.  (Set the row stride to 1, and the
column stride to the bitmap height.)

(2) Modify the layout of grids (sprite sheets and fonts), so that
we're closer to square when the item counts is low.  Otherwise the
thumbnail just looks like a dashed line.  (This one is strictly
cosmetic.)
2020-08-18 15:10:10 -07:00
Andy McFadden 3c73ea7ff6 Version 1.7.1 2020-08-13 10:45:11 -07:00
Andy McFadden 3f7d03c798 Add properties for font cell width/height
Can be used by visualizers.
2020-08-12 20:48:45 -07:00
Andy McFadden 31d466f0bd Update some Apple II definitions
Added a bunch of Applesoft entry points, and updated the F8ROM
definitions.

Added a visualizer for Applesoft shape table shapes that are not part
of an actual shape table.
2020-08-12 20:40:56 -07:00
Andy McFadden c2470c4ec4 Tweak debug feature
Make project symbols optional for "apply external symbols".
2020-08-10 14:09:26 -07:00
Andy McFadden 6e84d2a94e Merge branch 'master' of https://github.com/fadden/6502bench 2020-08-06 08:26:15 -07:00
Andy McFadden a8ca96adc3
Update README.md 2020-08-06 08:14:44 -07:00
Andy McFadden 159a9c30e7
Update README.md 2020-08-06 08:11:30 -07:00
Andy McFadden 6c5636a1bb
Update README.md 2020-08-06 08:08:04 -07:00
Andy McFadden 52853edcd1 Update GS/OS parameter block definitions
The FlushGS call has an additional argument.
2020-07-31 08:34:06 -07:00
Andy McFadden 4086551fb1 Version 1.7.0 2020-07-30 20:34:53 -07:00
Andy McFadden 881b354e50 Update README
Add v1.7 features, and update a few other things.
2020-07-30 20:33:29 -07:00
Andy McFadden 92c648807c Minor fixes to tutorial text 2020-07-30 19:59:50 -07:00
Andy McFadden c63035fb55 Update expected results for 10032-flags-and-branches
The "smart PLP" behavior change in 2a65457e altered the analysis.
2020-07-30 16:57:33 -07:00