[cc65] Multi-purpose memory layout, ca65, ld65

From: Gábor Lénárt <lgb1lgb.hu>
Date: 2011-01-12 12:44:25

Sorry for the stupid subject line, but I can't express it better.  The exact
problem of mine: I have a program (using only ca65, so assembly project) for
Commdore 64 (with basic stub, but it's my own code) which contains large
amount of constant data (it's graphical data which is copied to the
graphical screen, then I don't need that once more, it's
.INCBIN'ed to my program), which is only needed at the beginning of my program. 
I also use initialized (to zero) bytes during the run of my program, using
RES statements in the BSS segment.  My idea is to use my data at the
beginning then filling the area to zero and I can use that part of memory as
my BSS segment.  However I am really not sure how can I tell this to
ca64/ld65.  I can use "load" and "run" statements in the linker config file,
but somehow I could not figure out how I can do that, (or is it possible at
all).  Sure, I can have "ugly" solution like this:

.INCBIN "gfx.bin"
my_first_bss_var = gfxdata
my_second_bss_var = gfxdata +1

But it looks like a bit ugly, also it's quite hard to "position" my BSS vars
(compared to "gfxdata" label), if I have multiple source files, it feels
much more elegant if I can only say my_45th_bss_var: RES somewhere, without
keeping track the "offset" from "gfxdata".

Hopefully I could express what my question is :)

Thanks in advance,

- Gábor
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Jan 12 12:52:21 2011

This archive was generated by hypermail 2.1.8 : 2011-01-12 12:52:24 CET