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.
This commit is contained in:
Andy McFadden committed 2025-08-01 13:36:32 -07:00
1 parent 3e344281a2
commit a4b71e0c9b
11 files changed
+63 -40

No files matched your search

+36 -22
View File
@@ -852,7 +852,9 @@ embedded instructions. $EF and $12 aren't valid 6502 opcodes, so
they're being ignored, but $10 is <code>BPL</code> and $30 is
<code>BMI</code>.
Because tagging multiple consecutive bytes is rarely useful, SourceGen
only applies code start tags to the first byte in a selected line.</p>
only applies code start tags to the first byte in a selected line.
As a special case, if it detects a series of <code>JMP</code> instructions,
it will offer to format the full set.</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
@@ -881,8 +883,8 @@ 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>
JSR $bf00
.DD1 $function
.DD2 $address
.DD1 function
.DD2 address
BCS BAD
</pre>
@@ -937,26 +939,27 @@ ENTRY2 CLC
[ ... ]
</pre>
<p>Calling ENTRY1 sets the carry and skips the CLC, which is embedded
in the BCC instruction. Calling ENTRY2 clears the carry.</p>
<p>When this is disassembled, all paths are shown, but the BCC line has
a downward triangle, and the "bytes" column is partially filled.</p>
<p>Calling ENTRY1 sets the carry and skips the <code>CLC</code>, which
is embedded in the <code>BCC</code> instruction. Calling ENTRY2 clears
the carry.</p>
<p>When this is disassembled, all paths are shown, but the <code>BCC</code>
line has a downward triangle, and the "bytes" column is partially filled.</p>
<pre>
c305: 38 ENTRY1 sec
c306: 90 bcc &#x25bc; LC320
c307: 18 ENTRY2 clc
</pre>
<p>The BCC appears to branch to $C320. Even though the branch is never
taken when the code is executed, the disassembler will create a label at
the target address, and generate an entry in the cross-reference table.
(The disassembler knows that the branch is never taken and doesn't try to
follow it to execute code there, but for various reasons it's often useful
to treat it as a valid address reference anyway.) When the target address
is in an awkward place, such as the middle of a data item or instruction,
this can be disruptive.</p>
<p>The <code>BCC</code> appears to branch to <code>$C320</code>. Even
though the branch is never taken when the code is executed, the disassembler
will create a label at the target address, and generate an entry in the
cross-reference table. (The disassembler knows that the branch is never
taken and doesn't try to follow it to execute code there, but for various
reasons it's often useful to treat it as a valid address reference anyway.)
When the target address is in an awkward place, such as the middle of a
data item or instruction, this can be disruptive.</p>
<p>This problem can be remedied by editing the operand of the BCC
<p>This problem can be remedied by editing the operand of the <code>BCC</code>
instruction and checking the "disregard operand address" box. The
operand will be formatted as a plain hex value instead.</p>
@@ -975,15 +978,26 @@ ENTRY2 LDA #$FF
2c10: a9 ff L2C10 lda #$ff
</pre>
<p>In this case, the BIT instruction performs an operation whose result
is ignored. So long as accesses to address $FFA9 don't have any side-effects,
this works fine. We don't want the disassembly to generate a label or look
for a matching project symbol, though, so the BIT instruction should also
have the "disregard operand address" box checked.</p>
<p>In this case, the <code>BIT</code> instruction performs an operation
whose result is ignored. So long as accesses to address <code>$FFA9</code>
don't have any side-effects, this works fine. We don't want the disassembly
to generate a label or look for a matching project symbol, though, so the
<code>BIT</code> instruction should also have the "disregard operand address"
box checked.</p>
<p>It should be noted that disregarding the operand does not prevent you
from formatting it. You can even format it as a symbol by specifying one
in the operand editor.</p>
in the operand editor, in which case a cross-reference to that symbol
will be generated.</p>
<p>An alternative approach is to <a href="#atags">tag</a> the opcode
byte of the branch or <code>BIT</code> instruction as inline data. This
will prevent the code analyzer from seeing it as an instruction at all. The
down side of doing this is that the code analyzer will no longer be able to
see all possible paths through the code, and might not see flag changes. For
example, if you tagged the <code>BCC</code> instruction in the first example
as inline data, the analyzer would think that the carry flag was always
clear in the subsequent code.</p>
<h2 id="pseudo-ops">Data and Directive Pseudo-Opcodes</h2>
+5 -1
View File
@@ -281,7 +281,11 @@
code start point tag -->
but applied them to multiple locations in one shot. The next step in
the disassembly process would be to rename the "Tnnnn" labels to
something more meaninful.</p>
something more meaningful. An easy way to do this is to select
one of the lines in the table and use
<samp>Actions > Edit Operand Target Label</samp>. For example,
if you do this on line $1D97, you will edit the <samp>FUNC</samp>
label.</p>
<p>We don't want to save this project, so select
<samp>File &gt; Close</samp>. When SourceGen asks for confirmation,
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

+6 -5
View File
@@ -131,7 +131,7 @@
the project ("<i>project symbols</i>"), or in a symbol file that can be
included in multiple projects ("<i>platform symbols</i>"). The SourceGen
distribution includes platform symbol files with ROM addresses for
several common systems.</p>
several common systems, and you can create your own.</p>
</div>
</div>
@@ -348,8 +348,9 @@
<img src="images/t1-local-loop1.png" alt="t1-local-loop1"/>
</div>
<div class="grid-item-text">
<p>The label at line $1002 (and the operand on line $100B) should now
be "<samp>@LOOP</samp>". By default, '@' is used to indicate non-unique labels,
<p>The label at line $1002 (and the <code>BPL</code> operand on line
$1009) should now be "<samp>@LOOP</samp>".
By default, '@' is used to indicate non-unique labels,
though you can change it to a different character in the application
settings.</p>
</div>
@@ -364,8 +365,8 @@
you type "<kbd>MAIN</kbd>" or "<kbd>IS_OK</kbd>" with Global selected you'll
get an error, but if you type "<kbd>@LOOP</kbd>" it will be accepted. Note
the "non-unique local" radio
button is selected automatically if you start a label with '@' (or
whatever character you have configured). Click <samp>OK</samp>.</p>
button is selected automatically if you start typing a label with '@' (or
whichever character you have configured). Click <samp>OK</samp>.</p>
<p>You now have two lines with the same label. In some cases the
assembly source generator may need to "promote" them to globals, or
rename them to make them unique, depending on what your preferred assembler
+2 -1
View File
@@ -214,7 +214,8 @@
</div>
<div class="grid-item-text">
<p>This confirms our idea that <code>XDATA</code> holds 16-bit addresses,
so let's format it. Select lines $2063 to $2066, and
so let's format it. Select lines $2063 to $2066 (the latter of
which continues through $206A), then
<samp>Actions &gt; Edit Operand</samp>.
The editor window should say "<samp>8 bytes selected</samp>" at the top.
Click the <samp>16-bit words, little-endian</samp> radio button,
+2 -2
View File
@@ -146,7 +146,7 @@
window on the bottom left. Notes are like long comments, with three key
differences:</p>
<ol>
<li>You can't really format the text, but you can pick their color.</li>
<li>You can't really format the text, but you can pick the color.</li>
<li>They don't appear in generated assembly sources, making them
useful for leaving notes to yourself as you work.</li>
<li>They're listed in the Notes window. Double-clicking them jumps
@@ -310,7 +310,7 @@
in the References and Notes windows. (They can, however, be distracting,
so you'll be forgiven if you reduce the offset column width to zero.)</p>
<p>In some cases, such as programs with multiple segments or overlays,
the same address may apply to several different areas. SourceGen fully
the same address may appear in several different areas. SourceGen fully
supports binaries with overlapping parts.</p>
</div>
</div>
+1 -1
View File
@@ -115,7 +115,7 @@
<kbd class="key">PgUp</kbd>/<kbd class="key">PgDn</kbd>. Scroll the window
with the mouse wheel, or by dragging the scroll bar thumb.</p>
<p>Each row is divided into nine columns. You can adjust the column
widths by clicking and dragging the column dividers in the header</p>
widths by clicking and dragging the column dividers in the header.</p>
</div>
</div>
+4 -2
View File
@@ -191,7 +191,8 @@
</div>
<div class="grid-item-text">
<p>While we're here, the code at $2092 looks a bit strange.
<code>LDX</code>, then a <code>BIT</code> with a weird symbol, then
<code>LDX</code>, then a <code>BIT</code> instruction with a weird
'&#x25bc;' symbol, then
another <code>LDX</code>. If you look at the "Bytes" column, you'll
notice that the three-byte <code>BIT</code> instruction has only one
byte on its line.</p>
@@ -202,7 +203,8 @@
<div class="grid-item-text">
<p>The trick here is that the <code>LDX #$01</code> is embedded inside the
<code>BIT</code> instruction. When the code runs through here, X is set
to $00, then the <code>BIT</code> instruction sets some flags, then the
to $00, then the <code>BIT</code> instruction sets some flags (which
are ignored), then the
following <code>STA</code> runs. Several lines down at $20A4 there's a
<code>BNE</code> to $2095, which is in the middle of the <code>BIT</code>
instruction. It loads X with $01, then also continues to the <code>STA</code>.</p>
+1 -1
View File
@@ -127,7 +127,7 @@ be dead code that's never called, or it might be called from a table
that you can format to add code entry tags for multiple addresses with
a single operation. Taking the time to find the table and format it
is faster than hand-formatting dozens of little handlers, and it's
something you'll need to do eventually anyway.</p>
something you'll want to do eventually anyway.</p>
</div> <!-- #main -->
+6 -5
View File
@@ -161,7 +161,7 @@
<samp>Height</samp>
field to 8. As soon as you do, the preview window shows a big blue 'X'.
(The 'X' is 7x7; the last row/column of pixels are transparent so adjacent
images don't bump into each other.)</p>
images are visually separated in the game.)</p>
</div>
</div>
@@ -210,7 +210,7 @@
set, create a new visualization. The height will default to 8 because
that's what you used last time, so you shouldn't have to
make any changes to the initial values.
Click <samp>OK</samp> in both dialogs to close them.</p>
Click <samp>OK</samp> in both dialogs to accept the change.</p>
</div>
</div>
@@ -220,8 +220,8 @@
</div>
<div class="grid-item-text">
<p>Repeat the process at line $101A, but this time the image is 40x40
rather than 8x8. Set the width to 5, and the height to 40. This makes
a mess.</p>
pixels rather than 8x8. Set the width to 5, and the height to 40.
This makes a mess.</p>
</div>
</div>
@@ -236,7 +236,8 @@
<samp>Row stride (bytes)</samp> field to 8.
Now we have a proper Tic-Tac-Toe grid.
Note that it fills the preview window just as the 'X' and 'O' did, even
though it's 5x as large. The preview window scales everything up. Hit
though it's 5x as large. The preview display scales everything to fit
the current window size (try resizing it). Hit
<samp>OK</samp> twice to create the visualization.</p>
</div>
</div>