Re: Inline Assembly Help

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

 



Hi Brian,

I would like to tell you that your question has been answered in the GCC 
documentation for inline assembly.

Your first question related to operand numbering,

Operands corresponding to the C expressions are represented by %0, %1 ...
etc.
In the assembler template, each operand is referenced by numbers. 
Numbering is done as follows. If there are a total of n operands (both input
and output inclusive), 
then the first output operand is numbered 0, continuing in increasing order, 
and the last input operand is numbered n-1. 

Now getting back to your question, a single variable may serve as both the
input 
and the output operand.

Such cases may be specified in "asm" by using matching constraints. 
asm ("incl %0" :"=a"(var):"0"(var)); 

For more information on the same kindly refer 
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

Regards
Manjunath S M


Brian O'Mahoney-4 wrote:
> 
> A very simple question, but no-where explicitly documented, when using 
> extended assembly, how are operand numbers ie %n relate to input and
> output 
> constraint-lists ?
> 
> Do they independently count from zero, in each constraint list? What if an 
> operand is in & out put?
> 
> Thanks, Brian
> 
> -- 
> Greetings (mit freundlichen Grüßen), Brian.
> 
> Dr. Brian O'Mahoney Email: omb@xxxxxxxxxxx
> 
> 

-- 
View this message in context: http://old.nabble.com/Inline-Assembly-Help-tp27926516p27927993.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[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