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.
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.
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)
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)
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)
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.
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)
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.
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)
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)
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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)
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.
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.
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)
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.
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.
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.