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 From: Brian May Newsgroups: comp.lang.ada Subject: Re: Ada equivalent for C-pointer? References: Date: Sat, 15 Jan 2005 16:00:44 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:plGD6ofzuJ6xOk2UROA1CAE/fDg= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1105765213 202.173.153.89 (15 Jan 2005 15:00:13 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:7794 Date: 2005-01-15T16:00:44+11:00 List-Id: >>>>> "Alfred" == Alfred Hilscher writes: Alfred> I want to interface to a C-function expecting a "far *", Alfred> what have I to pass: an "access all ..." or Alfred> "System.Address"? Are there differences between access and Alfred> address, or are their internal representations equal? I Alfred> use GNAT 3.15p. >>>>> "tmoran" == tmoran writes: [...] tmoran> There is no requirement that a System.Address have any tmoran> particular representation. For instance, quoting from the tmoran> manual for a compiler that handles the general tmoran> segment:offset form of addressing in tmoran> Intel 8086 descended chips: tmoran> type Address is record tmoran> Offset : Offset_Type; tmoran> Segment: Word; tmoran> end record; tmoran> which is 48 bits. Hello, To the best of my knowledge "far" pointers or pointers referring to segment:offset are obsolete in modern 32 bit Intel code unless you are writing low level OS code (e.g. device drivers). This is because the segmented model was considered painful for programmers to use (especially early Intel versions). As such, the 32 bit Intel processors still uses segments (although the meaning of the word has changed since 8086), the operating system maps one big segment to use for all data by a given program, and the application programmer doesn't have to worry. I would speculate that the "far" in this case may be ignored and is just a left over from old 16 bit MSDOS/Windows code. Unless this code is 16 bit MS-DOS/Windows code or low level operating system code (the poster didn't specify so I assumed this wasn't the case). -- Brian May