This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: inline assembly and more
- To: help-gcc at gnu dot org
- Subject: Re: inline assembly and more
- From: David Wragg <dpw at doc dot ic dot ac dot uk>
- Date: 11 Nov 1999 00:48:04 +0000
- Newsgroups: gnu.gcc.help
- Organization: (Posted via) U-NET Internet Ltd.
- References: <3829043A.68263C43@spam.com> <80bvrj$r0t$1@murdoch.acc.Virginia.EDU>
- Xref: wodc7nx0 gnu.gcc.help:1774
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