Re: [cc65] C64: printf() into another VIC bank, memory layout

From: Stefan Wessels <swessels1email.com>
Date: 2013-08-18 18:05:19
Hi,

On 2013-08-18, at 3:41 AM, Maik Merten <maikmerten@googlemail.com> wrote:

> I can successfully assign BSS and ZPSAVE to RAM2, but those are only a few bytes, and assigning CODE to RAM2 will just lead to a crash on application startup. I'm clearly doing something very stupid there. Is there a promising way to move things to higher memory positions?

Assigning memory to a second bank is just the first step.  You need to manually move the memory into place yourself by altering the crt0.s startup code.  It's really quite easy, there's already code in there to move blocks that you can just clone and alter.  By naming your memory blocks, you get size and position labels in crt0.s that you need to use.  

If you look at the crt0.s and snake64.cfg found at this link (https://github.com/StewBC/snakebyte/tree/master/src/c64), you will see how DATA and RODATA is set up to load and then moved to a high segment for use.  

The docs also explain all this here: http://www.cc65.org/doc/ld65-5.html

Cheers
Stefan

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Aug 18 18:10:38 2013

This archive was generated by hypermail 2.1.8 : 2013-08-18 18:10:40 CEST