2021-10-19 00:56:08 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2018-09-28 17:05:11 +00:00
|
|
|
|
|
|
|
<head>
|
2021-10-19 00:56:08 +00:00
|
|
|
<meta charset="utf-8"/>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="main.css"/>
|
|
|
|
<title>Tools - 6502bench SourceGen</title>
|
2018-09-28 17:05:11 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2018-10-09 17:04:10 +00:00
|
|
|
<div id="content">
|
2021-10-19 00:56:08 +00:00
|
|
|
<h1>SourceGen: Tools</h1>
|
|
|
|
|
|
|
|
<p>The <samp>Tools</samp> menu offers a selection of useful tools that
|
|
|
|
operate independently of the current project (if any).</p>
|
|
|
|
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="instruction-chart">Instruction Chart</h2>
|
2020-07-04 00:37:04 +00:00
|
|
|
|
2019-12-30 01:59:35 +00:00
|
|
|
<p>This opens a window with a summary of all 256 opcodes. The CPU can
|
2020-02-18 21:25:20 +00:00
|
|
|
be chosen from the pop-up list at the bottom. Undocumented opcodes for
|
|
|
|
6502/65C02 are shown in italics, and can be excluded from the list
|
|
|
|
by unchecking the box at the bottom.</p>
|
2019-12-30 01:59:35 +00:00
|
|
|
<p>The status flags affected by each instruction reflect their behavior
|
|
|
|
on the 65816. The only significant difference between 65816 and
|
2021-10-19 00:56:08 +00:00
|
|
|
6502/65C02 is the way the <code>BRK</code> instruction affects the
|
|
|
|
D and B/X flags.</p>
|
2019-12-30 01:59:35 +00:00
|
|
|
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="ascii-chart">ASCII Chart</h2>
|
2019-12-30 01:59:35 +00:00
|
|
|
|
|
|
|
<p>This opens a window with the ASCII character set. Each character is
|
|
|
|
displayed next to its numeric value in decimal and hexadecimal. The
|
|
|
|
pop-up list at the bottom allows you to flip between standard and "high"
|
|
|
|
ASCII.</p>
|
|
|
|
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="apple2-screen-chart">Apple II Screen Chart</h2>
|
2020-08-20 20:18:46 +00:00
|
|
|
|
|
|
|
<p>The Apple II text and hi-res screens are mapped to memory in a way
|
|
|
|
that makes sense to computers but is a little confusing for humans. This
|
|
|
|
chart maps line numbers to addresses and vice-versa. Select different
|
|
|
|
screens and sort orders from the list at the bottom.</p>
|
|
|
|
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="hexdump">Hex Dump Viewer</h2>
|
2018-09-28 17:05:11 +00:00
|
|
|
|
|
|
|
<p>You can use this to view the contents of the project data file
|
2021-10-19 00:56:08 +00:00
|
|
|
by double-clicking the values in the "Bytes" column, or with
|
|
|
|
<samp>Actions > Show Hex Dump</samp>.
|
2018-09-28 17:05:11 +00:00
|
|
|
The viewer is displayed in a "modeless" dialog that does not
|
|
|
|
prevent you from continuing to work with the project. If you
|
|
|
|
double-click a different line in the project, the viewer will automatically
|
|
|
|
highlight those bytes.</p>
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<p>You can also view the contents of arbitrary files by using
|
|
|
|
<samp>Tools > Hex Dump</samp>. There is no fixed limit on the number of
|
2018-09-28 17:05:11 +00:00
|
|
|
viewers you can have open simultaneously. (Be aware that the viewer
|
|
|
|
currently loads the entire file into memory, and you will run out of room
|
|
|
|
eventually. Not coincidentally, the viewer has a size limit of 16MiB
|
|
|
|
per file.)</p>
|
|
|
|
|
|
|
|
<p>You can select lines with the mouse as you would in any other list
|
2021-10-19 00:56:08 +00:00
|
|
|
view. <kbd class="key">Ctrl+A</kbd> selects all lines.
|
|
|
|
<kbd class="key">Ctrl+C</kbd> copies the selected lines to
|
2018-09-28 17:05:11 +00:00
|
|
|
the system clipboard.</p>
|
|
|
|
|
2019-08-18 23:42:40 +00:00
|
|
|
<p>The "character conversion" selector allows you to choose how the
|
|
|
|
bytes are converted to characters for the Text column. Choose from
|
|
|
|
the usual set of encodings.</p>
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<p>If <samp>ASCII-only dump</samp> is not checked, non-printable bytes
|
|
|
|
are shown in the ASCII dump as a middle dot ('·'). If the option is
|
|
|
|
checked, non-printable bytes are represented by a period ('.') instead.
|
|
|
|
The use of non-ASCII characters makes the dump unambiguous when unprintable
|
2018-09-28 17:05:11 +00:00
|
|
|
characters are mixed with periods, but the lines may be unsuitable for
|
2019-08-18 23:42:40 +00:00
|
|
|
pasting in some forums.</p>
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<p>If <samp>always on top</samp> is checked, the window will stay above
|
|
|
|
all other windows that don't also declare that they should always be on
|
|
|
|
top. By default this box is checked when displaying project data, and
|
|
|
|
not checked for external files.</p>
|
2018-09-28 17:05:11 +00:00
|
|
|
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="file-concat">File Concatenator</h2>
|
2019-12-29 01:14:29 +00:00
|
|
|
|
|
|
|
<p>The File Concatenator combines multiple files into a single file.
|
|
|
|
Select the files to add, arrange them in the proper order, then hit
|
2021-10-19 00:56:08 +00:00
|
|
|
<samp>Save</samp>. CRC-32 values are shown for reference.</p>
|
2019-12-29 01:14:29 +00:00
|
|
|
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="file-slicer">File Slicer</h2>
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2019-12-30 01:59:35 +00:00
|
|
|
<p>The File Slicer allows you to "slice" a piece out of a file, saving
|
|
|
|
it to a new file. Specify the start and length in decimal or hex. If
|
|
|
|
you leave a field blank, they will default to offset 0 and the remaining
|
|
|
|
length of the file, respectively.</p>
|
|
|
|
<p>The hex dumps show the area just before and after the chunk to be
|
2021-10-19 00:56:08 +00:00
|
|
|
sliced, allowing you to confirm the positions.</p>
|
2019-10-21 22:15:09 +00:00
|
|
|
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<h2 id="omf-converter">OMF Converter</h2>
|
2020-07-04 00:37:04 +00:00
|
|
|
|
2020-07-04 22:03:23 +00:00
|
|
|
<p>This tool allows you to view Apple IIgs Object Module Format (OMF)
|
|
|
|
executables, and convert them for disassembly.</p>
|
|
|
|
|
|
|
|
<p>OMF executables have multiple segments with relocatable code. References
|
|
|
|
to addresses aren't filled in until the program is loaded into memory,
|
|
|
|
which makes it difficult to disassemble the file. The conversion tool
|
|
|
|
loads the OMF file in roughly the same way the GS/OS System Loader would,
|
|
|
|
placing each segment at the start of a bank unless otherwise directed.
|
|
|
|
The loaded image is saved to a new file, and a SourceGen project file is
|
|
|
|
created with some basic attributes filled in.</p>
|
|
|
|
|
|
|
|
<p>Only "Load" files (S16, PIF, TOL, etc) may be converted. Compiler object
|
2021-10-19 00:56:08 +00:00
|
|
|
files and libraries (OBJ, LIB) contain references that must be resolved by
|
2021-06-15 15:57:00 +00:00
|
|
|
a IIgs linker, and are not supported.</p>
|
2020-07-04 00:37:04 +00:00
|
|
|
|
2021-06-15 15:57:00 +00:00
|
|
|
<p>Before you can examine or convert a file, you must first extract
|
|
|
|
it from the Apple II disk image, using a mode that does not modify the
|
|
|
|
original (e.g. extract with "configure to preserve Apple II formats"
|
2021-10-19 00:56:08 +00:00
|
|
|
in CiderPress). Then, open it with <samp>Tools > Convert OMF</samp>.</p>
|
2021-06-15 15:57:00 +00:00
|
|
|
|
|
|
|
<p>The initial view shows all of the OMF segments in the file. Double-clicking
|
|
|
|
on an entry opens a detailed view that shows the segment header and a
|
|
|
|
list of all the OMF records. For load files, the relocation dictionary is
|
|
|
|
also shown.</p>
|
|
|
|
|
2021-10-19 00:56:08 +00:00
|
|
|
<p>To convert the file, click <samp>Generate</samp> to create a
|
|
|
|
modified binary and a SourceGen project file.</p>
|
|
|
|
|
|
|
|
<p>If <samp>offset segment start by $0100</samp> is checked, the
|
|
|
|
converter will try to shift the segment's load address from
|
|
|
|
<code>$xx/0000</code> to <code>$xx/0100</code>. This can make the
|
|
|
|
generated code a little nicer to work with because it removes potential
|
|
|
|
ambiguity with direct page addresses. For example, <code>LDA $56</code>
|
|
|
|
and <code>LDA $0056</code> may be interpreted as the same thing by the
|
|
|
|
assembler, requiring generation of operand width disambiguators. By
|
|
|
|
shifting the initial address we avoid the potential ambiguity.</p>
|
|
|
|
<p>Check <samp>add comments and notes for each segment</samp> to add a
|
|
|
|
long comment and a note at the start of each segment. The comments
|
|
|
|
include the segment name, type, and optional flags. The notes just
|
|
|
|
provide a quick way to jump to a segment.</p>
|
2020-07-20 20:47:19 +00:00
|
|
|
|
2020-07-04 22:03:23 +00:00
|
|
|
<p>The binary generated by the tool is not in OMF format and will not
|
2021-06-15 15:57:00 +00:00
|
|
|
execute on an Apple IIgs. To be functional, the generated sources must be
|
2020-07-04 22:03:23 +00:00
|
|
|
assembled by a program capable of generating OMF output, such as Merlin.</p>
|
|
|
|
|
2020-07-10 20:29:36 +00:00
|
|
|
<p>The <a href="advanced.html#reloc-data">relocation dictionaries</a> from
|
|
|
|
the executable are included in the project file, and can be used to guide
|
2021-10-19 00:56:08 +00:00
|
|
|
the disassembler's analysis. The <samp>use reloc data</samp> setting in
|
|
|
|
the project properties controls this feature.</p>
|
2020-07-04 22:03:23 +00:00
|
|
|
|
|
|
|
<p>A full explanation of the structure of OMF is beyond the scope of this
|
|
|
|
manual. For more information on OMF, see Appendix F of the GS/OS Reference
|
|
|
|
Manual.</p>
|
2020-07-04 00:37:04 +00:00
|
|
|
|
2018-09-28 17:05:11 +00:00
|
|
|
</div>
|
|
|
|
|
2018-10-09 17:04:10 +00:00
|
|
|
<div id="footer">
|
2018-09-28 17:05:11 +00:00
|
|
|
<p><a href="index.html">Back to index</a></p>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
<!-- Copyright 2018 faddenSoft -->
|
|
|
|
</html>
|