comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Type t is MOD c???
Date: 7 Feb 1995 06:56:30 -0500
Date: 1995-02-07T06:56:30-05:00	[thread overview]
Message-ID: <3h7n5e$p95@gnat.cs.nyu.edu> (raw)
In-Reply-To: 3h5bei$npp@nyheter.chalmers.se

Magnus Hakansson asks:

   This probably a very simple question when you know the answer,
   but it is causing me some troubble. In "system.ads" there is a
   declaraton:

   type Address is mod Memory_Size;

   and I want to know how to assign a specific address to a pointer.
   How do I do? What is the syntax for an "address"? Is there any
   hidden packages avilable for accessing certain bytes of the memory
   of my PC, or is there any other tricks I don't know?

   Can anyone help me on this subject?

Magnus, clearly you are using Ada 95 (probably GNAT, though you did not say).
Assigning an address to a pointer can be done, but is usually not the best way
of doing things instead use:

  for x'address use expr;

where x is a variable, and expr is an address. For how to construct an
address, see the type Integer_Address and associated routines in the
package System.Storage_Elements.

If you really need to convert an address to a pointer, see package
System.Address_To_Access_Conversions.




      parent reply	other threads:[~1995-02-07 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-06 14:24 Type t is MOD c??? Magnus Hakansson
1995-02-07  7:16 ` Vladimir Vukicevic
1995-02-07 11:56 ` Robert Dewar [this message]
replies disabled

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