Re: [cc65] linker cfg files

Date view Thread view Subject view

From: Greg King (
Date: 2003-04-24 13:37:46

From: sandree
Date: Monday, April 21, 2003, 05:47 AM
> I could place that bitmap from $e000-ff40, but what can I do,
> if I need to place it somewhere, in future, at $2000?

You will need to use a configure-script that contains this code:

ZP: start = $02, size = $1A, define = yes;
  RAMLO: start = $07ff, size = $1801;
    BMP: start = $2000, size = $1f40;
    RAM: start = $3f40, size = $40C0, define = yes;
  ZEROPAGE: load = ZP,    type = zp;
   STARTUP: load = RAMLO, type = ro;
   LOWCODE: load = RAMLO, type = ro;
      CODE: load = RAMLO, type = ro;
    RODATA: load = RAMLO, type = ro;
      DATA: load = RAMLO, type = rw;
    BITMAP: load = BMP,   type = rw;
       BSS: load = RAM,   type = bss, define = yes;

Then, you must give those 8000 bytes a name that your program can use to
point to them.  You don't need to use assembly-code, these three lines of
"cc65-language" code will give you what you need.

#pragma bssseg("BITMAP")
unsigned char bitmap[8000];
#pragma bssseg("BSS")

That configure-script will give you a small program-file -- no wasted
space.  But, it gives you only 6143 bytes for your program.  If you wanted
to write a fancy program that needed more space, then you would need to
move some of those segments from RAMLO to RAM.  Tell ld65 to create a
map-file, find out which RAMLO segment is the smallest one, then move it.
If that isn't enough, then try moving the next smallest one -- until you
can fit your program around that bitmap-hole.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-04-24 14:02:10 CEST