Thanks guys,

In the end I just ended up marshalling the strings by copying to a shared
memory buffer... works well enough for what I need but will remember the
above info for next time I need this.

Brad

On Mon, Apr 13, 2020 at 7:13 PM Sergey Belyashov <sergey.belyas...@gmail.com>
wrote:

> Hi,
>
> Z80 port has --constseg support, but it looks incomplete.
> int f1() {
>   static const char text[] = "some text"; //text will be placed in _CODE
> segment
>   puts(text);
> }
> int f2() {
>   puts("some text"); //text will be placed in constseg segment
> }
>
> Sergey Belyashov
>
> пн, 13 апр. 2020 г. в 11:59, Philipp Klaus Krause <p...@spth.de>:
>
>> Am 13.04.20 um 01:07 schrieb Brad Robinson:
>> > Is there any way to get SDCC to place string literals into a const area
>> > when targeting Z80?
>> >
>> > I'm looking at a situation where I need to do some paging between a
>> > couple of different code overlays and having string literals embedded in
>> > the code area means those strings might get paged out when calling
>> > between overlays.
>> >
>> > It'd be great to be able to manage those strings as a linker area so I
>> > could move them to somewhere that won't be paged out.
>> >
>> > Brad
>>
>> Named address spaces would work, but are overkill for this use-case.
>>
>> I don't remember if the z80 backend has support for separate const and
>> code segments already. If it does, #pragma constseg or --constseg would
>> be a good solution.
>>
>> Otherwise, #pragma codeseg is probably the easiest.
>>
>> Philipp
>>
>>
>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>>
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to