This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: inline assembly and more


clc5q@cobra.cs.Virginia.EDU (Clark L. Coleman) writes:
> In article <3829043A.68263C43@spam.com>, anthony  <no@spam.com> wrote:
> [snip]
> >2) I would like to use inline assembly code in the c source file
> >the __asm__() syntax seems to be very frustrating is there a way to
> >use a
> >    #asm
> >                fmul
> >                xor eax,eax
> >    #endasm 
> >or a 
> >        int c = 4;
> >    asm movl %eax,c
> >        d = c++;
> >syntax, if possible with intel syntax notation (ie using nasm)
> 
> Not that I know of.

Me neither.

If you use on a netnews search engine to search for "inline asm" in
this news group, you should find posts with information and pointers
that will hopefully make the syntax less frustrating.

> [snip]
> In C++, you can sprinkle your variable declarations around your code
> wherever you want, but not in C. Variable declarations go at the top
> of a block, not after any executable code in the block.

C99 allows declarations to be sprinkled throughout blocks, just as in
C++. But for portable C code, you should follow the C89 rules for the
next few years at least.

David Wragg


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]