Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sun Jan 01, 2012 7:05 pm Post subject: |
|
|
With CVTSI2SD (if you mean integer).
Eg.
CVTSI2SD xmm0,[ebx+00000458]
will convert the value on [ebx+00000458] to double and save it on xmm0.
It is up to you to save and restore xmm0 before you use it. Eg.
globalalloc(tempstore,8)
globalalloc(tempstore2,8)
newmem: //this is allocated memory, you have read,write,execute access
movss [tempstore],xmm0 //save original value of xmm0
CVTSI2SD xmm0,[ebx+00000458] //convert value
movsd [tempstore2],xmm0 //save the converted double value
movss xmm0,[tempstore] //restore xmm0
Maybe you have to use movsd to save/restore xmm0 but maybe it is not even used at the point where you use it so it depends on the process.
originalcode:
sub [ebx+00000458],eax
But if you just want to define a static value as double, then
tempstore2:
(double) 100
_________________
|
|