Mail Archives: djgpp/1995/11/22/13:21:28
> From: ngh94 AT aber DOT ac DOT uk (NIGEL HUGHES)
> Date: 21 Nov 1995 13:27:22 GMT
>
> Dear All,
> Quick question. I have some asm routines (in a separate
> ..S file which I link in) and have parameters being passed OK no
> probs. The question I have is, where do I leave a value so it
> is returned by the function? Stack a register (%eax sounds likely) or what?
>
> e.g.
>
> long leg;
>
> leg=my_asm_function();
>
> Thanks in advance,
>
> Nigel
>
I don't know exactly, but you can easily figure this out by compiling a
test program to assembly, like this:
test.c:
long test()
{
return 16L;
}
gcc -S test.c
As the result you will have .s file, in which you can see how the return value
is passed.
---
Alexander Lukyanov
lav AT video DOT yars DOT free DOT net
- Raw text -