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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0df3c528abb570a,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!e21g2000vbz.googlegroups.com!not-for-mail From: milouz Newsgroups: comp.lang.ada Subject: strange behavior while compiling code with asm() Date: Thu, 26 May 2011 08:10:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 82.120.238.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1306422611 13139 127.0.0.1 (26 May 2011 15:10:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 26 May 2011 15:10:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e21g2000vbz.googlegroups.com; posting-host=82.120.238.178; posting-account=2RsWdAoAAACKmfJMpyMjxrxuBA0nNyCZ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKRUAELSC X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19492 Date: 2011-05-26T08:10:11-07:00 List-Id: Hi all, There's an unexpected behavior I can't understand when I compile some Ada code with Asm() directive. In the following example, code compile with no problem : ... procedure Main is Foo : Integer; begin Foo := 1; -- Foo is initialized here ! System.Machine_Code.Asm( "movl %0, %%eax", Inputs => Integer'Asm_Input("m", Foo), Volatile => True ); ... Why no trying to initialize `Foo' variale during its declaration ? The code is exactly the same except for `Foo' : procedure Main is Foo : Integer := 1; -- Foo is initialized here ! begin But then, compilation fails with that message : "error: memory input 0 is not directly addressable" Someone have an explanation ?