1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-08-05 09:25:39 +00:00

977 Commits

Author SHA1 Message Date
Andy McFadden
73f87f5060 Version 1.10.0 v1.10.0 2025-08-02 13:10:29 -07:00
Andy McFadden
a4b71e0c9b Update tutorial and manual
Fix some typos, clarify some things, and replace a slightly incorrect
pair of PNGs.

Some of the dialogs have gained additional options, but the changes
aren't meaningful enough to warrant taking lots of screen shots.
2025-08-01 13:36:32 -07:00
Andy McFadden
3e344281a2 Version 1.10.0-alpha1 v1.10.0-alpha1 2025-07-30 16:17:11 -07:00
Andy McFadden
cae1fa5173 Disregard operand address, part 2 (of 2)
Added assembler regression tests, for 6502 and 65816.

The "remove formatting" action now clears the flag.  It's a bit of a
stretch to call it "formatting" but this feels right.

Updated the documentation, adding a new section about embedded
instructions to the intro material.
2025-07-30 16:06:21 -07:00
Andy McFadden
ec50f48f95 Disregard operand address, part 1
SourceGen puts a lot of effort into connecting address operands to
internal offsets and external symbols.  Sometimes this is undesirable.
For example, a BIT or conditional branch instruction is sometimes used
as a dummy when there are multiple entry points that vary only in a
status flag or register value.  The address in the BIT or branch is
either irrelevant or never actually referenced, so auto-generating a
label for it is annoying.

Having a way to tell the disassembler to disregard an address operand,
so that it won't generate an auto-label or be included in the list of
cross-references, provides a simple solution to this.

The operand's file offset is determined during the code analysis
pass.  Setting it to -1 makes the operand look like an external address.
If we disable the project/platform symbol lookup for that instruction
as well, we can avoid label generation and cross-references.

We also need to prevent the 65816 data bank fixup code from restoring
it, and the relocation data code from doing its thing.

The flag is implemented as a new "misc flags" table, which holds a
set of bit flags for every file offset.  The "disregard operand address"
flag is set on the opcode byte of instructions.  The flags are expected
to be used infrequently, so they're currently output as a list of
(offset, integer) pairs.

The flag is set in the Edit Instruction Operand dialog, which has a
new checkbox.  The checkbox is disabled for immediate operands.

(issue #174)
2025-07-30 09:16:32 -07:00
Andy McFadden
c70d015b00 Fix 65816 operand formatting issues
Some 16-bit operands are tracked internally as 24-bit, appending the
B (data bank) or K (program bank) register to form the full address.
For some assemblers the K-bank instructions must be output as 24-bit
values, even for 16-bit JMP/JSR, but for most we want to strip the
bank byte off before outputting the operand as hex or decimal.

This expands 20032-labels-and-symbols with a mix of 24-bit, 16-bit+B,
and 16-bit+K instructions formatted in various ways.  No existing
tests were affected by this change.

(issue #172)
2025-07-19 13:39:12 -07:00
Andy McFadden
4846a26c9a Treat PEA operand as imm const16
We were treating PEA's operand as an absolute address and attempting to
extend it to 24 bits.  This wasn't very successful, and was
counter-productive when the argument was actually a constant, which is
common.  Worse, if the operand appeared to reference an internal address
outside bank 0, we would output a 24-bit value, breaking 64tass and cc65.

We now treat PEA as having an immediate operand.  (It was already
classified as an "extended immediate", but the operand-address
computation was still happening.)

This will have little to no effect on projects that use OMF relocation
data, because PEA arguments are explicitly identified as symbols or
constants.

New tests were added to 20032-labels-and-symbols to exercise the code
generation failures.  A few other tests that used PEA were affected.
20152-local-variables was fixed by adding a symbolic reference, the
others remained as-is and the expected output was revised.

(issue #172)
2025-07-18 13:25:29 -07:00
Andy McFadden
859a22fe60 Change signed decimal keyboard shortcut
It was re-using Alt+D in the instruction operand editor, which
interfered with selection of Decimal.  Alt+S was taken (for Symbol),
so it's using Alt+G.

There was no assignment in the data operand editor.  Alt+G was free
there as well.
2025-07-16 16:17:10 -07:00
Andy McFadden
15c5d53b0b Version 1.9.2-alpha2 v1.9.2-alpha2 2025-07-16 08:23:26 -07:00
Andy McFadden
8dba2c1de6 Allow formatting of 32-bit address tables
These are actually 24-bit address tables, with an extra byte to pad
each entry to an even number of bytes, so the GUI refers to them as
"24-bit + pad byte".  The extra byte is not included in the address
calculation, and is simply skipped over.

(issue #171)
2025-07-16 08:22:59 -07:00
Andy McFadden
65b217908b Version 1.9.2-alpha1 v1.9.2-alpha1 2025-07-15 13:41:54 -07:00
Andy McFadden
4ea4204ab7 Add signed-decimal operand formatting
This allows signed decimal operands to be formatted as such, e.g.
"LDA #$FE" becomes "LDA #-2".  This can be applied to immediate
operands and to numeric data pseudo-ops.

Not all assemblers support this in all situations.  The asm generators
will output unsigned decimal operands if so.

The 20020- and 20022-operand-formats tests have been updated.
2025-07-15 13:34:19 -07:00
Andy McFadden
10e48f15e8 Tweak verbiage 2025-07-15 11:27:17 -07:00
Andy McFadden
eda6748ee5 Version 1.9.2-dev5 v1.9.2-dev5 2025-07-11 07:56:25 -07:00
Andy McFadden
eb6999b1b0 Add jump table formatting
When asked to tag an absolute JMP instruction ($4C) as code, we now
scan forward to see if it's the start of a series of JMPs.  If we
find more than one, we offer the opportunity to tag the entire set
all at once.

A series of unformatted JMPs has been added to 20200-ui-edge-cases
for manual testing.

(issue #22)
2025-07-10 16:16:22 -07:00
Andy McFadden
213f7cc205 Tweak 20032 test
The existing workaround for broken Merlin 32 behavior is sufficient
to handle the new test cases.  This updates 20032-labels-and-symbols
to fully exercise all DP addressing modes with non-DP labels.

(issue #170)
2025-07-10 13:33:18 -07:00
Andy McFadden
459cde40c4 Fix Merlin 32 DP op generation
Most assemblers treat '<' and '>' as byte-select operators.  Merlin 32
treats them as shift operators, making '<' effectively a no-op.  A
mask is applied based on the length implied by the opcode or pseudo-op,
e.g. "DFB <FOO" will mask off the high bits.  This is problematic for
instructions like "LDA <FOO", where the choice between absolute and DP
addressing depends on the value of "<FOO".  If FOO is >= $100, the
lack of masking will cause it be treated as absolute.  There is
currently no other mechanism to force the use of a direct-page opcode.

The only recourse is to append "&$ff" to the operand, so the
assembler knows that it can be handled as a DP op.  The code generator
has been updated to add "&$ff" where needed, based on the label's
value.  Unfortunately the assembler doesn't accept this for certain
specific addressing modes; this appears to be a bug.

The relevant test cases (2003x-labels-and-symbols) have been updated
to exercise these situations.  The current test projects side-step the
failing assembler behavior by using a DP label instead.  These should
be changed to correctly exercise the full behavior, with the code
generator outputting the instructions as raw hex values to work
around bugs.

There are some deliberately broken things (like a duplicate label) in
the 20030 case that were copied into the 20032 case when it was
created.  For ease of editing these have been removed from 20032.

(issue #170)
2025-07-10 12:04:16 -07:00
Andy McFadden
9d01f9b205 Version 1.9.2-dev4 v1.9.2-dev4 2025-07-09 20:39:31 -07:00
Andy McFadden
108b71cfa7 Fix cc65 output
Fixed "HiAscii" macro used for cc65 output.  The macro name was being
forced to upper case at the point of use when the settings were
configured to generate upper-case pseudo-op names.

Also, added upper-casing config info to comment in HTML output.
2025-07-09 20:35:32 -07:00
Andy McFadden
4fe7257399 Fix crash when header line right-clicked 2025-07-09 20:34:13 -07:00
Andy McFadden
c873383c4d Expand goto dialog address resolution
The "goto" dialog (Ctrl+G) jumps to an offset, address, or label.  If
an address is specified, it is resolved relative to the first line of
the current selection, so that if the same address appears multiple
times we select the "best" one.

This turned out to be too restrictive, because if the region was marked
with "disallow outbound address resolution" we wouldn't look anywhere
except the current region.  While arguably correct, it was annoying
to have to move the cursor before being able to jump to a unique
address elsewhere in the file.

Now, if the address lookup fails to identify an offset, we repeat it
with "disallow outbound" flags ignored.
2025-07-09 12:57:23 -07:00
Andy McFadden
332477f4ab Work around edge case
The new GetOperandTargetOffset() function doesn't handle isolated
address regions quite right, because it uses a symbol table lookup
that doesn't know about them.  For now, we can work around it by
tweaking the behavior.
2025-07-09 08:04:59 -07:00
Andy McFadden
c0e3809938 Make notes panel text column fixed-width
The default width doesn't line up with the right edge of the panel,
so either you're not seeing as much text as you could, or it's
scrollable and will lurch over if you double-click in the text area.

Now the width is set to '*', which makes the column wide enough to
fill the panel, and automatically resizes as things shift.
2025-07-07 18:01:02 -07:00
Andy McFadden
7fdf459899 Version 1.9.2-dev3 v1.9.2-dev3 2025-06-27 15:11:28 -07:00
Andy McFadden
b6e6363234 Add "find all" feature
This uses the same (very weak) string search as the current Find
feature, but does it over the entire file.  Matches are added to a
table of results and displayed in the same dialog used by the
References panel "copy out" feature.

The reference table now jumps to a Location rather than just the
closest offset, so that we can jump to the middle of a multi-line
comment.
2025-06-27 15:00:38 -07:00
Andy McFadden
afd55d36e3 Add "always on top" checkbox to reference table
It's annoying to have to go digging for the dialog.  The default
setting is "true", and the value is remembered for the duration of
the current session.
2025-06-27 13:21:36 -07:00
Andy McFadden
10aa22c483 Tweak Edit Operand Target Label
If an instruction or data operand has been given an explicit symbol,
the user will expect to edit the label at that address rather than
the numeric address.  Same for project symbols.  If we detect that
a symbol has been set, edit that directly.  If the symbol doesn't
exist, or isn't a user label or project symbol (e.g. platform symbol
or address region pre-label), we open the full operand editor instead.
2025-06-27 13:07:38 -07:00
Andy McFadden
0d64e0a94f Handle LVT entries for operand target label edits
The "edit operand target label" feature now handles local variables.
The individual symbol is edited in the table, the same way it would
if the appropriate option were selected from the Edit Instruction
Operand dialog.

Also, show the address in the Edit Label dialog.  It feels
unobtrusive and is occasionally useful.
2025-06-26 09:59:54 -07:00
Andy McFadden
8ab6294c8f Version 1.9.2-dev2 v1.9.2-dev2 2025-06-22 15:12:42 -07:00
Andy McFadden
ab5818a204 Add "copy out" button to References window
The References window is handy for seeing everything that refers to
a particular address or symbol, but walking through the list is
annoying because the window gets reset every time you double-click
on an entry and the selection moves.

This adds a "copy out" button that copies the references to a
floating window.  References can be double-clicked as usual, but the
list doesn't update unless you click "copy out" again.

This might be better if it were somehow integrated into the main
window, e.g. as a tab in the Info panel, so that the focus isn't
bouncing between two independently Z-ordered windows.
2025-06-22 13:44:53 -07:00
Andy McFadden
ab0a93112f Version 1.9.2-dev1 v1.9.2-dev1 2025-06-21 17:35:12 -07:00
Andy McFadden
0eb417ac46 Add "edit operand target label" action
This adds a shortcut for editing the label at the address referenced
by an instruction operand or data address pseudo-op.  This can be
activated from the Actions menu, or with Ctrl+Shift+L.

For references inside the file, the Edit Label dialog is opened.  For
external addresses, the project symbol editor is opened.

Local variable table entries are currently not supported.

(issue #166)
2025-06-21 17:31:49 -07:00
Andy McFadden
898307eb73 Tweak instruction operand edit
The code that allowed easy editing of project symbol operands wasn't
handling overlapping multi-byte regions correctly.

This adds a new section to the 20200-ui-edge-cases test case that has
instructions with various kinds of address operands.
2025-06-19 09:23:37 -07:00
Andy McFadden
bde4f2ed07 Tweak Merlin32 generator
Merlin32 v1.2 requires DSK and TYP directives.  We now add these if
version 1.2 is detected.  (Earlier versions of Merlin32 accept them,
so at some point we may just want to output them always.)

The version-parsing code has been updated to deal with pre-release
version strings.
2025-05-04 07:58:49 -07:00
Andy McFadden
913dfb5dd2 Version 1.9.1 v1.9.1 2025-01-19 14:07:38 -08:00
Andy McFadden
c7090c9c52 Update comment 2024-12-22 20:25:43 -08:00
Andy McFadden
83ed8ed5d9 Minor updates 2024-09-17 15:11:03 -07:00
Andy McFadden
5aaaf43bf9 trivial change to nudge github 2024-09-17 13:20:26 -07:00
Andy McFadden
89be1a5800 Version 1.9.1-dev1 v1.9.1-dev1 2024-09-15 13:35:45 -07:00
Andy McFadden
ec9017cbc3 Add "omit implicit acc operand" feature
By default, implicit acc operands are shown, e.g. "LSR A" rather
than just "LSR".  I like showing operands for instructions that
have multiple address modes.

Not everyone agrees, so now it's a setting.  They're shown by default,
but enabling the option will strip them on-screen, in generated
assembly, and in the instruction chart.

They are always omitted for ACME output, which doesn't allow them.

(issue #162)
2024-09-15 13:29:04 -07:00
Andy McFadden
6c2eee806b Update tool reference 2024-08-19 13:12:53 -07:00
Andy McFadden
ba28d42536 Version 1.9.0 v1.9.0 2024-08-19 13:08:15 -07:00
Andy McFadden
eef1710d5d Update tutorial
Two main changes:
 - "Seek nearby targets" is no longer enabled by default.
 - The application asks the user to save new projects immediately.

Various minor edits were also made.

A couple of the images are slightly stale, showing ".org" rather than
".addrs", but they're in the advanced section and the difference
isn't notable.
2024-08-19 13:03:16 -07:00
Andy McFadden
5544014b71 Fix weird error message
When creating a new project, we now put up a "save as" dialog.  If
you cancel out of the dialog, and have auto-save enabled, we post a
strange message about being unable to create a file with an empty
filename string.
2024-08-09 20:26:46 -07:00
Andy McFadden
69d3cd1867 Version 1.9.0-alpha2 v1.9.0-alpha2 2024-08-09 20:17:26 -07:00
Andy McFadden
3a349b2761 Tweak 2024-08-09 20:15:13 -07:00
Andy McFadden
fca742e890 Auto-save, part 3 (of 3)
Added the recovery file check when a project is opened, and the GUI
elements for choosing which file to use.

If a recovery file exists but can't be opened, presumably because it's
open by another process, offer to open the project read-only.  (This
is a generally good idea, but we don't hold the project file open
in normal usage, so it only works when auto-save is enabled.)

After making a choice, auto-save is disabled until the first manual
save.

One thing we don't do: if we find a recovery file, but auto-save is
disabled, the recovery file won't be deleted after the user makes a
choice.  This might be a feature.

Updated documentation.

(issue #161)
2024-08-09 13:42:12 -07:00
Andy McFadden
1b2353c259 Auto-save, part 2
Periodically save the project to the recovery file if changes have
been made and the project is "dirty".

We need to handle a couple of things specially.  If the user uses
"Save As" to change the project name, we need to recreate the recovery
file as well.  If auto-save is enabled or disabled in app settings, we
need to create or discard the recovery file, and possibly change the
timer interval.  If the project is modified, auto-saved, and then the
change is un-done, the project won't be dirty, but will have a stale
recovery file with a newer modification date; we handle this by simply
truncating the stale recovery file.

To reduce the amount of auto-saving, we don't do an initial write to
the recovery file, and we reset the timer every time the user does a
manual save.  A user who saves diligently will always have an empty
recovery file.
2024-08-07 17:55:54 -07:00
Andy McFadden
3d4250cbc4 Auto-save, part 1
Added configuration option to app settings.  It's in the "code view"
tab, which isn't quite right, but none of the others fit better.

Also, force a Save As when a new project is first created.
2024-08-02 13:47:39 -07:00
Andy McFadden
ef13101923 Clarify some app settings
The pop-up that lets you choose which assembler to set configuration
options for looked like it let you choose an assembler generally.
Changed some wording and visuals for better clarity.
2024-08-01 15:08:43 -07:00