From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,39f75d16f934f719 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-06 23:16:28 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!news.iag.net!news.mathworks.com!uunet!intrepid.intrepid.com!usenet From: vladimir@speedy.intrepid.com (Vladimir Vukicevic) Newsgroups: comp.lang.ada Subject: Re: Type t is MOD c??? Date: 07 Feb 1995 07:16:28 GMT Organization: Intrepid Technology, Inc. Message-ID: References: <3h5bei$npp@nyheter.chalmers.se> NNTP-Posting-Host: speedy.intrepid.com In-reply-to: Magnus Hakansson's message of 6 Feb 1995 14:24:18 GMT Date: 1995-02-07T07:16:28+00:00 List-Id: In article <3h5bei$npp@nyheter.chalmers.se> Magnus Hakansson writes: > 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? You would do something like: with System.Storage_Elements; package Q is X : Integer; for X'Address use System.Storage_Elements.To_Address (16#ffff#); end Q; to access the Integer at address 16#ffff#. The type Address is left as implementation-defined in the standard; in GNAT, it's private. The 'Address attribute rep clause takes a System.Address, so you have to use the functions in System.Storage_Elements to convert an integer to an Address. (See RM9X5.0 13.3(10), 13.7, 13.7.1) - Vladimir