mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-06 23:30:56 +00:00
Documentation update
Also, make "spaces between numbers in bytes column" default to enabled.
This commit is contained in:
parent
62c15031fd
commit
354d106665
@ -292,6 +292,7 @@ namespace SourceGen {
|
||||
settings.SetBool(AppSettings.FMT_UPPER_OPERAND_A, true);
|
||||
settings.SetBool(AppSettings.FMT_UPPER_OPERAND_S, true);
|
||||
settings.SetBool(AppSettings.FMT_ADD_SPACE_FULL_COMMENT, true);
|
||||
settings.SetBool(AppSettings.FMT_SPACES_BETWEEN_BYTES, true);
|
||||
settings.SetString(AppSettings.FMT_OPCODE_SUFFIX_LONG, "l");
|
||||
settings.SetString(AppSettings.FMT_OPERAND_PREFIX_ABS, "a:");
|
||||
settings.SetString(AppSettings.FMT_OPERAND_PREFIX_LONG, "f:");
|
||||
|
@ -133,7 +133,7 @@ code, but also needs to know how to handle the corner cases.</p>
|
||||
<ul>
|
||||
<li>Undocumented opcode <code>SHA (ZP),Y</code> ($93) is not supported;
|
||||
the assembler appears to be expecting <code>SHA ABS,X</code> instead.</li>
|
||||
<li>COP and WDM are not allowed to have operands.</li>
|
||||
<li>WDM is not supported.</li>
|
||||
</ul>
|
||||
|
||||
<p>Quirks:</p>
|
||||
@ -152,11 +152,13 @@ code, but also needs to know how to handle the corner cases.</p>
|
||||
as case-sensitive. The <code>--case-sensitive</code> must be passed to
|
||||
the assembler.</li>
|
||||
<li>If you set the <code>--case-sensitive</code> flag, <b>all</b> opcodes
|
||||
and operands must be lower-case. Most of the SourceGen options used to
|
||||
show things in upper case must be disabled.</li>
|
||||
and operands must be lower-case. Most of the SourceGen options that
|
||||
cause things to appear in upper case must be disabled.</li>
|
||||
<li>For 65816, selecting the bank byte is done with the back-quote ('`')
|
||||
rather than the caret ('^'). (There's a note in the docs to the effect
|
||||
that they plan to move to carets.)</li>
|
||||
<li>The arguments to COP and BRK require immediate-mode syntax
|
||||
(<code>COP #$03</code> rather than <code>COP $03</code>).
|
||||
<li>By default, the assembler assumes that the input is PETSCII, but
|
||||
doesn't convert characters in text strings. So PETSCII source files
|
||||
generate PETSCII strings, and ASCII source files generate ASCII
|
||||
@ -170,13 +172,11 @@ code, but also needs to know how to handle the corner cases.</p>
|
||||
|
||||
<p>Notes:</p>
|
||||
<ul>
|
||||
<li>The "default text encoding" project property determines the text
|
||||
encoding for the entire file. For non-ASCII projects, a small
|
||||
encoding table is output at the top of the file. This works for
|
||||
C64 PETSCII and C64 screen codes, but not for high ASCII. This is
|
||||
done without passing "--ascii" on the command line. If the
|
||||
source file is converted to PETSCII, the encoding table should be
|
||||
removed.</li>
|
||||
<li>The "default text encoding" project property is used by SourceGen
|
||||
to set the text encoding for the entire source file. For non-ASCII
|
||||
projects, a small encoding table is generated at the top of the output.
|
||||
This works for C64 PETSCII and C64 screen codes, but not for high
|
||||
ASCII. This is done without passing "--ascii" on the command line.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -101,8 +101,8 @@ the operand itself opens a format editor; more on that later.)</p>
|
||||
References window. Note the selection jumps to L1002. You can immediately
|
||||
jump to any reference.</p>
|
||||
<p>At the top of the Symbols window on the right side of the screen is a
|
||||
row of buttons. Make sure "Auto" is selected. You should see three
|
||||
labels in the window (L1002, L1014, L1017). Double-click on L1014. The
|
||||
row of buttons. Make sure "Auto" and "Addr" are selected. You should see
|
||||
three labels in the window (L1002, L1014, L1017). Double-click on L1014. The
|
||||
selection jumps to the appropriate line.</p>
|
||||
|
||||
<p>Select Edit > Find. Type "hello", and hit Enter. The selection will
|
||||
@ -245,18 +245,18 @@ does it. The difference can be noted in the Info window.)</p>
|
||||
<h3>Editing Data Operands</h3>
|
||||
|
||||
<p>There's some string and numeric data down at the bottom of the file. The
|
||||
final string appears to be multiple strings stuck together. Notice that
|
||||
the opcode for the very last line is '+', which means it's a continuation
|
||||
of the previous line. Long data items can span multiple lines, split
|
||||
every 64 characters (including delimiters), but they are still single
|
||||
items: selecting any part selects the whole.</p>
|
||||
<p>Select the last line, then Actions > Edit Operand. You'll notice
|
||||
that this dialog is much different from the one you got when editing the
|
||||
operand of an instruction. At the top it will say "65 bytes selected". You
|
||||
can format this
|
||||
as a single 65-byte string, as 65 individual items, or various things
|
||||
in between. For now, select "Single bytes", and then on the right,
|
||||
select "ASCII". Click "OK".</p>
|
||||
final string appears to be multiple strings stuck together. (You may need
|
||||
to increase the width of the Operand column to see the whole thing.) Notice
|
||||
that the opcode for the very last line is '+', which means it's a
|
||||
continuation of the previous line. Long data items can span multiple
|
||||
lines, split every 64 characters (including delimiters), but they are
|
||||
still single items: selecting any part selects the whole.</p>
|
||||
<p>Select the last line in the file, then Actions > Edit Operand. You'll
|
||||
notice that this dialog is much different from the one you got when editing
|
||||
the operand of an instruction. At the top it will say "65 bytes
|
||||
selected". You can format this as a single 65-byte string, as 65 individual
|
||||
items, or various things in between. For now, select "Single bytes", and
|
||||
then on the right, select "ASCII (low or high) character". Click "OK".</p>
|
||||
<p>Each character is now on its own line. The selection still spans the
|
||||
same set of addresses.</p>
|
||||
<p>Select address $203D on its own, then Actions > Edit Label. Set the
|
||||
@ -345,13 +345,14 @@ tab. Click Add Symbol Files. The file browser starts in the RuntimeData
|
||||
directory. In the Apple folder, select <code>Applesoft.sym65</code>, and
|
||||
click Open. Click OK to close the project properties window.</p>
|
||||
<p>The STA instructions now reference <code>AMPERV</code>, which is noted
|
||||
as a call vector. We can see the code setting up a jump to $1d70. As it
|
||||
happens, the start address of the code is $1d60 -- the last four digits of
|
||||
the filename -- so let's make that 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>
|
||||
as a call vector. We can see the code setting up a jump (opcode $4c) to
|
||||
$1d70. As it happens, the start address of the code is $1d60 -- the last
|
||||
four digits of the filename -- so let's make that 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 > Hint As Code Entry Point.
|
||||
<p>Select the line with address $1d70, then Actions > Hint As Code
|
||||
Entry 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,
|
||||
@ -360,7 +361,7 @@ and the JMPs away. This code is pushing a return address onto the stack.
|
||||
When the code at CHRGET returns, it'll return to that address. Because of
|
||||
a quirk of the 6502 architecture, the address pushed must be the target
|
||||
address minus one.</p>
|
||||
<p>The first byte in the first table at $1d97 (which has the auto-label
|
||||
<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 > Hint As Code Entry Point.
|
||||
@ -421,7 +422,7 @@ 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 > Edit Operand
|
||||
to format them as a 16-bit little-endian hex value, but there's a shortcut:
|
||||
select the first line only, then Edit > Format As Word (Ctrl+W). It
|
||||
select only the first line of code, then Edit > 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 > Set Address, and enter "2000". With
|
||||
@ -501,7 +502,7 @@ Asm Config tab. Click the "Show cycle counts" checkbox, then click OK.</p>
|
||||
counts are adjusted for everything SourceGen can figure out. For example,
|
||||
the BEQ on line $205a shows "2+" cycles, meaning that it takes at least two
|
||||
cycles but might take more. That's because conditional branches take an
|
||||
extra cycles if the branch is taken. The BNE on line $2061" shows 3 cycles,
|
||||
extra cycle if the branch is taken. The BNE on line $2061" shows 3 cycles,
|
||||
because we know that the branch is always taken. (If you want to see why,
|
||||
look at the value of the 'Z' flag in the "flags" column. Lower-case 'z'
|
||||
means the zero-flag is clear.)</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user