comp.lang.ada
 help / color / mirror / Atom feed
From: Brian May <bam@snoopy.apana.org.au>
Subject: Re: Ada equivalent for C-pointer?
Date: Sat, 15 Jan 2005 16:00:44 +1100
Date: 2005-01-15T16:00:44+11:00	[thread overview]
Message-ID: <sa4651zjngj.fsf@snoopy.apana.org.au> (raw)
In-Reply-To: iqudncBsUsRtuHXcRVn-ug@comcast.com

>>>>> "Alfred" == Alfred Hilscher <SPAM@alfred-hilscher.de> 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  <tmoran@acm.org> 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 <bam@snoopy.apana.org.au>



  reply	other threads:[~2005-01-15  5:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-14 16:41 Ada equivalent for C-pointer? Alfred Hilscher
2005-01-14 17:00 ` Duncan Sands
2005-01-14 20:05   ` tmoran
2005-01-15  5:00     ` Brian May [this message]
2005-01-14 22:33 ` Keith Thompson
2005-01-14 23:03   ` Stephen Leake
2005-01-15 15:51     ` Nick Roberts
2005-01-15 18:54       ` tmoran
2005-01-16  1:43         ` Keith Thompson
2005-01-17 21:35       ` Randy Brukardt
2005-01-15  9:09 ` Martin Krischik
2005-01-15 16:03 ` Nick Roberts
2005-01-15 16:27   ` Pascal Obry
2005-01-15 16:50     ` Nick Roberts
2005-01-15 17:11       ` Simon Wright
2005-01-15 18:46         ` Nick Roberts
2005-01-15 17:49       ` Pascal Obry
2005-01-16  8:44       ` Martin Krischik
2005-01-16  9:58         ` Pascal Obry
2005-01-16 11:07           ` Martin Krischik
2005-01-16  8:36     ` Martin Krischik
2005-01-16 15:01       ` Niklas Holsti
2005-01-16 16:02         ` Martin Krischik
2005-01-17 15:33           ` Niklas Holsti
2005-01-16 20:39         ` Nick Roberts
2005-01-17 21:38     ` Randy Brukardt
2005-01-17 21:45       ` Pascal Obry
2005-01-17 13:11 ` Alfred Hilscher
2005-01-18  7:31   ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox