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;
96 cfgline0(
"STARTADDRESS: default = $0801;");
99 cfgline0(
"ZP: file = \"\", start = $0002, size = $00FE, define = yes;");
103 int maxAddress = 0xA802;
105 int realMaxAddress = 0x800 + actual->
start + ( actual->
end - actual->
start );
106 if ( actual->
type !=
MAT_RAM && realMaxAddress > maxAddress ) {
107 maxAddress = realMaxAddress;
109 actual = actual->
next;
112 cfgline1(
"MAIN: file = %%O, start = %%S-2, size = $%4.4x - %%S;", (
unsigned short)maxAddress);
117 cfgline3(
"RAM%3.3x: file = \"\", start = $%4.4x, size = $%4.4x;", actual->
id, (
unsigned short)actual->
start, (
unsigned short)(actual->
end - actual->
start) );
119 actual = actual->
next;
122 linker_setup_variables_memory( _environment, _environment->
variables );
124 linker_setup_variables_memory( _environment, _environment->
tempVariables[j] );
129 cfgline0(
"ZEROPAGE: load = ZP, type = zp, optional = yes;");
133 cfgline0(
"BASIC: load = MAIN, type = ro, optional = no;");
135 cfgline0(
"RODATA: load = MAIN, type = ro, optional = yes;");
136 cfgline0(
"DATA: load = MAIN, type = rw, optional = yes;");
137 cfgline0(
"BSS: load = MAIN, type = bss, optional = yes, define = yes;");
138 cfgline0(
"UDCCHAR: load = MAIN, type = overwrite, optional = yes, start = $9800;");
143 cfgline3(
"MA%3.3x: load = RAM%3.3x, type = overwrite, optional = yes, start = $%4.4x;", actual->
id, actual->
id, actual->
start);
145 cfgline2(
"MA%3.3x: load = MAIN, type = overwrite, optional = yes, start = $%4.4x;", actual->
id, actual->
start);
147 actual = actual->
next;
150 linker_setup_variables_segment( _environment, _environment->
variables );
152 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
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)