Page 1 of 1

how to multiply an address's value?

Posted: Fri May 11, 2018 11:57 am
by reverser69
hey guys



this is the code fetching player speed





fld dword ptr [esp+04]

fstp dword ptr [ecx+0C]



how can i multiply [esp+04] or [ecx+0C] by value for ex:6 ?

how to multiply an address's value?

Posted: Fri May 11, 2018 12:01 pm
by SunBeam
[code=CEA]

label( myFloat )



code:

fld [esp+4] // load [esp+4] into st0 = a

fld [myFloat] // load [myFloat] into st1 = b

fmul st0,st1 // a*b stored in st0

fstp [esp+C] // store result in [esp+C]



myFloat:

dd (float)6.0

[/code]





Also see this: [URL]https://en.wikibooks.org/wiki/X86_Assembly/Floating_Point[/URL]