Re: [cc65] Odd problems creating a new target.

From: Oliver Schmidt <>
Date: 2012-06-21 16:56:54
Hi L.,

> crt0.s: (note that init and exit code is
> commented out. 6502 housekeeping is done by the bootloader and not needed,
> as well).

Why do you think that 'zerobss' and 'initlib' are not needed?

> I have a feeling there's something wrong with my memory map definition in
> the .cfg, but I've piddled it around to no avail.

Your shell script generates a map file called ''. You should
consult it to make sure things are actually going where you'd like them to

- If your program is expected to run from $500 and your MEMORY named RAM
starts at $500 then you have to make sure that the SEGMENT named STARTUP is
the first one listed with "load = RAM". Otherwise your crt0.s code isn't
guaranteed to end up at $500.

- A SEGMENT named "HEAP" is an obsolete concept. You should remove it.

- The SEGMENT named BSS has "type = bss". This means that it won't be
represented by bytes in the output file. So placing a SEGMENT of "type =
bss" between other SEGMENTS with the same "load =" (thus placed in the same
MEMEORY) that _are_ represented in the outputfile (those with "type = rw"
or "type = ro") is usually a bad-idea(tm) as you'd have to split the
outputfile in RAM in order to re-create the gap of the bytes missing in the

I'd consider the following "SEGMENTS" section more promising:

 ZEROPAGE: load = ZP,  type = zp,  define  = yes;
 STARTUP: load = RAM, type = ro;
 INIT:  load = RAM, type = ro,  optional = yes;
 CODE:  load = RAM, type = ro;
 RODATA:  load = RAM, type = ro;
 DATA: load = RAM, type = rw, define = yes;
 BSS: load = RAM, type = bss, define = yes;


To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jun 21 16:57:04 2012

This archive was generated by hypermail 2.1.8 : 2012-06-21 16:57:07 CEST