comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Ada and pointers
Date: Wed, 15 Aug 2001 17:00:25 -0400
Date: 2001-08-15T21:00:26+00:00	[thread overview]
Message-ID: <9lenta$joq$1@nh.pace.co.uk> (raw)
In-Reply-To: 3B7AD379.5559D329@worldnet.att.net

Well, I wasn't exactly making the claim that all segmented hardware can
address linearly. I was making the claim that for purposes of
conceptualizing memory that all memory could be viewed as a single
dimensional array with an integer index.

Obviously, different hardware architectures are going to treat it
differently, and not all architectures with a segmented address can (at the
hardware level) treat their memory as being linear. But for purposes of
logical thought experiments, you can treat a segmented address space as
linear just by (in your mind) concatenating the segment part and the offset
part. It becomes (in your mind) one big integer.

Clearly, Ada's abstraction of access types from any particular addressing
scheme is a good thing. It looks the same from the software level no matter
what the underlying hardware is like. For example, an architecture with a 32
bit segment and a 32 bit offset can be viewed identically to one with a 64
bit linear address because Ada is going to bookeep both under an access type
(or System.Address) and provide every operation you need for working with
the addresses without your having to know if the memory reference is kept in
one or two parts.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"James Rogers" <jimmaureenrogers@worldnet.att.net> wrote in message
news:3B7AD379.5559D329@worldnet.att.net...
>
> Sometimes this is correct. Some systems do have the ability to use
> both linear addressing and segment-offset addressing. Some of the
> older systems do not have any ability to support linear addressing.
> This is one reason the type System.Address is implementation defined.
> System.Address also has comparison functions, but is not an aritmetic
> type. It does have addition, subtraction, and modulus operations
> defined in System.Storage_Elements, but that does not make
> System.Address a numeric type.
>
> Note that there is a type called
> System.Storage_Elements.Integer_Address.
> This type is not a System.Address, but does provide conversion
> functions to and from System.Address.
>
> Ada provides, through these types, conversions between linear and
> segmented memory models, even if those conversions are not directly
> supported by the hardware memory model.
>






  reply	other threads:[~2001-08-15 21:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-13  7:05 How Ada could have prevented the Red Code distributed denial of service attack Gautier Write-only-address
2001-08-15  7:19 ` Ada and pointers Tony Gair
2001-08-15 12:49   ` Hambut
2001-08-15 13:33     ` Marin David Condic
2001-08-15 12:57       ` Jonathan DeSena
2001-08-16  1:46         ` Tony Gair
2001-08-16 13:37           ` Marin David Condic
2001-08-16 15:43             ` Darren New
2001-08-16 16:29               ` James Rogers
2001-08-16 16:56                 ` Darren New
2001-08-17 14:58                   ` Ted Dennison
2001-08-17 17:14                     ` Darren New
2001-08-15 16:02       ` James Rogers
2001-08-15 17:16         ` Marin David Condic
2001-08-15 19:52           ` James Rogers
2001-08-15 21:00             ` Marin David Condic [this message]
2001-08-15 18:54       ` Hambut
2001-08-15 19:53         ` Marin David Condic
2001-08-16  8:25           ` Hambut
2001-08-15 16:25     ` Warren W. Gay VE3WWG
2001-08-15 13:37   ` Ted Dennison
replies disabled

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