From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ac6f6c30c45f808a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nick Roberts Newsgroups: comp.lang.ada Subject: Re: Ada equivalent for C-pointer? Date: Sat, 15 Jan 2005 15:51:43 +0000 Message-ID: References: <41E7F653.2F899F47@alfred-hilscher.de> Content-Type: text/plain; charset=us-ascii X-Trace: individual.net Mi6FC9JhUDBkEMq2inwgGwGkFQ9qFAexKz1PJsRSxgt+3vQaE= X-Orig-Path: not-for-mail User-Agent: Gemini/1.45d (Qt/3.3.2) (Windows-XP) Xref: g2news1.google.com comp.lang.ada:7814 Date: 2005-01-15T15:51:43+00:00 List-Id: Stephen Leake wrote: > On older x86 systems, when 16 bit operating systems were used, there were > two kinds of pointers; "near" pointers, 16 bits in size, and "far" > pointers, 32 or 48 bits in size. > > These days, you should interpret "far" as a noop, and just think of it as > a pointer. I want to be pedantic about this; please bear with me. In what is called the 'flat' 32-bit memory model, a far pointer is the same as near pointer (a 32-bit absolute offset, on its own). Since 32-bit Windows (and indeed 32-bit Linux) only uses the flat memory model, this mode appertains mandatorily. However, in 32-bit segmented mode, a far pointer comprises a 32-bit offset plus a 16-bit segment selector. These are stored in memory in a format which is 64 bits in size (16 bits are wasted). I understand there are some C compilers which support 32-bit segmented mode compilation (e.g. WATCOM), but GCC never has and probably never will. The distinction may seem pointless (sorry :-) to most people, but it matters to me (because it will matter to AdaOS ;-) To clarify, when we are talking about near and far pointers, we are specifically talking about the 32-bit Intel Architecture (IA-32). I'm not aware of any other contemporary architecture supporting a superimposed segmentation scheme. -- Nick Roberts