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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23a17bbd96d53327 X-Google-Attributes: gid103376,public From: dewar@gnat.com Subject: Re: Assembler in Ada? Date: 1999/01/24 Message-ID: <78fvjm$82t$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 436390715 References: <369C5E08.69727537@mbox5.swipnet.se> <78a32f$dbr$1@remarQ.com> X-Http-Proxy: 1.0 x3.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sun Jan 24 20:25:35 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-24T00:00:00+00:00 List-Id: In article <78a32f$dbr$1@remarQ.com>, > Asm ( > "movl %1, %%eax" & nl & -- note nl This is a bad idea, use one Asm call per instruction. Also you probably do NOT want to use an explicit register here. It is allowed, but it usually at the wrong level. It is true one does this more on the ia32 than other machines, but it is poor as an example. You do not need to set the clobbers argument in this case to %%eax, it won't cause trouble to do so, but there is no need, and in an example it is confusing. > False -- compiler, do not optimise my code It is quite wrong to mark this as volatile, this is not a volatile instruction. > From the last example you can see that it is necessary to > be very careful when > manually controlling passing varaibles to the registers. It is generally a bad idea to write asm code at this level (a level where you rely on detailed knowledge of the ABI for passing parameters), and it is not necessary. Once again, we recommend that anyone interested in using this feature read the documentation in the GCC manual. The design of the ASM feature in Ada has been chosen to be a very thin binding to the corresponding C feature, so that documentation and examples apply without any confusion. Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own