1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-11 13:50:13 +00:00
6502bench/SourceGen/RuntimeData/Help/index.html
Andy McFadden 99cd0d3ac1 Improve handling of C64 PRG header
C64 PRG files are pretty common.  Their salient feature is that they
start with a 16-bit value that is used as the load address.  The
value is commonly generated by the assembler itself, rather than
explicitly added to the source file.

Not all assemblers know what a PRG file is, and some of them handle
it in ways that are difficult to guarantee in SourceGen.  ACME adds
the 16-bit header when the output file name ends in ".prg", cc65
uses a modified config file, 64tass uses a different command-line
option, and Merlin 32 has no idea what they are.

This change adds PRG file detection and handling to the 64tass code
generator.  Doing so required making a few changes to the gen/asm
interfaces, because we now need to have the generator pass additional
flags to the assembler, and sometimes we need code generation to
start somewhere other than offset zero.  Overall the changes were
pretty minor.

The 20042-address-changes test needed a 6502-only variant.  A new test
(20040-address-changes) has been added and given a PRG header.  As
part of this change the 65816 variant was changed to use addresses
in bank 2, which uncovered a code generation bug that this change
also fixes.

The 64tass --long-address flag doesn't appear to be necessary for
files <= 65536 bytes long, so we no longer emit it for those.

(issue #90)
2020-10-17 16:45:13 -07:00

202 lines
9.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="main.css" rel="stylesheet" type="text/css" />
<title>Contents - 6502bench SourceGen</title>
</head>
<body>
<div id="content">
<h1>6502bench SourceGen</h1>
<p>SourceGen is an interactive disassembler for 6502, 65C02,
and 65816 code. The official web site is
<a href="https://6502bench.com/">https://6502bench.com/</a>.</p>
<p>If you want to dive right in, try the
<a href="tutorials.html">tutorials</a>.</p>
<h2>Contents</h2>
<ul>
<li><a href="intro.html">Overview</a>
<ul>
<li><a href="intro.html#fundamental-concepts">Fundamental Concepts</a></li>
<li><a href="intro.html#begin">About 6502 Code</a>
<ul>
<li><a href="intro.html#charenc">Character Encoding</a></li>
</ul></li>
<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#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>
<ul>
<li><a href="intro.html#connecting-operands">Connecting Operands With Labels</a></li>
<li><a href="intro.html#internal-address-symbols">Internal Address Symbols</a></li>
<li><a href="intro.html#external-address-symbols">External Address Symbols</a></li>
<li><a href="intro.html#unique-local-global">Unique vs. Non-Unique and Local vs. Global</a></li>
<li><a href="intro.html#weak-refs">Weak References</a></li>
<li><a href="intro.html#symbol-parts">Parts and Adjustments</a></li>
<li><a href="intro.html#nearby-targets">Automatic Use of Nearby Targets</a></li>
</ul></li>
<li><a href="intro.html#width-disambiguation">Width Disambiguation</a></li>
<li><a href="intro.html#pseudo-ops">Data and Directive Pseudo-Opcodes</a></li>
</ul></li>
<li><a href="mainwin.html">Using SourceGen</a>
<ul>
<li><a href="mainwin.html#starting-new">Starting a New Project</a></li>
<li><a href="mainwin.html#opening">Opening an Existing Project</a></li>
<li><a href="mainwin.html#working">Working With a Project</a>
<ul>
<li><a href="mainwin.html#code-list">Code List</a></li>
<li><a href="mainwin.html#undo">Undo &amp; Redo</a></li>
<li><a href="mainwin.html#references">References Window</a></li>
<li><a href="mainwin.html#notes">Notes Window</a></li>
<li><a href="mainwin.html#symbols">Symbols Window</a></li>
<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#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>
<li><a href="mainwin.html#toggle-data">Toggle Data Scan</a></li>
<li><a href="mainwin.html#clipboard">Copying to Clipboard</a></li>
</ul></li>
</ul></li>
<li><a href="editors.html">Editors</a>
<ul>
<li><a href="editors.html#address">Edit Address</a></li>
<li><a href="editors.html#flags">Edit Status Flags</a></li>
<li><a href="editors.html#label">Edit Label</a></li>
<li><a href="editors.html#instruction-operand">Edit Instruction Operand</a>
<ul>
<li><a href="editors.html#explicit-format">Explicit Formats</a></li>
<li><a href="editors.html#shortcut-nar">Numeric Address References</a></li>
<li><a href="editors.html#shortcut-local-var">Local Variable References</a></li>
</ul></li>
<li><a href="editors.html#data-operand">Edit Data Operand</a></li>
<li><a href="editors.html#comment">Edit Comment</a></li>
<li><a href="editors.html#long-comment">Edit Long Comment</a></li>
<li><a href="editors.html#data-bank">Edit Data Bank (65816 only)</a></li>
<li><a href="editors.html#note">Edit Note</a></li>
<li><a href="editors.html#project-symbol">Edit Project Symbol</a></li>
<li><a href="editors.html#lvtable">Edit Local Variable Table</a></li>
</ul></li>
<li><a href="visualization.html">Visualizations</a>
<ul>
<li><a href="visualization.html#overview">Overview</a></li>
<li><a href="visualization.html#vis-and-sets">Visualizations and Visualization Sets</a></li>
<li><a href="visualization.html#runtime">Scripts Included with SourceGen</a></li>
</ul></li>
<li><a href="codegen.html">Code Generation &amp; Assembly</a>
<ul>
<li><a href="codegen.html#supported">Supported Assemblers</a>
<ul>
<li><a href="codegen.html#version">Version-Specific Code Generation</a></li>
</ul></li>
<li><a href="codegen.html#generate">Generating Source Code</a>
<ul>
<li><a href="codegen.html#localizer">Label Localizer</a></li>
<li><a href="codegen.html#reserved-labels">Reserved Label Names</a></li>
<li><a href="codegen.html#platform-features">Platform-Specific Features</a></li>
</ul></li>
<li><a href="codegen.html#assemble">Cross-Assembling Generated Code</a></li>
<li><a href="codegen.html#quirks">Assembler-Specific Bugs &amp; Quirks</a>
<ul>
<li><a href="codegen.html#64tass">64tass</a></li>
<li><a href="codegen.html#acme">ACME</a></li>
<li><a href="codegen.html#cc65">cc65</a></li>
<li><a href="codegen.html#merlin32">Merlin 32</a></li>
</ul></li>
<li><a href="codegen.html#export-source">Exporting Source Code</a>
</ul></li>
<li><a href="settings.html">Properties &amp; Settings</a>
<ul>
<li><a href="settings.html#app-settings">Application Settings</a>
<ul>
<li><a href="settings.html#appset-codeview">Code View</a></li>
<li><a href="settings.html#appset-textdelim">Text Delimiters</a></li>
<li><a href="settings.html#appset-asmconfig">Asm Config</a></li>
<li><a href="settings.html#appset-displayformat">Display Format</a></li>
<li><a href="settings.html#appset-pseudoop">Pseudo-Op</a></li>
</ul></li>
<li><a href="settings.html#project-properties">Project Properties</a>
<ul>
<li><a href="settings.html#projprop-general">General</a></li>
<li><a href="settings.html#projprop-projsym">Project Symbols</a></li>
<li><a href="settings.html#projprop-symfiles">Symbol Files</a></li>
<li><a href="settings.html#projprop-extscripts">Extension Scripts</a></li>
</ul></li>
</ul></li>
<li><a href="tools.html">Tools</a>
<ul>
<li><a href="tools.html#instruction-chart">Instruction Chart</a></li>
<li><a href="tools.html#ascii-chart">ASCII Chart</a></li>
<li><a href="tools.html#apple2-screen-chart">Apple II Screen Chart</a></li>
<li><a href="tools.html#hexdump">Hex Dump Viewer</a></li>
<li><a href="tools.html#file-concat">File Concatenator</a></li>
<li><a href="tools.html#file-slicer">File Slicer</a></li>
<li><a href="tools.html#omf-converter">OMF Converter</a></li>
</ul></li>
<li><a href="advanced.html">Advanced Topics</a>
<ul>
<li><a href="advanced.html#platform-symbols">Platform Symbol Files (.sym65)</a></li>
<li><a href="advanced.html#extension-scripts">Extension Scripts</a></li>
<li><a href="advanced.html#multi-bin">Working With Multiple Binaries</a></li>
<li><a href="advanced.html#overlap">Overlapping Address Spaces</a></li>
<li><a href="advanced.html#reloc-data">OMF Relocation Dictionaries</a></li>
<li><a href="advanced.html#debug">Debug Menu Options</a></li>
</ul></li>
<li><a href="analysis.html">Appendix: Instruction and Data Analysis</a>
<ul>
<li><a href="analysis.html#analysis-process">Analysis Process</a>
<ul>
<li><a href="analysis.html#auto-format">Automatic Formatting</a></li>
<li><a href="analysis.html#undo-redo">Interaction With Undo/Redo</a></li>
</ul></li>
<li><a href="analysis.html#code-analysis">Code Analysis</a>
<ul>
<li><a href="analysis.html#extension-scripts">Extension Scripts</a></li>
</ul></li>
<li><a href="analysis.html#data-analysis">Data Analysis</a></li>
</ul></li>
<li><a href="end-notes.html">End Notes</a> </li>
<br/>
<li><a href="tutorials.html">Tutorials</a>
<ul>
<li><a href="tutorials.html#basic-features">Tutorial #1: Basic Features</a></li>
<li><a href="tutorials.html#advanced-features">Tutorial #2: Advanced Features</a></li>
<li><a href="tutorials.html#address-tables">Tutorial #3: Address Table Formatting</a></li>
<li><a href="tutorials.html#extension-scripts">Tutorial #4: Extension Scripts</a></li>
<li><a href="tutorials.html#visualizations">Tutorial #5: Visualizations</a></li>
</ul></li>
</ul>
</div>
<div id="footer">
<hr/>
<p>Copyright 2020 faddenSoft</p>
</div>
</body>
</html>