comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: question re Ada equivalent of C function
Date: 1998/02/21
Date: 1998-02-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.888117391@merv> (raw)
In-Reply-To: Pine.BSF.3.96.980221115827.17781A-100000@shell5.ba.best.com


Brian says

<<Well, that depends. If you just want to reuse some C routines, I'd suggest
that you use Interfaces.C and just reuse them. Otherwise, you'll want to
look at the System and System.Storage_Elements packages for what you want.
If you want to access a Character at some memory address, say
16#CAFEBABE#, you'd do something like this (boilerplate omitted)

...
Mem_Addr : constant Address := To_Address(16#CAFEBABE#);
Mem_Mapped_Char : Character;
for Mem_Mapped_Char'Address use Mem_Addr;
...

which is surprisingly self-explanatory.
>>

This may be self-explanatory, but has nothing at all to do with the inp
and outp routines, which are accesses to the IO/space (and result in
generation of IN/OUT instructions). Brian was mislead here by the
rather confusing wording of the original question.

Note that a C programmer can do this kind of reading directly from a 
memory address even more easily than an Ada programmer, and certainly
does not need library routines for doing it :-) :-)





  reply	other threads:[~1998-02-21  0:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-21  0:00 question re Ada equivalent of C function David Fisher
1998-02-21  0:00 ` Brian Rogoff
1998-02-21  0:00   ` Robert Dewar [this message]
1998-02-22  0:00     ` Brian Rogoff
1998-02-21  0:00   ` Jerry van Dijk
1998-02-21  0:00     ` David Fisher
1998-02-22  0:00       ` Jerry van Dijk
1998-02-22  0:00         ` Robert Dewar
1998-02-22  0:00           ` Andi Kleen
1998-02-22  0:00       ` Simon Wright
1998-02-22  0:00         ` Simon Wright
1998-02-22  0:00   ` Nick Roberts
1998-02-22  0:00     ` frc
1998-02-21  0:00 ` Robert Dewar
1998-02-21  0:00 ` Corey Ashford
1998-02-22  0:00   ` Nick Roberts
1998-02-22  0:00 ` Larry Kilgallen
1998-02-22  0:00   ` frc
1998-02-22  0:00     ` Linux/POSIX packages for GNAT Markus Kuhn
1998-02-22  0:00       ` Andi Kleen
1998-02-22  0:00         ` Samuel Tardieu
1998-02-23  0:00           ` Nick Roberts
1998-02-23  0:00             ` Samuel Tardieu
1998-03-05  0:00             ` Testing exception handlers James M. Darlack
1998-02-22  0:00         ` Linux/POSIX packages for GNAT Markus Kuhn
1998-02-22  0:00           ` Robert Dewar
1998-02-22  0:00       ` Robert Dewar
1998-02-23  0:00         ` Andi Kleen
1998-02-22  0:00           ` Robert Dewar
1998-02-23  0:00             ` Markus Kuhn
1998-02-23  0:00               ` Robert Dewar
1998-02-23  0:00         ` Markus Kuhn
1998-02-23  0:00           ` Robert Dewar
1998-02-23  0:00             ` Markus Kuhn
1998-02-24  0:00               ` question re Ada equivalent of C function Dale Stanbrough
1998-02-22  0:00   ` Robert Dewar
replies disabled

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