C to D, HtoD fails

Stewart Gordon smjg_1998 at yahoo.com
Sat Sep 9 15:40:47 PDT 2006


BCS wrote:
<snip>
> Far is an old hack (part of the standard but ugly as watever) to allow a 16 bit
> computer to access a 32bit address space without wasting lots of time. What was
> done is to use a 16bit "section" address for the upper half of the address. then
> all htta is need is a 16bit pointer for the lower half. This is called a near
> pointer and avoids the need to load the whole thing each time. A far pointer use
> when that isn't good enough. It is just a full 32bit pointer.
> 
> You should be able to ignore it. If you find a near pointer... you will have problems.

If finding a near pointer is a problem, then the API isn't 32-bit 
compatible.

Under a 32-bit system, there's no such distinction as that between near 
and far pointers.  C(++) compilers may accept "near" and "far" in 32-bit 
mode, but this is purely for backward compatibility with 16-bit code. 
You'll find that both are treated as 32-bit pointers just the same.

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- 
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.



More information about the Digitalmars-d-learn mailing list