Re: [cc65] Maximum application size

From: Andreas Koch <email1kochandreas.com>
Date: 2007-11-20 21:18:05
Hi,

>> 3) is it possible to split code into non-continous memory regions
>> (without doing it "by hand" in assembly)
> 
> Yes - you can define multiple code segments in the linker.cfg file.
> For example I did something like this once:

Ah, thanks, this (and all other suggestions i recieved) is interesting. 
  I'll try playing with it.

P.S. The Help (ld65-4.html) lists a c64 default cfg of:
-----------------------
      MEMORY {
             ZP: start = $02, size = $1A, type = rw;
             RAM: start = $7FF, size = $c801, define = yes, file = %O;
         }
         SEGMENTS {
             CODE: load = RAM, type = wprot;
             RODATA: load = RAM, type = wprot;
             DATA: load = RAM, type = rw;
             BSS: load = RAM, type = bss, define = yes;
             ZEROPAGE: load = ZP, type = zp;
         }
         FEATURES {
             CONDES: segment = RODATA,
                     type = constructor,
                     label = __CONSTRUCTOR_TABLE__,
                     count = __CONSTRUCTOR_COUNT__;
             CONDES: segment = RODATA,
                     type = destructor,
                     label = __DESTRUCTOR_TABLE__,
                     count = __DESTRUCTOR_COUNT__;
         }
         SYMBOLS {
             __STACKSIZE__ = $800;       # 2K stack
         }
-----------------------
ld65 won't accept this:

ld65.exe: Error: linker.cfg(6): Type expected

I extracted following working definition from ld65.exe using an hex editor:
-----------------------
  MEMORY {
ZP:  start = $0002, size = $001A, type = rw, define = yes;
RAM: start = $07FF, size = $C801, file = %O, define = yes;
}
SEGMENTS {
STARTUP:  load = RAM, type = ro;
LOWCODE:  load = RAM, type = ro,               optional = yes;
INIT:     load = RAM, type = ro, define = yes, optional = yes;
CODE:     load = RAM, type = ro;
RODATA:   load = RAM, type = ro;
DATA:     load = RAM, type = rw;
BSS:      load = RAM, type = bss, define = yes;
HEAP:     load = RAM, type = bss, optional = yes;
ZEROPAGE: load = ZP,  type = zp;
}
FEATURES {
CONDES: segment = INIT,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = RODATA,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
CONDES: segment = RODATA,
type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $800;
}
-----------------------
Seems the helpfile is a bit outdated...


Andreas
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Nov 20 21:17:11 2007

This archive was generated by hypermail 2.1.8 : 2007-11-20 21:17:14 CET