Compare commits

...

4 Commits

Author SHA1 Message Date
Andy McFadden 948e4a2bf2
Update README.md
Mention Wine v9.
2024-04-22 17:50:15 -07:00
Andy McFadden aa05aa7a80 Version 1.8.6-dev1 2024-04-22 17:39:25 -07:00
Andy McFadden 47b11b6797 Document new label placement setting 2024-04-22 17:35:21 -07:00
Andy McFadden 9e82ff8b88 Make label files look more like cc65 output
The cc65 docs say VICE labels start with '.'.  Also, output local
labels prefixed with '@', per ca65 convention.  The default output
file is now "labels.lbl".

Added some minimal documentation.

(issue #151)
2024-04-22 15:09:23 -07:00
8 changed files with 40 additions and 13 deletions

View File

@ -143,8 +143,8 @@ The framework requires Win7 SP1, Win8.1, Win10 updated through at least the
Anniversary Update (1607), or Win11. (One user who had trouble with the
4.7.2 installer was able to get the 4.6.2 installer to work.)
SourceGen does not currently run on Linux or Mac OS. This may be changing
with the development of [wine-mono](https://github.com/madewokherd/wine-mono).
SourceGen does not run natively on Linux or Mac OS. It is reported
to work with recent versions (v9+) of the [Wine emulation layer](https://winehq.org/).
(SourceGen versions 1.0 and 1.1 used the WinForms API, which has been
implemented for [Mono](https://www.mono-project.com/), but after

View File

@ -25,6 +25,6 @@ namespace SourceGen {
/// SourceGen version number.
/// </summary>
public static readonly CommonUtil.Version ProgramVersion =
new CommonUtil.Version(1, 8, 5, CommonUtil.Version.PreRelType.Final, 0);
new CommonUtil.Version(1, 8, 6, CommonUtil.Version.PreRelType.Dev, 1);
}
}

View File

@ -70,7 +70,15 @@ namespace SourceGen {
// VICE format is "add_label <address> <label>", but may be abbreviated "al".
// We could also use ACME format ("labelname = $1234 ; Maybe a comment").
foreach (Symbol sym in symList) {
outStream.WriteLine("al " + sym.Value.ToString("x6") + " " + sym.Label);
string label = sym.LabelWithoutTag;
if (sym.IsNonUnique) {
// Use the cc65 convention for local labels.
label = '@' + label;
}
// The cc65 docs (https://www.cc65.org/doc/debugging-4.html) say all labels
// must be prefaced with '.'.
label = '.' + label;
outStream.WriteLine("al " + sym.Value.ToString("x6") + " " + label);
}
}
}

View File

@ -2566,8 +2566,8 @@ namespace SourceGen {
string filter;
switch (dlg.Format) {
case LabelFileGenerator.LabelFmt.VICE:
ext = ".vs";
filter = "VICE commands (*.vs)|*.vs";
ext = ".lbl";
filter = "VICE labels (*.lbl)|*.lbl";
break;
default:
Debug.Assert(false, "bad format");

View File

@ -84,6 +84,7 @@ namespace SourceGen {
/// <remarks>
/// Non-unique labels have extra stuff at the end to make them unique. That is
/// included here, so that the Label field is still viable as a unique identifier.
/// Use <see cref="LabelWithoutTag"/> to get just the label.
/// </remarks>
public string Label { get; private set; }

View File

@ -385,7 +385,7 @@ clipboard and pasting them into a text file, except that you have greater
control over which columns are included. The HTML version is augmented
with links and (optionally) images.</p>
<p>Use File &gt; Export to open the export dialog. You have several
<p>Use <samp>File &gt; Export</samp> to open the export dialog. You have several
options:</p>
<ul>
<li><b>Include only selected lines</b>. This allows you to choose between
@ -425,6 +425,13 @@ will be written to the same directory.</p>
<p>All output uses UTF-8 encoding. Filenames of HTML files will have '#'
replaced with '_' to make linking easier.</p>
<h2 id="generate-labels">Generating Label Files</h2>
<p>Some debuggers allow the import of labels associated with addresses.
To generate such a file, use <samp>File &gt; Generate Label File</samp>.</p>
<p>Select the desired output format (currently only VICE label commands
are supported), and whether or not to include auto-generated labels.</p>
</div>
<div id="footer">

View File

@ -140,6 +140,7 @@ using the <samp>Help &gt; Help</samp> menu item or by hitting
</ul></li>
</ul></li>
<li><a href="codegen.html#export-source">Exporting Source Code</a>
<li><a href="codegen.html#generate-labels">Generating Label Files</a>
</ul></li>
<li><a href="settings.html">Properties &amp; Settings</a>

View File

@ -209,12 +209,6 @@ counts are inserted into end-of-line comments. This works the same as
the option in the <samp>Code View</samp> tab, but applies to generated
source code rather than the on-screen display.</p>
<p>If <samp>put long labels on separate line</samp> is checked, labels
that are longer than the label column are placed on their own line. This
looks a bit nicer because otherwise the opcode gets pushed out of alignment.
(Some assemblers get bent out of shape if you split an equate
directive, so those might stay on one line.)</p>
<p>If you enable <samp>identify assembler in output</samp>, a comment will be
added to the top of the generated assembly output that identifies the
target assembler and version. It also shows the command-line options
@ -223,6 +217,22 @@ file is sent to other people, since it may not otherwise be obvious from
the source file what the intended target assembler is, or what options
are required to process the file correctly.</p>
<p>Labels can generally be placed either on the same line as a code or data
operand, or on the line before it. Placing them on the same line makes
the output a bit more compact, but if the label is longer than the label
column is wide, the subsequent fields can be pushed out of alignment.
The placement is configurable. Labels can be output on their own line:</p>
<ol>
<li>Only when required - labels will not be placed on a separate line
unless the assembler requires them to be.</li>
<li>When the label is wider than the field - labels will only be
placed on a separate line when they don't fit in the label column.</li>
<li>Whenever possible - labels are always placed on a separate line
when they are allowed to be. Most assemblers require that the label
be on the same line as assignment pseudo-ops,
e.g. "<code>FOO = $1000</code>".</li>
</ol>
<h2 id="project-properties">Project Properties</h2>