There is a C code that calls the procedure in assembly language:

extern double convert(char str[]); 

I want to return the result to ASM via EDX:EAX .

Question. In these registers already have a number, so I leave it? Or load it in ST(0) as one?

 int main() { double result; char str[] = "1234567890123"; result = convert(str); printf("convert(\"%s\") = %lf\n", str, result); } // main convert("1234567890123") = 1234567890123.000000; 
  • 2
    IMHO in x86-64 sishnaya function (at least in gcc) double func (...) returns the result in xmm0, and in it is passed the first of the double arguments to printf. In general, gcc -S makes assembly code. - avp 9:22 pm
  • To be honest, I did not quite understand your answer .. because I'm in this business for a month and a half just .. - balona
  • 2
    @balona, ​​write small programs in C. Run gcc -S tst.c and study the assembler file tst.s If you want, you can edit and translate it, for example, with the same gcc gcc tst.s will create ./a.out - avp
  • one
    And you can just go here and enter your c ++ code and look at the assembler output. - KoVadim 4:38 pm

0