1 /*****************************************************************************/
5 /* Target machine configurations the ld65 linker */
9 /* (C) 1998-2000 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
41 /*****************************************************************************/
42 /* Target configurations */
43 /*****************************************************************************/
47 static const char CfgNone [] =
49 "RAM: start = %S, size = $10000, file = %O;"
52 "CODE: load = RAM, type = rw;"
53 "RODATA: load = RAM, type = rw;"
54 "DATA: load = RAM, type = rw;"
55 "BSS: load = RAM, type = bss, define = yes;"
58 static const char CfgAtari [] =
60 "ZP: start = $D2, size = $1C, type = rw;"
61 "HEADER: start = $0000, size = $6, file = %O;"
62 "RAM: start = $1F00, size = $9D1F, file = %O;" /* 9D1F: matches upper bound BC1F */
65 "EXEHDR: load = HEADER, type = wprot;"
66 "CODE: load = RAM, type = wprot, define = yes;"
67 "RODATA: load = RAM, type = wprot;"
68 "DATA: load = RAM, type = rw;"
69 "BSS: load = RAM, type = bss, define = yes;"
70 "ZEROPAGE: load = ZP, type = zp;"
71 "AUTOSTRT: load = RAM, type = wprot;"
74 static const char CfgC64 [] =
76 "ZP: start = $02, size = $1A, type = rw;"
77 "RAM: start = $7FF, size = $c801, file = %O;"
80 "CODE: load = RAM, type = wprot;"
81 "RODATA: load = RAM, type = wprot;"
82 "DATA: load = RAM, type = rw;"
83 "BSS: load = RAM, type = bss, define = yes;"
84 "ZEROPAGE: load = ZP, type = zp;"
87 static const char CfgC128 [] =
89 "ZP: start = $02, size = $1A, type = rw;"
90 "RAM: start = $1bff, size = $a401, file = %O;"
93 "CODE: load = RAM, type = wprot;"
94 "RODATA: load = RAM, type = wprot;"
95 "DATA: load = RAM, type = rw;"
96 "BSS: load = RAM, type = bss, define = yes;"
97 "ZEROPAGE: load = ZP, type = zp;"
100 static const char CfgAce [] =
103 static const char CfgPlus4 [] =
105 "ZP: start = $02, size = $1A, type = rw;"
106 "RAM: start = $0fff, size = $7001, file = %O;"
109 "CODE: load = RAM, type = wprot;"
110 "RODATA: load = RAM, type = wprot;"
111 "DATA: load = RAM, type = rw;"
112 "BSS: load = RAM, type = bss, define = yes;"
113 "ZEROPAGE: load = ZP, type = zp;"
116 static const char CfgCBM610 [] =
118 "ZP: start = $02, size = $1A, type = rw;"
119 "RAM: start = $0001, size = $FFF0, file = %O;"
122 "CODE: load = RAM, type = wprot;"
123 "RODATA: load = RAM, type = wprot;"
124 "DATA: load = RAM, type = rw;"
125 "BSS: load = RAM, type = bss, define = yes;"
126 "ZEROPAGE: load = ZP, type = zp;"
129 static const char CfgPET [] =
131 "ZP: start = $02, size = $1A, type = rw;"
132 "RAM: start = $03FF, size = $7BFF, file = %O;"
135 "CODE: load = RAM, type = wprot;"
136 "RODATA: load = RAM, type = wprot;"
137 "DATA: load = RAM, type = rw;"
138 "BSS: load = RAM, type = bss, define = yes;"
139 "ZEROPAGE: load = ZP, type = zp;"
142 static const char CfgNES [] =
144 "RAM: start = $0200, size = $0600, file = \"\";"
145 "ROM: start = $8000, size = $8000, file = %O;"
148 "CODE: load = ROM, type = ro;"
149 "RODATA: load = ROM, type = ro;"
150 "DATA: load = ROM, run = RAM, type = rw, define = yes;"
151 "BSS: load = RAM, type = bss, define = yes;"
152 "VECTORS: load = ROM, type = ro, start = $FFFA;"
155 static const char CfgLunix [] =
157 "COMBINED: start = $0000, size = $FFFF, file = %O;"
158 "ZEROPAGE: start = $0000, size = $0100, file = %O;"
161 "CODE: load = COMBINED, type = wprot;"
162 "RODATA: load = COMBINED, type = wprot;"
163 "DATA: load = COMBINED, type = rw, define = yes;"
164 "BSS: load = COMBINED, type = bss, define = yes;"
165 "ZEROPAGE: load = ZEROPAGE, type = zp;"
171 "o65: os = lunix, type = small,"
172 "extsym = \"LUNIXKERNAL\", extsym = \"LIB6502\";"
175 static const char CfgOSA65 [] =
177 "COMBINED: start = $0000, size = $FFFF, file = %O;"
178 "ZEROPAGE: start = $0000, size = $0100, file = %O;"
181 "CODE: load = COMBINED, type = wprot;"
182 "RODATA: load = COMBINED, type = wprot;"
183 "DATA: load = COMBINED, type = rw, define = yes;"
184 "BSS: load = COMBINED, type = bss, define = yes;"
185 "ZEROPAGE: load = ZEROPAGE, type = zp;"
191 "o65: os = osa65, type = small,"
192 "extsym = \"OSA2KERNAL\", extsym = \"LIB6502\";"
195 static const char CfgApple2 [] =
197 "ZP: start = $00, size = $1A, type = rw;"
198 "RAM: start = $800, size = $8E00, file = %O;"
201 "CODE: load = RAM, type = ro;"
202 "RODATA: load = RAM, type = ro;"
203 "DATA: load = RAM, type = rw;"
204 "BSS: load = RAM, type = bss, define = yes;"
205 "ZEROPAGE: load = ZP, type = zp;"
208 static const char CfgGeos [] =
210 "HEADER: start = $204, size = 508, file = %O;"
211 "RAM: start = $400, size = $7C00, file = %O;"
214 "HEADER: load = HEADER, type = ro;"
215 "CODE: load = RAM, type = ro;"
216 "RODATA: load = RAM, type = ro;"
217 "DATA: load = RAM, type = rw;"
218 "BSS: load = RAM, type = bss, define = yes;"
223 /*****************************************************************************/
225 /*****************************************************************************/
229 /* Target configurations for all systems */
230 const TargetDesc Targets [TGT_COUNT] = {
231 { BINFMT_BINARY, CfgNone },
232 { BINFMT_BINARY, CfgAtari },
233 { BINFMT_BINARY, CfgC64 },
234 { BINFMT_BINARY, CfgC128 },
235 { BINFMT_BINARY, CfgAce },
236 { BINFMT_BINARY, CfgPlus4 },
237 { BINFMT_BINARY, CfgCBM610 },
238 { BINFMT_BINARY, CfgPET },
239 { BINFMT_BINARY, CfgNES },
241 { BINFMT_O65, CfgLunix },
242 { BINFMT_O65, CfgOSA65 },
244 { BINFMT_BINARY, CfgApple2 },
245 { BINFMT_BINARY, CfgGeos },