try this assembly, this may help ... although it works for me.
#include <stdlib.h> #include <stdio.h> int main(int argc, char *arg[]) { int retval; printf ( " retval = %d \n", retval ); asm volatile( "movl %%ecx , %0\n\t" :"=r" (retval)); printf ( "retval = %d \n", retval ); return 0; }
displays the following value for me ... I tried debugging, the second value is the same as the value present in the ecx register.
p $ ecx
gdb command
> retval = 0 > retval = -72537468
source share