Re: [cc65] Problem with code compiled as overlay.

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2012-01-21 23:20:33
Greg has already answered the first question. Regarding

On Sat, Jan 21, 2012 at 12:33:59PM -0600, Payton Byrd wrote:
>    PS.  Another issue I have with this code is that the string literal in the
>    method is not compiled as part of the overlay.  I may have a lot of text
>    in each overlay, how do I make sure all the literals are compiled in the
>    overlays?

the compiler behaves as follows:

  1. Depending on the compiler flag --writable-strings, strings will either go
     into the DATA or the RODATA segment.

  2. Depending on the compiler flag --local-strings, strings will either get
     emitted when they're used, or when the end of the module is reached. If
     strings are readonly, the latter has the advantage that merging of
     strings is possible. So if your program uses

        "Hello world"
        "world"
        "Hello world"

     the compiler will only store one string. The other two are pointers
     to this copy.

Assuming that you're using the default settings, you will have to give another
name to the RODATA segment and place that into the overlay.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jan 21 23:20:39 2012

This archive was generated by hypermail 2.1.8 : 2012-01-21 23:20:42 CET