comp.lang.ada
 help / color / mirror / Atom feed
From: robert_dewar@my-dejanews.com
Subject: Re: How do I get this to work??
Date: 1999/01/10
Date: 1999-01-10T00:00:00+00:00	[thread overview]
Message-ID: <77abdp$d5e$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 369850a6.31871728@news.pacbell.net

In article <369850a6.31871728@news.pacbell.net>,
  tmoran@bix.com (Tom Moran) wrote:
> Sorry, I was trying to correct your apparent impression
> that segmented architectures started with the 286.  The
> closest to an Ada compiler I ever had for a Burroughs
> machine was a simple little toy one I wrote in the early
> 80's on a B6700, but the B5500 of course had segments
> over 15 years earlier.  See the book by Elliot Organick
> for more info.

Tom, just so you know, I am a reasonable expert on
processor architecture, and have of course worked with
the B5500 (I wrote some large applications for this
machine for the banking industry).

Yes, of course, the 8086 did not invent segmentation per
se, but assuming *you* know the 5500 architecture well
(most people do not, seeing as it was only programmed in
high level languages, and there was no assembler), then you
will know that the model of segmentation in the 5500 is
completely different from that of the 8086.

The real point here though is that the thread was about the
representation of System.Address and access types in Ada.
Your comments about segmentation in this context were, I
assumed, and I think correctly, related specifically to
the 80286, and are therefore probably irrelevant at this
stage. Yes, segmentation is present in the PII, for
compatibility purposes, and used in some limited manners in
the operating system kernel, but it would be *very*
surprising to find an Ada compiler that used 48-bit
representations for addresses. Even if you did want your
Ada compiler to handle segmentation, this is not the way
you would do it!

So my original point is valid, and should not be obfuscated
by concerns about segmentation on the 286! Namely that the
representation of both Address and access types to simple
C-compatible objects will in practice be the same as C
pointers in virtually all implementations.

Remember after all that in C itself, there is no guarantee
that a pointer value looks like a machine pointer. Indeed
from a semantic point of view in C, a pointer is a two
element structure, consisting of a base address in an
allocated object and an offset. One can imagine a checking
compiler (or a C-specific architecture) that represents
pointers that way, but it is very unlikely.

It is in fact interesting to note that C does NOT provide a
linear view of the address space, so general address
arithmetic is not possible in C. Yes, your C compiler may
provide such a capability in practice but you are using
undefined operations. In contrast, Ada 95 *does* provide
a linear address model via the Integer_Address type in
System.Storage_Elements. You can for example in Ada, but
not in C, create fully conforming portable code that
provides hashing of addresses of objects, this is not
possible in strict C.

For more details on the segmentation mechanism in the x86,
and in particular the interesting history of how it came
about, read chapters 2-3 in my Microprocessors book
(Microprocessors: A Programmer's View, McGraw Hill 1990).
Interestingly, although this book is quite old now, most
of it is still quite up to date. It is really only the EPIC
introduction that will make it out of date :-)

Robert Dewar


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  parent reply	other threads:[~1999-01-10  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-04  0:00 How do I get this to work?? Chris Warwick
1999-01-05  0:00 ` Tom Moran
1999-01-05  0:00 ` Chris Warwick
1999-01-05  0:00   ` Stephen Leake
1999-01-05  0:00     ` Tom Moran
1999-01-06  0:00       ` robert_dewar
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-10  0:00                 ` Tom Moran
1999-01-10  0:00                   ` robert_dewar
1999-01-10  0:00                   ` robert_dewar [this message]
1999-01-10  0:00                     ` Pat Rogers
1999-01-10  0:00                     ` Tom Moran
1999-01-06  0:00         ` Larry Kilgallen
1999-01-06  0:00           ` Tom Moran
1999-01-06  0:00         ` Tom Moran
1999-01-07  0:00           ` robert_dewar
1999-01-07  0:00             ` Tom Moran
1999-01-10  0:00               ` robert_dewar
1999-01-06  0:00     ` Chris Warwick
1999-01-06  0:00       ` Tom Moran
1999-01-07  0:00       ` Stephen Leake
1999-01-08  0:00         ` Simon Wright
1999-01-07  0:00       ` robert_dewar
1999-01-09  0:00         ` Chris Warwick
1999-01-09  0:00           ` Brian Rogoff
1999-01-10  0:00             ` Matthew Heaney
1999-01-09  0:00           ` Simon Wright
1999-01-10  0:00             ` robert_dewar
1999-01-11  0:00               ` Simon Wright
1999-01-16  0:00               ` Chris Warwick
1999-01-16  0:00                 ` Matthew Heaney
1999-01-16  0:00                   ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` Matthew Heaney
1999-01-18  0:00                     ` robert_dewar
1999-01-18  0:00                       ` dennison
1999-01-18  0:00                       ` Tucker Taft
1999-01-19  0:00                         ` Chris Warwick
1999-01-19  0:00                           ` Tom Moran
1999-01-19  0:00                           ` robert_dewar
1999-01-20  0:00                             ` Jeff Carter
1999-01-20  0:00                               ` robert_dewar
1999-01-21  0:00                                 ` Chris Warwick
1999-01-19  0:00                           ` Stephen Leake
1999-01-18  0:00                     ` dennison
1999-01-16  0:00                 ` Simon Wright
1999-01-16  0:00                 ` robert_dewar
1999-01-18  0:00                   ` Chris Warwick
1999-01-18  0:00                     ` Matthew Heaney
1999-01-06  0:00     ` robert_dewar
1999-01-06  0:00   ` Simon Wright
1999-01-22  0:00   ` Nick Roberts
replies disabled

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