I am having trouble believing the following code is the most efficient way to move a value from the stack to ST(0):
.data
var dd 4.2
tmp dd ?
.code
mov EAX, var
push EAX
; top of stack now contains a value
; move it to ST(0)
pop EAX
mov tmp, EAX
fld tmp
Is the temporary variable really necessary? Further, is there an easier way to get a value from the stack to ST(0)?
Update: In the example above, I'm moving floating-point values around - not integers.