[fpc-devel] i8086 huge pointers
Nikolay Nikolov
nickysn at gmail.com
Tue Apr 8 14:50:19 CEST 2014
On 7.4.2014 г. 15:09, Max Nazhalov wrote:
> Monday, April 7, 2014, Nikolay Nikolov wrote:
>
> NN> Back in the old days, I never used huge pointers, because I wrote in
> NN> Turbo Pascal, which didn't have them, so I don't have an opinion which
> NN> way is better.
>
> I've rechecked -- and yes, You are right, BP7 RTL itself uses SelectorInc only
> in DPMI16 environment for locating writable alias for the current code segment
> (it's just an internal borland EXE loader convention to create such aliases).
> For all other modes this variable just maintained [and it works, if you
> manually use it in, e.g., Win16 for accessing huge data block allocated with
> Win16 API, either in real or protected mode, since Win16 kernel exports
> constant "__AHIncr", which is exactly the same thing as SelectorInc, and is
> used by BP7 RTL for SelectorInc initialization].
>
> For "real mode" normalization of (typed?) huge pointer probably could be done
> during converting it to regular far pointer. But for non-"real mode" segmented
> model access to the data structure crossing segment boundary always a challenge
> ending up with "stream it out to the safe place at first", if the structure is
> relatively small.
Hmm, then maybe we should support both and add a
{$HUGEPOINTERNORMALIZATION} directive?
Nikolay
More information about the fpc-devel
mailing list