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

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)
This commit is contained in:
Andy McFadden 2020-10-14 15:02:53 -07:00
parent 0d164e1719
commit 908a1c9900
12 changed files with 160 additions and 144 deletions

View File

@ -381,7 +381,7 @@ namespace SourceGen {
StringBuilder sb = new StringBuilder(5);
char blank = '.';
sb.Append(IsEntryPoint ? '@' : blank);
sb.Append(IsHinted ? 'H' : blank);
sb.Append(IsHinted ? 'T' : blank);
sb.Append(DoesNotBranch ? '!' : blank);
sb.Append(DoesNotContinue ? '#' : blank);
sb.Append(IsBranchTarget ? '>' : blank);

View File

@ -4071,17 +4071,17 @@ namespace SourceGen {
// " opOff=" + attr.OperandOffset.ToString("x4") + "\r\n");
if (attr.IsHinted) {
sb.Append("\u2022 Hints: ");
sb.Append("\u2022 Analyzer Tags: ");
for (int i = 0; i < line.OffsetSpan; i++) {
switch (mProject.TypeHints[line.FileOffset + i]) {
case CodeAnalysis.TypeHint.Code:
sb.Append("C");
sb.Append("S"); // S)tart
break;
case CodeAnalysis.TypeHint.Data:
sb.Append("D");
sb.Append("E"); // E)nd
break;
case CodeAnalysis.TypeHint.InlineData:
sb.Append("I");
sb.Append("I"); // I)nline
break;
default:
break;

View File

@ -56,7 +56,7 @@ limitations under the License.
<system:String x:Key="str_ErrBadSymbolLabel">Malformed label in symbol</system:String>
<system:String x:Key="str_ErrBadSymbolSt">Unknown Source or Type in symbol</system:String>
<system:String x:Key="str_ErrBadSymrefPart">Bad symbol reference part</system:String>
<system:String x:Key="str_ErrBadTypeHint">Type hint not recognized</system:String>
<system:String x:Key="str_ErrBadTypeHint">Analyzer tag not recognized</system:String>
<system:String x:Key="str_ErrBadVisualizationFmt">Invalid visualization item: {0}</system:String>
<system:String x:Key="str_ErrBadVisualizationSetFmt">Invalid visualization set at +{0:x6}</system:String>
<system:String x:Key="str_ErrDirCreateFailedFmt">Unable to create directory {0}: {1}</system:String>
@ -162,7 +162,7 @@ limitations under the License.
<system:String x:Key="str_ProjectFieldOperandFormat">operand format</system:String>
<system:String x:Key="str_ProjectFieldRelocData">reloc data</system:String>
<system:String x:Key="str_ProjectFieldStatusFlags">status flag override</system:String>
<system:String x:Key="str_ProjectFieldTypeHint">type hint</system:String>
<system:String x:Key="str_ProjectFieldTypeHint">analyzer tag</system:String>
<system:String x:Key="str_ProjectFieldUserLabel">user-defined label</system:String>
<system:String x:Key="str_ProjectFromNewerApp">This project was created by a newer version of SourceGen. It may contain data that will be lost if the project is edited.</system:String>
<!--<system:String x:Key="str_RecentProjectLinkFmt">#{0}: {1}</system:String>-->

View File

@ -19,7 +19,7 @@ not necessary to understand this to use the program.</i></p>
<h2><a name="analysis-process">Analysis Process</a></h2>
<p>Analysis of the file data is a complex multi-step process. Some
changes to the project, such as adding a code entry point hint or
changes to the project, such as adding a code start point or
changing the CPU selection, require a full re-analysis of instructions
and data. Other changes, such as adding or removing a label, don't
affect the code tracing and only require a re-analysis of the data areas.
@ -279,7 +279,7 @@ out wrong more often than right.</p>
</ul>
<p>Sometimes the indirect jump targets are coming from a table of
addresses in the file. If so, these can be formatted as addresses,
and then the target locations hinted as code entry points.</p>
and then the target locations tagged as code entry points.</p>
<p>The 65816 adds an additional twist: 16-bit data access instructions
use the data bank register ("B") to determine which bank to load from.
SourceGen can't determine what the value is, so it currently assumes
@ -304,7 +304,7 @@ branch will be ignored. If an extension script tries to flag bytes
as inline data that have already been executed, the script will be
ignored. This can lead to a race condition in the analyzer if
an extension script is doing the wrong thing. (The race doesn't exist
with inline data hints specified by the user, because those are applied
with inline data tags specified by the user, because those are applied
before code analysis starts.)</p>

View File

@ -30,7 +30,7 @@ and 65816 code. The official web site is
<li><a href="intro.html#sgintro">How SourceGen Works</a>
<ul>
<li><a href="intro.html#scripts">Extension Scripts</a></li>
<li><a href="intro.html#hints">Analyzer Hints</a></li>
<li><a href="intro.html#atags">Code Analyzer Start, Stop, and Skip</a></li>
</ul></li>
<li><a href="intro.html#sgconcepts">SourceGen Concepts</a></li>
<li><a href="intro.html#about-symbols">All About Symbols</a>
@ -61,7 +61,7 @@ and 65816 code. The official web site is
<li><a href="mainwin.html#info">Info Window</a></li>
<li><a href="mainwin.html#messages">Messages Window</a></li>
<li><a href="mainwin.html#navigation">Navigation</a></li>
<li><a href="mainwin.html#hints">Adding and Removing Hints</a></li>
<li><a href="mainwin.html#atags">Adding and Removing Analyzer Tags</a></li>
<li><a href="mainwin.html#address-table">Format Address Table</a></li>
<li><a href="mainwin.html#toggle-single">Toggle Single-Byte Format</a></li>
<li><a href="mainwin.html#format-as-word">Format As Word</a></li>

View File

@ -190,12 +190,13 @@ control codes are also allowed.</p>
of execution. Most of what a given instruction does isn't important;
only its effect on the flow of execution matters.</p>
<p>The code tracing has to start somewhere, so SourceGen uses "code entry
point hints" to identify places where execution may begin. By default,
a hint is placed at the start of the file. From there, the tracing process
walks through the code, pursuing all branches. In many cases, if you
mark all external entry points, SourceGen will automatically find all
executable code and separate it from variable storage and data areas.</p>
<p>The code tracing has to start somewhere, so SourceGen uses "code start
points" to identify places where execution may begin. By default,
the first byte of the file is tagged as a start point. From there, the
tracing process walks through the code, pursuing all branches. In many
cases, if you tag all external entry points, SourceGen will automatically
find all executable code and separate it from variable storage and
data areas.</p>
<p>As noted earlier, tracking the processor status flags can make the
analysis more accurate. Identifying situations where a branch instruction
@ -239,13 +240,13 @@ is launched, but may be manually deleted without harm.</p>
<a href="advanced.html#extension-scripts">advanced topics</a> section.</p>
<h3><a name="hints">Analyzer Hints</a></h3>
<h3><a name="atags">Code Analyzer Stop, Start, and Skip</a></h3>
<p>Sometimes SourceGen can't automatically find the start or end of an
instruction stream, or gets confused by inline data. These situations
can be resolved by adding an appropriate hint.</p>
can be resolved by adding analyzer tags.</p>
<p><b>Code entry point hints</b> tell the analyzer to add the offset
<p><b>Code start point</b> tags tell the analyzer to add the offset
to the list of instruction start points. Suppose you've got a code
library that begins with jump vectors, like this:</p>
<pre>
@ -272,7 +273,7 @@ L1009 CLC
<p>SourceGen doesn't see any code that jumps to $1003 or $1006, so it
assumes those are data. Further, the functions at those addresses may
also be considered data unless some bit of code reachable from L1009
calls into them. If you add a code hint to $1003 and $1006,
calls into them. If you tag $1003 and $1006 as code start points,
you'll get better results:</p>
<pre>
.ORG $1000
@ -282,9 +283,9 @@ you'll get better results:</p>
L1009 CLC
</pre>
<p>Be careful that you only add hints to the instruction opcode. If
you applied hints to the full range of bytes from $1003 to $1008, you would
end up with this:</p>
<p>Be careful that you only tag the instruction opcode byte. If
you tagged each and every byte from $1003 to $1008, you would
end up with a mess:</p>
<pre>
.ORG $1000
JMP L1009
@ -297,15 +298,15 @@ L1009 CLC
<p>The exact set of instructions shown depends on your CPU configuration.
The problem is that the bytes in the middle of the instruction have
been marked as entry points, and SourceGen is treating them as
been tagged as start points, so SourceGen is treating them as
embedded instructions. $EF and $12 aren't valid 6502 opcodes, so
they're being ignored, but $10 is BPL and $30 is BMI. Because hinting
they're being ignored, but $10 is BPL and $30 is BMI. Because tagging
multiple consecutive bytes is rarely useful, SourceGen only applies code
hints to the first byte in a selected line.</p>
start tags to the first byte in a selected line.</p>
<p><b>Data hints</b> tell the analyzer when it should stop. For example,
suppose address $ff00 is known to always be nonzero, and the code uses
that fact to get a branch-always on the 6502:</p>
<p><b>Code stop point</b> tags tell the analyzer when it should stop. For
example, suppose address $ff00 is known to always be nonzero, and the code
uses that fact to get a branch-always on the 6502:</p>
<pre>
.ORG $1000
LDA $ff00
@ -313,17 +314,18 @@ that fact to get a branch-always on the 6502:</p>
BRK $11
</pre>
<p>By placing a data hint on the BRK, you're telling the analyzer that
it should stop the current path of execution. (Note that this example
would actually be better solved by setting a status flag override on
the BNE that sets Z=0, so the code tracer will know it's a branch-always
and do the right thing.) It's only necessary to place a hint on the
very first (opcode) byte. Placing a data hint in the middle of what
SourceGen believes to be instruction will have no effect.</p>
<p>As with code hints, only the first byte in each selected line will
be hinted.</p>
<p>By tagging the BRK as a code stop point, you're telling the analyzer that
it should stop trying to execute code when it reaches that point. (Note
that this example would actually be better solved by setting a status flag
override on the BNE that sets Z=0, so the code tracer will know it's a
branch-always and just do the right thing.) As with code start points,
code stop points should only be placed on the opcode byte. Placing a
code stop point in the middle of what SourceGen believes to be instruction
will have no effect.</p>
<p>As with code start points, only the first byte in each selected line will
be tagged.</p>
<p><b>Inline data hints</b> identify bytes as being part of the
<p><b>Inline data</b> tags identify bytes as being part of the
instruction stream, but not instructions. A simple example of this
is the ProDOS 8 call interface on the Apple II, which looks like this:</p>
<pre>
@ -333,11 +335,13 @@ is the ProDOS 8 call interface on the Apple II, which looks like this:</p>
BCS BAD
</pre>
<p>The three bytes following the <code>JSR $bf00</code> should be hinted
as inline data, so that the code analyzer skips them and continues the
analysis at the <code>BCS</code>. Because you need to hint <i>every</i> byte
of inline data, all bytes in a selected line will receive hints.</p>
<p>If code branches into a region that is marked as inline data, the
<p>The three bytes following the <code>JSR $bf00</code> should be tagged
as inline data, so that the code analyzer skips over them and continues the
analysis at the <code>BCS</code> instruction. You can think of these as
"code skip" tags, but they're different from stop/start points, because
every byte of inline data must be tagged. When
applying the tag, all bytes in a selected line will be modified.</p>
<p>If code branches into a region that is tagged as inline data, the
branch will be ignored.</p>
@ -775,8 +779,8 @@ address of the byte before the target instruction, so we actually push
$1006.</p>
<p>The disassembler won't know that offset $1007 is code because nothing
appears to reference it. After adding a code hint at $1007, the project
looks like this:</p>
appears to reference it. After tagging $1007 as a code start point, the
project looks like this:</p>
<pre>
LDA #$10
PHA

View File

@ -112,11 +112,13 @@ assembler directive.</p>
field to open the
<a href="editors.html#flags">Edit Status Flag Override</a> dialog.</li>
<li><b>Attributes</b>. Some instructions and data items have
interesting attributes. '@' indicates an entry point, 'H' means
one or more bytes has a hint, '#' means execution will not continue
to the following instruction, '>' is shown for branch targets, and
'!' appears when a conditional branch is never taken. (This
column is rarely useful and can be hidden.)</li>
interesting attributes.
'@' indicates an entry point,
'T' means one or more bytes has an analyzer tag (code start/stop/skip),
'#' means execution will not continue to the following instruction,
'>' is shown for branch targets, and
'!' appears when a conditional branch is never taken.
(This column is rarely useful and can be hidden.)</li>
<li><b>Label</b>. If a label has been defined for this offset, by
the user or generated automatically, it will appear here. Also,
full-line items like long comments and notes will start in this
@ -198,11 +200,12 @@ enabled will depend on what you have selected in the main window.</p>
<li><a href="visualization.html#vis-and-sets">Create/Edit Visualization Set</a>.
Create a new visualization set or edit an existing set.</li>
<li><a href="#hints">Hinting</a> (Hint As Code Entry Point, Hint As
Data Start, Hint As Inline Data, Remove Hints). Enabled when one or more
code and data lines are selected. Remove Hints is only enabled when
at least one line has hints. The keyboard shortcuts for hints are
two-key combinations.</li>
<li><a href="#atags">Analyzer Tags</a> (Tag Address As Code Start Point,
Tag Address As Code Stop Point, Tag Bytes As Inline Data,
Remove Analyzer Tags).
Enabled when one or more code and data lines are selected. Remove
Analyzer Tags is only enabled when at least one line has tags. The
keyboard shortcuts are two-key combinations.</li>
<li><a href="#address-table">Format Address Table</a>. Formats
a series of bytes as parts of a table of addresses.</li>
@ -343,13 +346,13 @@ especially handy for undocumented instructions.</p>
<h3><a name="messages">Messages Window</a></h3>
<p>Sometimes a change will invalidate an earlier change. For example,
suppose you hint an area as data, and format it as a string.
Later on you hint it as code. You now have a block of code with a
string format record sitting in the middle of it. SourceGen tries very
hard not to throw away anything you've done, but it will ignore anything
invalid.</p>
suppose you add a code stop point, and format the data that follows
as a string. Later on you change it to a code start point. You now have
a block of executable code with a string format record sitting in the
middle of it. SourceGen tries very hard not to throw away anything
you've done, but it will ignore anything invalid.</p>
<p>If a problem like this is encountered, an entry is added to a list
of messages displayed at the bottom of the window. Each entry identifies
of messages displayed at the bottom of the main window. Each entry identifies
the nature of the problem, the severity of the problem, the offset where
it occurred, and what was done to resolve it. The problem categories
include:</p>
@ -359,11 +362,12 @@ include:</p>
<li>Unresolved weak ref: a reference to a non-existent symbol was found.</li>
<li>Invalid offset or length: the offset or length in a format object
had an invalid value.</li>
<li>Invalid descriptor: the format is inappropriate, e.g. formatting
an instruction as a string.</li>
<li>Invalid descriptor: the format descriptor is inappropriate,
e.g. formatting an instruction as a string.</li>
</ul>
<p>The "context" column will provide additional detail about the problem.
In most cases, the offending item will be ignored.</p>
<p>The "context" column will provide additional detail about the problem,
and the "resolution" column will indicate how it's being handled. In most
cases, the offending item will be ignored.</p>
<p>Double-clicking on an entry will jump to that offset.</p>
<p>The message list will not appear if there are no messages. You can
hide the list by clicking on the "Hide" button to the left of the messages.
@ -415,17 +419,20 @@ convenient. You can use Alt+Left/Right Arrow, or
Ctrl+- / Ctrl+Shift+-, as keyboard shortcuts.)</p>
<h3><a name="hints">Adding and Removing Hints</a></h3>
<h3><a name="atags">Adding and Removing Analyzer Tags</a></h3>
<p>To add code entry or data hints, select the desired offsets and
use Actions &gt; Hint As Code Entry Point or Hint As Data. Because code
hints mean "the code analyzer should start here", and data hints mean
"the code analyzer should stop here", there is rarely any reason to hint
multiple consecutive bytes. For this reason, only the first byte on each
selected line will be hinted.</p>
<p>For inline data, you need to hint every byte, so every byte in every
selected line is hinted when you select Hint As Inline Data. Similarly,
the Remove Hints menu item will remove hints from every byte.</p>
<p><i>(Note: These were referred to as code/data "hints" in older
versions of SourceGen.)</i></p>
<p>To set code start or stop points, select the desired offsets and
use Actions &gt; Tag Address As Code Start Point (or Stop Point). Because
these indicate a transition between code and data regions, there is rarely
any need to tag multiple consecutive bytes.
For this reason, only the first byte on each selected line will be tagged.</p>
<p>For inline data, you need to cover the entire range, so every byte in every
selected line is tagged when you select Tag Bytes As Inline Data. Similarly,
the Remove Analyzer Tags menu item will remove tags from every byte.</p>
<p>If you're having a hard time selecting just the right bytes because
the instructions are caught up in a multi-byte data item, such as an
@ -433,7 +440,7 @@ auto-detected character string, you can disable uncategorized data analysis
(the thing that creates the .STR and .FILL ops for you). You can do this
from the
<a href="settings.html#project-properties">project properties</a> editor,
or simply by hitting Ctrl+D. Hit that, apply the hint, then hit it
or simply by hitting Ctrl+D. Hit that, tag the byte or bytes, then hit it
again to re-enable the string &amp; fill analyzer.</p>
<p>Another approach is to use the "Toggle Single-Byte Format"
menu item to "flatten" the item.</p>
@ -466,7 +473,7 @@ values are to be pushed onto the stack for an RTS call.</p>
<p>While the .dd2 case is easy to format with the data operand editor,
formatting addresses whose components are split into multiple tables can
be tedious. Even in the easy case, you may want to create labels and set
code hints for each item.</p>
code start points for each item.</p>
<p>The Address Table Formatter helps you associate symbols with the
addresses in the table. It works for simple and "split" tables.</p>
@ -503,9 +510,10 @@ is split into sections.</p>
selection", which will just use whichever part you didn't specify for
the low and high bytes. If the table holds 16-bit addresses, you can
use the "Constant" field to specify the data bank.</li>
<li>Options: if the table holds the addresses of instructions, check
the "Add code entry hint if needed" box to add a code entry point hint
to anything that isn't already marked as an instruction.</li>
<li>Options: if the table holds the addresses of executable code, check
the "Tag targets as code start points" box. If the target address
hasn't been identified by the code analyzer through some other execution
path, it will be tagged as a code start point.</li>
<li>Generated Addresses: this shows the full list of addresses that are
generated with the current set of parameters. Each address is shown with
a file offset and a symbol. If the address can't be mapped within the
@ -530,11 +538,11 @@ memory. The low bytes and high bytes could be on separate 256-byte
pages. You just need to have all of the data selected.</p>
<p>It should be mentioned that SourceGen does not record the fact that the
data in question is part of a table. The formatting, labels, and code hints
are applied as if you entered them all individually by hand. The formatter
is just significantly more convenient. It also does everything as a single
undoable action, so if it comes out looking wrong, just hit "undo" and
try something else.</p>
data in question is part of a table. The formatting, labels, and code
start point tags are applied as if you entered them all individually by
hand. The formatter is just significantly more convenient. It also
does everything as a single undoable action, so if it comes out looking
wrong, just hit "undo" and try something else.</p>
<h3><a name="toggle-single">Toggle Single-Byte Format</a></h3>

View File

@ -263,8 +263,9 @@ BRK instructions should be handled as if they have an operand.</p>
<p>The entry flags determine the initial value for the processor status
flag register. Code that is unreachable internally (requiring a code
entry point hint) will use this value. This is chiefly of value for
65816 code, where the initial value of the M/X/E flags is significant.</p>
start point tag) will use this value. This is chiefly of value for
65816 code, where the initial value of the M/X/E flags has a significant
impact on how instructions are disassembled.</p>
<p>If "analyze uncategorized data" is checked, SourceGen will attempt to
identify character strings and regions that are filled with a repeated

View File

@ -392,28 +392,29 @@ to the Examples directory, then from the Tutorial directory
select "Tutorial2".</p>
<p>The first thing you'll notice is that we immediately ran into a BRK,
which is a pretty reliable sign that we're not in a code section. The
generic profile puts a code entry point hint on the first byte, but that's
generic profile puts a code start point tag on the first byte, but that's
wrong here. This particular file begins with <code>00 20</code>, which
could be a load address (some C64 binaries look like this). So let's start
with that assumption.</p>
<p>Click on the first line of code at address $1000, and select
Actions &gt; Remove Hints. The $20 got absorbed into a string. The string
is making it hard to manipulate the next few bytes, so let's fix that by
selecting Edit &gt; Toggle Data Scan (Ctrl+D). This turns off the feature
that looks for strings and .FILL regions, so now each uncategorized byte is
on its own line.</p>
Actions &gt; Remove Analyzer Tags. The $20 got absorbed into a string. The
string is making it hard to manipulate the next few bytes, so let's fix
that by selecting Edit &gt; Toggle Data Scan (Ctrl+D). This turns off
the feature that looks for strings and .FILL regions, so now each
uncategorized byte is on its own line.</p>
<p>You could select the first two lines and use Actions &gt; Edit Operand
to format them as a 16-bit little-endian hex value, but there's a shortcut:
select only the first line of code, then Actions &gt; Format As Word (Ctrl+W). It
automatically grabbed the following byte and combined them. Since we believe
$2000 is the load address for everything that follows, click on the line
with address $1002, select Actions &gt; Set Address, and enter "2000". With
that line still selected, use Actions &gt; Hint As Code Entry Point
(Ctrl+H then Ctrl+C) to identify it as code.</p>
select only the first line of code, then Actions &gt; Format As Word (Ctrl+W).
It automatically grabbed the following byte and combined them. Since we
believe $2000 is the load address for everything that follows, click on
the line with address $1002, select Actions &gt; Set Address, and
enter "2000". With that line still selected, use
Actions &gt; Tag Address As Code Start Point (Ctrl+H then Ctrl+C) to
identify it as code.</p>
<p>That looks better, but it's branching off the bottom of the screen
(unless you have a really tall screen or small fonts) because of all the
intervening data. Use Edit &gt; Toggle Data Scan to turn the string
finder back on.</p>
intervening data. Use Edit &gt; Toggle Data Scan to turn the
string-finder back on.</p>
<p>There are four strings starting at address $2004, each of which is
followed by $00. These look like null-terminated strings, so let's make
@ -525,9 +526,10 @@ point past the inline data before returning (technically, it points at
the very last byte of the inline data, because RTS jumps to address + 1).</p>
<p>To format the data, we first need to tell SourceGen that there's data
in line with the code. Select the line at address $206E, then
shift-click the line at address $2077. Use Actions > Hint as Inline Data.</p>
shift-click the line at address $2077. Use
Actions > Tag Bytes As Inline Data.</p>
<p>The data turns to single-byte values, and we now see the code
continuing at address $2078. We can format the data as string by
continuing at address $2078. We can format the data as a string by
using Actions > Edit Operand, setting the Character Encoding to "Low or
High ASCII", and choosing "null-terminated strings".</p>
@ -612,8 +614,8 @@ change. Double-click the initial .ORG statement, and change it from
$2000 to $1d60. We can now see that $1d70 starts right after this
initial chunk of code.</p>
<p>Select the line with address $1d70, then Actions &gt; Hint As Code
Entry Point.
<p>Select the line with address $1d70, then
Actions &gt; Tag Address As Code Start Point.
More code appears, but not much -- if you scroll down you'll see that most
of the file is still data. The code at $1d70 searches through a table at
$1d88 for a match with the contents of the accumulator. If it finds a match,
@ -625,7 +627,8 @@ must be the desired address minus one.</p>
<p>The first byte in the first address table at $1d97 (which has the auto-label
L1D97) is $b4. The first byte in the second table is $1d. So the first
address we want is $1db4 + 1 = $1db5.</p>
<p>Select the line at $1db5, and use Actions &gt; Hint As Code Entry Point.
<p>Select the line at $1db5, and use
Actions &gt; Tag Address As Code Start Point.
More code appears, but again it's only a few lines. Let's dress this one
up a bit. Set a label on the code at $1db5 called "FUNC". At $1d97, edit
the data item (double-click on "$b4"), click "Single bytes", then type "FUNC"
@ -654,7 +657,7 @@ checkbox. As soon as you do, the first line of the Generated Addresses
list should show the symbol "FUNC". The rest of the addresses will look like
<code>(+) T1DD0</code>. The "(+)" means that a label was not found at
that location, so a label will be generated automatically.</p>
<p>Down near the bottom, check the "add code entry hint if needed" checkbox.
<p>Down near the bottom, check the "tag targets as code start points" checkbox.
Because we saw the table contents being pushed onto the stack for RTS,
we know that they're all code entry points.</p>
<p>Click "OK". The table of address bytes at $1d97 should now all be
@ -664,7 +667,7 @@ last dozen bytes at the end of the file. (If this isn't the case, use
Edit &gt; Undo, then work through the steps again.)</p>
<p>The formatter did the same steps you went through earlier -- set a
label, apply the label to the low and high bytes in the table, add a
code entry point hint -- but did several of them at once.</p>
code start point tag -- but did several of them at once.</p>
<p>We don't want to save this project, so select File &gt; Close. When
SourceGen asks for confirmation, click Discard & Continue.</p>

View File

@ -115,7 +115,7 @@ limitations under the License.
<GroupBox Header="Options">
<StackPanel>
<CheckBox Content="Add code entry hint if needed" Margin="0,4,0,0"
<CheckBox Content="Tag targets as code start points" Margin="0,4,0,0"
IsChecked="{Binding WantCodeHints}"/>
</StackPanel>
</GroupBox>

View File

@ -142,9 +142,9 @@ limitations under the License.
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="GotoLastChangeCmd" Text="Go to Last Change"/>
<RoutedUICommand x:Key="HintAsCodeEntryPointCmd" Text="Hint As Code Entry Point"/>
<RoutedUICommand x:Key="HintAsDataStartCmd" Text="Hint As Data Start"/>
<RoutedUICommand x:Key="HintAsInlineDataCmd" Text="Hint As Inline Data"/>
<RoutedUICommand x:Key="TagAsCodeStartPointCmd" Text="Tag Address As Code Start Point"/>
<RoutedUICommand x:Key="TagAsCodeStopPointCmd" Text="Tag Address As Code Stop Point"/>
<RoutedUICommand x:Key="TagAsInlineDataCmd" Text="Tag Bytes As Inline Data"/>
<RoutedUICommand x:Key="JumpToOperandCmd" Text="Jump to Operand">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl+J</KeyGesture>
@ -176,7 +176,7 @@ limitations under the License.
<KeyGesture>Ctrl+Shift+R</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="RemoveHintsCmd" Text="Remove Hints"/>
<RoutedUICommand x:Key="RemoveAnalyzerTagsCmd" Text="Remove Analyzer Tags"/>
<RoutedUICommand x:Key="SelectAllCmd" Text="Select All">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl+A</KeyGesture>
@ -288,12 +288,12 @@ limitations under the License.
CanExecute="CanUndo" Executed="GotoLastChangeCmd_Executed"/>
<CommandBinding Command="Help"
Executed="HelpCmd_Executed"/>
<CommandBinding Command="{StaticResource HintAsCodeEntryPointCmd}"
CanExecute="CanHintAsCodeEntryPoint" Executed="HintAsCodeEntryPointCmd_Executed"/>
<CommandBinding Command="{StaticResource HintAsDataStartCmd}"
CanExecute="CanHintAsDataStart" Executed="HintAsDataStartCmd_Executed"/>
<CommandBinding Command="{StaticResource HintAsInlineDataCmd}"
CanExecute="CanHintAsInlineData" Executed="HintAsInlineDataCmd_Executed"/>
<CommandBinding Command="{StaticResource TagAsCodeStartPointCmd}"
CanExecute="CanTagAsCodeStartPoint" Executed="TagAsCodeStartPointCmd_Executed"/>
<CommandBinding Command="{StaticResource TagAsCodeStopPointCmd}"
CanExecute="CanTagAsCodeStopPoint" Executed="TagAsCodeStopPointCmd_Executed"/>
<CommandBinding Command="{StaticResource TagAsInlineDataCmd}"
CanExecute="CanTagAsInlineData" Executed="TagAsInlineDataCmd_Executed"/>
<CommandBinding Command="{StaticResource JumpToOperandCmd}"
CanExecute="CanJumpToOperand" Executed="JumpToOperandCmd_Executed"/>
<CommandBinding Command="{StaticResource NavigateBackwardCmd}"
@ -312,8 +312,8 @@ limitations under the License.
CanExecute="CanRedo" Executed="RedoCmd_Executed"/>
<CommandBinding Command="{StaticResource ReloadExternalFilesCmd}"
CanExecute="IsProjectOpen" Executed="ReloadExternalFilesCmd_Executed"/>
<CommandBinding Command="{StaticResource RemoveHintsCmd}"
CanExecute="CanRemoveHints" Executed="RemoveHintsCmd_Executed"/>
<CommandBinding Command="{StaticResource RemoveAnalyzerTagsCmd}"
CanExecute="CanRemoveAnalyzerTags" Executed="RemoveAnalyzerTagsCmd_Executed"/>
<CommandBinding Command="Save"
CanExecute="CanSaveProject" Executed="SaveCmd_Executed"/>
<CommandBinding Command="SaveAs"
@ -433,10 +433,10 @@ limitations under the License.
<MenuItem Command="{StaticResource EditLocalVariableTableCmd}"/>
<MenuItem Command="{StaticResource EditVisualizationSetCmd}"/>
<Separator/>
<MenuItem Command="{StaticResource HintAsCodeEntryPointCmd}" InputGestureText="Ctrl+H, Ctrl+C"/>
<MenuItem Command="{StaticResource HintAsDataStartCmd}" InputGestureText="Ctrl+H, Ctrl+D"/>
<MenuItem Command="{StaticResource HintAsInlineDataCmd}" InputGestureText="Ctrl+H, Ctrl+I"/>
<MenuItem Command="{StaticResource RemoveHintsCmd}" InputGestureText="Ctrl+H, Ctrl+R"/>
<MenuItem Command="{StaticResource TagAsCodeStartPointCmd}" InputGestureText="Ctrl+H, Ctrl+C"/>
<MenuItem Command="{StaticResource TagAsCodeStopPointCmd}" InputGestureText="Ctrl+H, Ctrl+D"/>
<MenuItem Command="{StaticResource TagAsInlineDataCmd}" InputGestureText="Ctrl+H, Ctrl+I"/>
<MenuItem Command="{StaticResource RemoveAnalyzerTagsCmd}" InputGestureText="Ctrl+H, Ctrl+R"/>
<Separator/>
<MenuItem Command="{StaticResource FormatAddressTableCmd}"/>
<MenuItem Command="{StaticResource ToggleSingleByteFormatCmd}"/>

View File

@ -211,25 +211,25 @@ namespace SourceGen.WpfGui {
private void AddMultiKeyGestures() {
RoutedUICommand ruic;
ruic = (RoutedUICommand)FindResource("HintAsCodeEntryPointCmd");
ruic = (RoutedUICommand)FindResource("TagAsCodeStartPointCmd");
ruic.InputGestures.Add(
new MultiKeyInputGesture(new KeyGesture[] {
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl+C")
}));
ruic = (RoutedUICommand)FindResource("HintAsDataStartCmd");
ruic = (RoutedUICommand)FindResource("TagAsCodeStopPointCmd");
ruic.InputGestures.Add(
new MultiKeyInputGesture(new KeyGesture[] {
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
new KeyGesture(Key.D, ModifierKeys.Control, "Ctrl+D")
}));
ruic = (RoutedUICommand)FindResource("HintAsInlineDataCmd");
ruic = (RoutedUICommand)FindResource("TagAsInlineDataCmd");
ruic.InputGestures.Add(
new MultiKeyInputGesture(new KeyGesture[] {
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
new KeyGesture(Key.I, ModifierKeys.Control, "Ctrl+I")
}));
ruic = (RoutedUICommand)FindResource("RemoveHintsCmd");
ruic = (RoutedUICommand)FindResource("RemoveAnalyzerTagsCmd");
ruic.InputGestures.Add(
new MultiKeyInputGesture(new KeyGesture[] {
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
@ -1081,7 +1081,7 @@ namespace SourceGen.WpfGui {
e.CanExecute = IsProjectOpen() && mMainCtrl.CanFormatAddressTable();
}
private void CanHintAsCodeEntryPoint(object sender, CanExecuteRoutedEventArgs e) {
private void CanTagAsCodeStartPoint(object sender, CanExecuteRoutedEventArgs e) {
if (!IsProjectOpen()) {
e.CanExecute = false;
return;
@ -1090,7 +1090,7 @@ namespace SourceGen.WpfGui {
e.CanExecute = (counts.mDataLines > 0 || counts.mCodeLines > 0) &&
(counts.mDataHints != 0 || counts.mInlineDataHints != 0 || counts.mNoHints != 0);
}
private void CanHintAsDataStart(object sender, CanExecuteRoutedEventArgs e) {
private void CanTagAsCodeStopPoint(object sender, CanExecuteRoutedEventArgs e) {
if (!IsProjectOpen()) {
e.CanExecute = false;
return;
@ -1099,7 +1099,7 @@ namespace SourceGen.WpfGui {
e.CanExecute = (counts.mDataLines > 0 || counts.mCodeLines > 0) &&
(counts.mCodeHints != 0 || counts.mInlineDataHints != 0 || counts.mNoHints != 0);
}
private void CanHintAsInlineData(object sender, CanExecuteRoutedEventArgs e) {
private void CanTagAsInlineData(object sender, CanExecuteRoutedEventArgs e) {
if (!IsProjectOpen()) {
e.CanExecute = false;
return;
@ -1108,7 +1108,7 @@ namespace SourceGen.WpfGui {
e.CanExecute = (counts.mDataLines > 0 || counts.mCodeLines > 0) &&
(counts.mCodeHints != 0 || counts.mDataHints != 0 || counts.mNoHints != 0);
}
private void CanRemoveHints(object sender, CanExecuteRoutedEventArgs e) {
private void CanRemoveAnalyzerTags(object sender, CanExecuteRoutedEventArgs e) {
if (!IsProjectOpen()) {
e.CanExecute = false;
return;
@ -1283,18 +1283,18 @@ namespace SourceGen.WpfGui {
mMainCtrl.ShowHelp();
}
private void HintAsCodeEntryPointCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("hint as code entry point");
private void TagAsCodeStartPointCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("tag as code start point");
mMainCtrl.MarkAsType(CodeAnalysis.TypeHint.Code, true);
}
private void HintAsDataStartCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("hint as data start");
private void TagAsCodeStopPointCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("tag as code stop point");
mMainCtrl.MarkAsType(CodeAnalysis.TypeHint.Data, true);
}
private void HintAsInlineDataCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("hint as inline data");
private void TagAsInlineDataCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("tag as inline data");
mMainCtrl.MarkAsType(CodeAnalysis.TypeHint.InlineData, false);
}
@ -1343,8 +1343,8 @@ namespace SourceGen.WpfGui {
mMainCtrl.ReloadExternalFiles();
}
private void RemoveHintsCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("remove hints");
private void RemoveAnalyzerTagsCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
Debug.WriteLine("remove atags");
mMainCtrl.MarkAsType(CodeAnalysis.TypeHint.NoHint, false);
}