From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:a9c4:0:b0:6a6:8992:e400 with SMTP id s187-20020a37a9c4000000b006a68992e400mr25947181qke.494.1654810220248; Thu, 09 Jun 2022 14:30:20 -0700 (PDT) X-Received: by 2002:a0d:ee47:0:b0:2ff:85e6:9e03 with SMTP id x68-20020a0dee47000000b002ff85e69e03mr45281706ywe.172.1654810220048; Thu, 09 Jun 2022 14:30:20 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 9 Jun 2022 14:30:18 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=98.211.187.237; posting-account=Ru7E4QoAAAC_HiQ2D8LjZ7rh1mbTNcVn NNTP-Posting-Host: 98.211.187.237 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Using pointers with inline assembly in Ada From: NiGHTS Injection-Date: Thu, 09 Jun 2022 21:30:20 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 1909 Xref: reader02.eternal-september.org comp.lang.ada:63957 List-Id: I would like to write an inline assembly code in Ada that simply writes a constant to a specific element of an array of unsigned values. I'm shooting in the dark here because there are absolutely no references on this subject, to my surprise. This was my first experiment which produces a memory access error. In this early version I'm just trying to write to the first element. declare type ff is array (0 .. 10) of Unsigned_32; pragma Pack(ff); Flags : aliased ff := (others => 0); Flag_Address : System.Address := Flags'Address; begin Asm ( "movl %0, %%eax" & "movl $1, (%%eax)" , Inputs => System.Address'Asm_Input ("g", Flag_Address), Clobber => "eax", Volatile => true ); Put_Line ("Output:" & Flags(0)'Img); end; Any help would be greatly appreciated!