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,ca23420b45ed64d7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-01 09:24:36 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: Address representation clause is getting 0 Date: Thu, 01 Jan 2004 17:24:35 +0000 Message-ID: References: NNTP-Posting-Host: abyss2.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1072977875 1950 62.49.62.197 (1 Jan 2004 17:24:35 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 1 Jan 2004 17:24:35 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:4019 Date: 2004-01-01T17:24:35+00:00 List-Id: On Wed, 31 Dec 2003 15:48:36 -0600, Randy Brukardt wrote: > "Luke A. Guest" wrote > in message > news:pan.2003.12.31.13.53.00.912339@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co. > uk... >> I think that this is an elaboration problem. Now as I don't have a runtime >> or any tools, I need to rely on my own code (think of this as an OS >> kernel). >> >> Does anyone know what I need to do to get this to work? > > Ada access objects are initialized to null by default. The object to which > you applied the address clause is thus getting initialized. You have to tell > the compiler not to do that, and the way you do that is to give a pragma > Import. Something like > > pragma Import (SB_Block, Ada); > > will suppress the initialization, allowing you to read the data. Not only this, but I had to change all To_Address(*) to System'To_Address(*) so that I had a static address rather than a function call. Also, by adding: pragma Restrictions(No_Elaboration_Code); to the start of my spec, I didn't have to call any elaboration code ;-) All this worked and I can now dump a character to the screen, yay! Thanks, Luke.