1 # Sample linker configuration for C programs using the Atari binary file support.
2 # Use with: cl65 -tatarixl -Catarixl-c-xex.cfg prog.c -o prog.xex
4 STARTADDRESS: default = $2400;
7 __SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk
8 __STACKSIZE__: type = weak, value = $0800; # 2k stack
9 __STARTADDRESS__: type = export, value = %S;
10 __SYSCHKHDR__: type = export, value = 0; # Disable system check header
11 __SYSCHKTRL__: type = export, value = 0; # Disable system check trailer
14 ZP: file = "", define = yes, start = $0082, size = $007E;
16 # "system check" load chunk
17 SYSCHKCHNK: file = %O, start = $2E00, size = $0300;
19 # "shadow RAM preparation" load chunk
20 SRPREPCHNK: file = %O, define = yes, start = %S, size = $7C20 - %S - $07FF; # $07FF: space for temp. chargen buffer, 1K aligned
22 # "main program" load chunk
23 MAIN: file = %O, define = yes, start = %S + __LOWBSS_SIZE__, size = $D000 - __STACKSIZE__ - %S - __LOWBSS_SIZE__;
25 # memory beneath the ROM preceeding the character generator
26 HIDDEN_RAM2: file = "", define = yes, start = $D800, size = $0800;
28 # address of relocated character generator (same addess as ROM version)
29 CHARGEN: file = "", define = yes, start = $E000, size = $0400;
31 # memory beneath the ROM
32 HIDDEN_RAM: file = "", define = yes, start = $E400, size = $FFFA - $E400;
35 UNUSED: file = "", start = $0, size = $10;
42 initad = SYSCHKCHNK: __SYSTEM_CHECK__,
43 initad = SRPREPCHNK: sramprep;
46 ZEROPAGE: load = ZP, type = zp;
47 EXTZP: load = ZP, type = zp, optional = yes;
49 SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
50 LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
51 SRPREP: load = SRPREPCHNK, type = rw, define = yes;
52 SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
53 SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM2, type = rw, define = yes, optional = yes;
54 STARTUP: load = MAIN, type = ro, define = yes;
55 LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
56 ONCE: load = MAIN, type = ro, optional = yes;
57 CODE: load = MAIN, type = ro, define = yes;
58 RODATA: load = MAIN, type = ro;
59 DATA: load = MAIN, type = rw;
60 INIT: load = MAIN, type = rw, optional = yes;
61 BSS: load = MAIN, type = bss, define = yes;
62 SRPREPHDR: load = UNUSED, type = ro;
63 SRPREPTRL: load = UNUSED, type = ro;
66 CONDES: type = constructor,
67 label = __CONSTRUCTOR_TABLE__,
68 count = __CONSTRUCTOR_COUNT__,
70 CONDES: type = destructor,
71 label = __DESTRUCTOR_TABLE__,
72 count = __DESTRUCTOR_COUNT__,
74 CONDES: type = interruptor,
75 label = __INTERRUPTOR_TABLE__,
76 count = __INTERRUPTOR_COUNT__,