Met*_*est 5 c linux x86 gcc inline-assembly
说,我想在gcc的内联汇编中调用具有以下签名的函数.我怎样才能做到这一点?
int some_function( void * arg );
Run Code Online (Sandbox Code Playgroud)
一般来说,你会想要做类似的事情
void *x;
asm(".. code that writes to register %0" : "=r"(x) : ...
int r = some_function(x);
asm(".. code that uses the result..." : ... : "r"(r), ...
Run Code Online (Sandbox Code Playgroud)
也就是说,您根本不想在内联asm中执行函数调用.这样您就不必担心调用约定或堆栈帧管理的细节.