Mail Archives: djgpp/1997/12/29/06:31:17
On Mon, 29 Dec 1997, S. M. Halloran wrote:
> FAR and NEAR and other "fundamental classes of data types" like this
> are inventions necessary for the "real mode" segment-offset
> addressing architecture of the Intel x86 chips. Intel eliminates
> this craziness with the 80386 chips and those that follow. Intel
> must retain this crazy way of memory addressing, of course, so that
> older programs compiled can run, but with the 386 and beyond, Intel
> goes to the "flat model" (and common sense) way of memory addressing.
This is a very common misconception. NEAR and FAR are here because of
the segmented architecture of the Intel chips, more precisely, of their
way to access memory. This segmentation does NOT go away in 386 and
better processors, nor is it eliminated in protected-mode programs. What
does happen is that you get a huge (2GB-long) data segment, so using only
NEAR pointers you have a very large address space. Think of it as if you
were programming in the real-mode small memory model: would you say that
the segments are ``gone'' for small model also?
I don't know enough about RSXNT (to which the originator of this thread
referred), but NEAR, FAR and PASCAL could be used there for a purpose.
In protected-mode programming, far pointers are used to access parts of
memory which aren't mapped into your data segment, such as memory-mapped
devices and some 16-bit layers of the Windows address space.
- Raw text -