[fpc-devel] Proposal for implementing named address space support

Jonas Maebe jonas at freepascal.org
Sat Jan 9 14:52:05 CET 2021


On 08/01/2021 22:00, Christo Crause via fpc-devel wrote:
> On Sun, Oct 4, 2020 at 1:49 PM Christo Crause <christo.crause at gmail.com
> <mailto:christo.crause at gmail.com>> wrote:
> 
>     FPC can use the section modifier to specify which address space
>     should be used for data.
> 
> 
> I've made some progress in certain areas (basically static variables),
> the following type of AVR code example works:
> var
>   w: word = $BEEF; section '.eeprom';
>   b: byte;
> begin
>   b := hi(w);
> end.
> 
> However I see problems with propagating section information through
> reference type parameters. I'm not sure how to propagate the section
> information of the variable "w" through the parameter

Can't you use something like the far pointers used on the 8086 target? (
(a regular pointer only contains an offset, a far pointer contains both
a segment and an offset) If so, the main downside is that it would
increase the size of all reference parameters to include room for the
section part of the pointer, unless you add a directive to disable that
(or couple it to the existing farpointers directive).


Jonas


More information about the fpc-devel mailing list