Page 1 of 1
asm inline function
Posted: Sat May 10, 2008 9:57 am
by asdfgh
wat is the asm inline function in c for poping value from stack and storing it in a variable
Posted: Sat May 10, 2008 11:23 am
by JamesM
Have you googled it? Have you read the manual?
------------------------
Code: Select all
asm volatile("pop %0" : "=r" (my_value))
Posted: Wed May 14, 2008 8:14 pm
by DeletedAccount
I however hate gcc inline assembly , write a separate .asm or .s and link it ...
Posted: Wed May 14, 2008 9:54 pm
by Brynet-Inc
SandeepMathew wrote:I however hate gcc inline assembly , write a separate .asm or .s and link it ...
You might, however, not everyone agrees with you.
I sure don't, 99.9% of the time.
Posted: Wed May 14, 2008 11:30 pm
by piranha
Inline assembly can be annoying, but it makes the code better (in my opinion) because I don't have to load 2 files to look at one function.
I like it better than normal assembly.
-JL
Posted: Thu May 15, 2008 2:04 pm
by svdmeer
For just one or two instructions, inline assembly is imho better.
A seperate file is "too much" for such tiny things.
Posted: Thu May 15, 2008 2:14 pm
by Korona
Inline assembly integrates better into the c code. There are no unnecessary register spills and there is no function prologue / epilogue overhead if the inline assembly instructions can be inlined.