Re: [cc65] Secondary linker configurations

From: Karri Kaksonen <karri1sipo.fi>
Date: 2009-09-21 16:14:42
Nice idea.

The ram-only cfg file is easy. You can use the whole memory for you code.

The cart-based code is more difficult as I want to set the RAM segment 
starting from the top of memory and growing downwards. Is there a way to 
do this?

Some kind of formula like:

RAM: start = $B640 - RAM_SIZE

on the other hand I need to add the stack size to RAM which means

RAM: size = $B640 - RAM_START + $800

--
Karri

PS. I include the config file lynx-ramonly.cfg for the most simple Hello 
World case.


MEMORY {
    ZP: start = 205, size = 51, type = rw, define = yes;
    MACHINE_STACK: start = $100, size = $100, type = rw, define = no;
    EXEHEADER: start = $0000, size = $8000, file=%O;
    RAM: start = $400, size = $ba40, define = yes, file = %O;
    SCREEN: start = $BE40, size = $3FC0;
}
SEGMENTS {
    STARTUP: load = RAM, type = ro, optional = yes;
    INIT: load = RAM, type = ro, optional = yes;
    LOWCODE: load = RAM, type = ro, optional = yes;
    CODE: load = RAM, type = ro, define = yes;
    RODATA: load = RAM, type = ro, define = yes;
    DATA: load = RAM, type = rw, define = yes;
    BSS: load = RAM, type = bss, define = yes;
    ZEROPAGE: load = ZP, type = zp;
    EXTZP: load = ZP, type = zp;
    EXEHDR: load = EXEHEADER, type = ro;
}
FEATURES {
    CONDES: segment = RODATA,
	    type = constructor,
	    label = __CONSTRUCTOR_TABLE__,
	    count = __CONSTRUCTOR_COUNT__;
    CONDES: segment = RODATA,
	    type = destructor,
	    label = __DESTRUCTOR_TABLE__,
	    count = __DESTRUCTOR_COUNT__;
    CONDES: segment = DATA,
	    type = interruptor,
	    label = __INTERRUPTOR_TABLE__,
	    count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
    __STACKSIZE__ = $800;       # 2K stack
}
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Sep 21 16:14:59 2009

This archive was generated by hypermail 2.1.8 : 2009-09-21 16:15:01 CEST