Re: Porting to .intel_syntax Inline Assembly / "m" Constraint with .intel_syntax / Targeting -fPIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Yek <dyek@xxxxxxxx> writes:

> I would like to find out if it is a good idea to utilize GCC's
> .intel_syntax Inline Assembly support (for non-trivial blocks), or to
> convert them to GAS or NASM assembly functions, .S files.

For a complete function written in assembly code, you might as well
put it in a .s or .S file.  You can put it in a .c file using a simple
asm if that is is more convenient for you.  It doesn't make any big
difference.


> Is there a way I can use the memory constraint, "m", effectively in
> .intel_syntax Inline Assembly?

Use the -masm=intel option with gcc.


> (3) Is there any document providing information how I can create a
> single version of assembly code (Inline Assembly or pure assembly) and
> have it compiled with or without -fPIC correctly?

I don't know of any document.  The basic guideline is fairly obvious:
don't use %ebx.  If you must use it, push and pop it in your assembly
code.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux