1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-10-31 19:04:44 +00:00
6502bench/SourceGen/SGTestData/Expected/20040-address-changes_cc65.cfg
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

40 lines
1.3 KiB
INI

# 6502bench SourceGen generated linker script for 20040-address-changes
MEMORY {
MAIN: file=%O, start=%S, size=65536;
# MEM000: file=%O, start=$1000, size=2;
# MEM001: file=%O, start=$1000, size=9;
# MEM002: file=%O, start=$1100, size=12;
# MEM003: file=%O, start=$1100, size=12;
# MEM004: file=%O, start=$1100, size=12;
# MEM005: file=%O, start=$2000, size=7;
# MEM006: file=%O, start=$2020, size=8;
# MEM007: file=%O, start=$2080, size=32;
# MEM008: file=%O, start=$2100, size=5;
# MEM009: file=%O, start=$2800, size=16;
# MEM010: file=%O, start=$2820, size=18;
# MEM011: file=%O, start=$3000, size=14;
# MEM012: file=%O, start=$3100, size=23;
# MEM013: file=%O, start=$3180, size=19;
# MEM014: file=%O, start=$3200, size=5;
}
SEGMENTS {
CODE: load=MAIN, type=rw;
# SEG000: load=MEM000, type=rw;
# SEG001: load=MEM001, type=rw;
# SEG002: load=MEM002, type=rw;
# SEG003: load=MEM003, type=rw;
# SEG004: load=MEM004, type=rw;
# SEG005: load=MEM005, type=rw;
# SEG006: load=MEM006, type=rw;
# SEG007: load=MEM007, type=rw;
# SEG008: load=MEM008, type=rw;
# SEG009: load=MEM009, type=rw;
# SEG010: load=MEM010, type=rw;
# SEG011: load=MEM011, type=rw;
# SEG012: load=MEM012, type=rw;
# SEG013: load=MEM013, type=rw;
# SEG014: load=MEM014, type=rw;
}
FEATURES {}
SYMBOLS {}