1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-11 14:05:12 +00:00
6502bench/SourceGen/SGTestData/20040-address-changes.dis65
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

171 lines
2.0 KiB
Plaintext

### 6502bench SourceGen dis65 v1.0 ###
{
"_ContentVersion":4,
"FileDataLength":194,
"FileDataCrc32":452364300,
"ProjectProps":{
"CpuName":"6502",
"IncludeUndocumentedInstr":false,
"TwoByteBrk":false,
"EntryFlags":32702671,
"AutoLabelStyle":"Simple",
"AnalysisParams":{
"AnalyzeUncategorizedData":true,
"DefaultTextScanMode":"LowHighAscii",
"MinCharsForString":4,
"SeekNearbyTargets":true,
"UseRelocData":false,
"SmartPlpHandling":false,
"SmartPlbHandling":true},
"PlatformSymbolFileIdentifiers":[],
"ExtensionScriptFileIdentifiers":[],
"ProjectSyms":{
}},
"AddressMap":[{
"Offset":0,
"Addr":4096},
{
"Offset":2,
"Addr":4096},
{
"Offset":11,
"Addr":4352},
{
"Offset":23,
"Addr":4352},
{
"Offset":35,
"Addr":4352},
{
"Offset":47,
"Addr":8192},
{
"Offset":54,
"Addr":8224},
{
"Offset":62,
"Addr":8320},
{
"Offset":94,
"Addr":8448},
{
"Offset":99,
"Addr":10240},
{
"Offset":115,
"Addr":10272},
{
"Offset":133,
"Addr":12288},
{
"Offset":147,
"Addr":12544},
{
"Offset":170,
"Addr":12672},
{
"Offset":189,
"Addr":12800}],
"TypeHints":[{
"Low":2,
"High":2,
"Hint":"Code"},
{
"Low":23,
"High":23,
"Hint":"Code"},
{
"Low":35,
"High":35,
"Hint":"Code"},
{
"Low":168,
"High":169,
"Hint":"InlineData"},
{
"Low":192,
"High":193,
"Hint":"InlineData"}],
"StatusFlagOverrides":{
},
"Comments":{
"0":"PRG-style header",
"193":"execution continues off end of file"},
"LongComments":{
},
"Notes":{
},
"UserLabels":{
"145":{
"Label":"ulabel",
"Value":12300,
"Source":"User",
"Type":"GlobalAddr",
"LabelAnno":"None"},
"148":{
"Label":"fwd",
"Value":12545,
"Source":"User",
"Type":"GlobalAddr",
"LabelAnno":"None"},
"187":{
"Label":"label1",
"Value":12689,
"Source":"User",
"Type":"GlobalAddr",
"LabelAnno":"None"},
"61":{
"Label":"offend",
"Value":8231,
"Source":"User",
"Type":"GlobalAddr",
"LabelAnno":"None"}},
"OperandFormats":{
"0":{
"Length":2,
"Format":"NumericLE",
"SubFormat":"None",
"SymbolRef":null}},
"LvTables":{
},
"Visualizations":[],
"VisualizationAnimations":[],
"VisualizationSets":{
},
"RelocList":{
},
"DbrValues":{
}}