| View previous topic :: View next topic |
| Author |
Message |
Xblade Of Heaven Master Cheater
Reputation: 0
Joined: 16 Oct 2005 Posts: 395 Location: DEAD
|
Posted: Thu Oct 13, 2016 12:17 pm Post subject: small dude using instructions |
|
|
Hi all guys, to see if anyone can help
i have a problem using 2 instrucions.
For example i ca use this
| Code: | fild dword ptr [eax+44]//load a integer value
fstp dword ptr [eax+40]//store a float value |
is corret, but now i try this:
| Code: | fild dword ptr [eax+44]//load a integer value
fistp dword ptr [eax+40]//store a integer value |
and in this second case the loaded value change to a wrong value, anyone can explain me why? thanks! _________________
Welcome to the Hell.
 |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4711
|
Posted: Thu Oct 13, 2016 12:23 pm Post subject: |
|
|
Could you be more specific and say what the values are? _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Xblade Of Heaven Master Cheater
Reputation: 0
Joined: 16 Oct 2005 Posts: 395 Location: DEAD
|
Posted: Thu Oct 13, 2016 12:33 pm Post subject: |
|
|
yep
are the hp values, max and current values
100 in 4bytes
eax+44 store max hp 100 and eax+40 is current HP _________________
Welcome to the Hell.
 |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4711
|
Posted: Thu Oct 13, 2016 12:40 pm Post subject: |
|
|
Works perfectly fine for me. fild converts the 4-byte value to extended and loads it onto the FPU stack, and fistp converts the extended value back to 4-byte, stores it at that address, and pops the FPU stack.
By asking that question, I meant more so what value fistp was storing and what value you intended for it to store. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Xblade Of Heaven Master Cheater
Reputation: 0
Joined: 16 Oct 2005 Posts: 395 Location: DEAD
|
Posted: Thu Oct 13, 2016 1:14 pm Post subject: |
|
|
yeah, is working fine... is my fault wrong instruction position...
thanks man, regards _________________
Welcome to the Hell.
 |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Oct 13, 2016 1:18 pm Post subject: |
|
|
| Code: | | fild dword ptr [eax+44] | Loads integer 100 (hex 00000064) as float 100 (hex 42C80000) to FPU stack.
| Code: | | fstp dword ptr [eax+40] | Pops float 100 (hex 42C80000) as float 100 (hex 42C80000) from FPU stack.
| Code: | | fistp dword ptr [eax+40] | Pops float 100 (hex 42C80000) as integer 100 (hex 00000064) from FPU stack. |
|
| Back to top |
|
 |
Xblade Of Heaven Master Cheater
Reputation: 0
Joined: 16 Oct 2005 Posts: 395 Location: DEAD
|
Posted: Thu Oct 13, 2016 2:29 pm Post subject: |
|
|
thanks  _________________
Welcome to the Hell.
 |
|
| Back to top |
|
 |
|