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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,edb329885d962c1d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-05 17:17:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!proxad.net!freenix!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: RE: Ada and ASM Date: Fri, 5 Sep 2003 17:15:47 -0700 Organization: ENST, France Message-ID: NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1062807383 47434 137.194.161.2 (6 Sep 2003 00:16:23 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 6 Sep 2003 00:16:23 +0000 (UTC) Cc: comp.lang.ada@ada.eu.org To: "'Simon Wright'" Return-Path: X-Mailer: Microsoft Office Outlook, Build 11.0.5329 Thread-Index: AcNz7+V1ymk1/+W5QWmwgU7QwdC58gABgi7A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <200309051909.h85J9Flb002351@smaug.pushface.org> X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:42196 Date: 2003-09-05T17:15:47-07:00 I want to replace the ASM call by Ada syntax. Assuming one had a package Asm, then I would like something like the following A,B:Asm.register_32; A:=10_000; Asm.Move(From=>A To=>B); The assembly operations are expressed as true Ada subprograms. Bob Leif Robert C. Leif, Ph.D. Email rleif@rleif.com -----Original Message----- From: Simon Wright [mailto:simon@pushface.org] Sent: Friday, September 05, 2003 12:09 PM To: rleif@rleif.com Cc: comp.lang.ada@ada.eu.org Subject: Re: Ada and ASM > From: "Robert C. Leif" > Although GNAT has moved in this direction, it appears to be far from a true > Ada syntax representation. > From: > http://gcc.gnu.org/onlinedocs/gnat_ug_unx/The-Volatile-Parameter.html#The%20 > Volatile%20Parameter > Asm ("movl %0, %%ebx" & LF & HT & > "movl %%ebx, %1", > Inputs => Unsigned_32'Asm_Input ("g", Var_In), > Outputs => Unsigned_32'Asm_Output ("=g", Var_Out), > Clobber => "ebx", > Volatile => True); > The actual Asm statement still is a quoted string. It is not Ada syntax. I do not understand how it could possibly "[be] Ada syntax". OP wanted to include an asm *routine*, I think, so perhaps what is wanted instead is a pragma Import (Asm, ...)? (if suoported). You could always write the asm routine using C calling conventions, whatever they are (if different from asm) and use pragma Import (C, ...). As always, and as others have said, RTFM!