[fpc-devel] i8086 huge pointers

Max Nazhalov stein_nospam at mail.ru
Mon Apr 7 14:09:39 CEST 2014

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.

WBR, Max.

More information about the fpc-devel mailing list