41static void linker_setup_variables_memory(
Environment * _environment,
Variable * _variable ) {
48 switch( variable->
type ) {
58 variable = variable->
next;
64static void linker_setup_variables_segment(
Environment * _environment,
Variable * _variable ) {
71 switch( variable->
type ) {
81 variable = variable->
next;
101 cfgline0(
"STARTADDRESS: default = $1c01;");
104 cfgline0(
"ZP: file = \"\", start = $0002, size = $00FE, define = yes;");
108 int maxAddress = 0xFBFF - 4096;
110 int realMaxAddress = 0x800 + actual->
start + ( actual->
end - actual->
start );
111 if ( actual->
type !=
MAT_RAM && realMaxAddress > maxAddress ) {
112 maxAddress = realMaxAddress;
114 actual = actual->
next;
117 cfgline1(
"MAIN: file = %%O, start = %%S-2, size = $%4.4x - %%S;", (
unsigned short)maxAddress);
122 cfgline3(
"RAM%3.3x: file = \"\", start = $%4.4x, size = $%4.4x;", actual->
id, (
unsigned short)actual->
start, (
unsigned short)(actual->
end - actual->
start) );
124 actual = actual->
next;
127 linker_setup_variables_memory( _environment, _environment->
variables );
129 linker_setup_variables_memory( _environment, _environment->
tempVariables[j] );
134 cfgline0(
"ZEROPAGE: load = ZP, type = zp, optional = yes;");
138 cfgline0(
"BASIC: load = MAIN, type = ro, optional = no;");
140 cfgline0(
"RODATA: load = MAIN, type = ro, optional = yes;");
141 cfgline0(
"DATA: load = MAIN, type = rw, optional = yes;");
142 cfgline0(
"BSS: load = MAIN, type = bss, optional = yes, define = yes;");
143 cfgline0(
"UDCCHAR: load = MAIN, type = overwrite, optional = yes, start = $9800;");
148 cfgline3(
"MA%3.3x: load = RAM%3.3x, type = overwrite, optional = yes, start = $%4.4x;", actual->
id, actual->
id, actual->
start);
150 cfgline2(
"MA%3.3x: load = MAIN, type = overwrite, optional = yes, start = $%4.4x;", actual->
id, actual->
start);
152 actual = actual->
next;
155 linker_setup_variables_segment( _environment, _environment->
variables );
157 linker_setup_variables_segment( _environment, _environment->
tempVariables[j] );
void linker_setup(Environment *_environment)
Emit tail of linker's configuration file lines.
void linker_cleanup(Environment *_environment)
Emit tail of linker's configuration file lines.
Variable * tempVariables[MAX_PROCEDURES]
struct _MemoryArea * next
#define CRITICAL_INVALID_PROGRAM_START(a)
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
struct _MemoryArea MemoryArea
#define cfgline2(s, a, b)
#define cfgline3(s, a, b, c)