- Sorry for my English.
- Thanks for every answer.
I've got a following code in C and inline assembly which should do the call of function: int gettimeofday(struct timeval *tp, struct timezone *tzp);
val = (struct timeval*)malloc(sizeof(struct timeval));
zone = (struct timezone*)malloc(sizeof(struct timezone));
__asm__("push $0;"
"push %2;"
"push %1;"
"movl $116, %%eax;"
"int $0x80;"
:"=r"(val)
:"r"(val),"r"(zone)
:"%eax");
The problem is, that I don't know why I need to have this line "push $0;"
and my teacher said, that my arguments are not in correct order and it's just luck that it works.
How should I change this code to make it correct? Why is there "push $0;"
if is it somehow correct?