comp.lang.ada
 help / color / mirror / Atom feed
From: "John R. Strohm" <strohm@airmail.net>
Subject: Re: Help with Copying Shared Memory to Local
Date: Fri, 24 May 2002 13:43:09 -0700
Date: 2002-05-24T13:43:09-07:00	[thread overview]
Message-ID: <EE1B58C60CD7D9ED.3DE0D594451AD094.92104DC9322C357A@lp.airnews.net> (raw)
In-Reply-To: ulma9mqnj.fsf@gsfc.nasa.gov

type x is record
    csr: byte;
    dr: byte;
end record;
for x use record at mod 2;
for x'size use 16;

Or something of that nature.

Admittedly, it has been a number of years since I last looked at Ada rep
specs.  The thing I remember most painfully was laying out the registers for
a Signetics 2681 DUART, and then writing a reusable device driver as a set
of four generics.

"Stephen Leake" <stephen.a.leake.1@gsfc.nasa.gov> wrote in message
news:ulma9mqnj.fsf@gsfc.nasa.gov...
> "John R. Strohm" <strohm@airmail.net> writes:
>
> > Ada representation specifications provide a clean way to
> > tell the compiler what kind of access to use,
>
> This is _not_ what rep spec say. They say how to lay out the bits in
> memory, not how to access them.
>
> > and most compilers were good about following the programmer's
> > wishes.
>
> Some compilers do "what you want", but there is _no_ guarrantee in the
> language for this.
>
> If you need a 16 bit access, use assembly code. Wrap it up in a
> low-level Ada subprogram, to make it easy to use.
>
> Yes, it feels inefficient and inelegant, but it is the best approach.
>
> --
> -- Stephe





  reply	other threads:[~2002-05-24 20:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-23 13:50 Help with Copying Shared Memory to Local John Cupak
2002-05-23 20:32 ` Jeffrey Carter
2002-05-23 21:18   ` John Cupak
2002-05-24  1:37     ` Randy Brukardt
2002-05-24  2:08       ` Jeffrey Carter
2002-05-24 17:05         ` John R. Strohm
2002-05-24 16:55           ` Stephen Leake
2002-05-24 20:43             ` John R. Strohm [this message]
2002-05-24 19:49               ` Pat Rogers
2002-05-24 23:23                 ` martin.m.dowie
2002-05-24 20:54               ` Stephen Leake
2002-05-24 19:41           ` Jeffrey Carter
2002-05-26  0:55           ` John Cupak
2002-05-28 17:52             ` John Cupak
2002-05-25 11:23   ` Robert Dewar
2002-05-26  4:48     ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2002-05-24 14:22 Beard, Frank [Contractor]
2002-05-24 19:30 ` Jeffrey Carter
replies disabled

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