X86 Build: Release movsd instruction
This is my problem:
I am trying to use scanf
(in msvcrt.dll
) to input a single floating point value in flat assembler
, then I write a simple "scanf program" like this (in C
):
#include <stdio.h>
int main() {
float a;
scanf("%f", &a);
printf("Just input: %f", a);
return 0;
}
then using cl.exe
to compile with an option /FA
to create an assembly file like this:
lea eax, DWORD PTR _a$[ebp]
push eax
push OFFSET $SG2935
call _scanf
add esp, 8
; Line 8
cvtss2sd xmm0, DWORD PTR _a$[ebp]
sub esp, 8
movsd QWORD PTR [esp], xmm0
push OFFSET $SG2936
call _printf
add esp, 12 ; 0000000cH
What I missed is the instruction movsd
. Here: http://faydoc.tripod.com/cpu/movsb.htm it Move doubleword at address DS:(E)SI to address ES:(E)DI
but I don't see any settings esi
, edi
there movsd
are two parameters here and in the generated source file, but in the document in the link it shouldn't. Can someone explain to me here?
source to share