| View previous topic :: View next topic |
| Author |
Message |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Mon Mar 14, 2011 3:01 am Post subject: adding a value? |
|
|
| Code: | | movss [edi+34],xmm0 |
1) I want to add 5000 to [edi+34]
2) add 5000 to xmm0
how to do that?
tried
| Code: | | add dword ptr [edi+34],(float)5000 // but gives unexpected results.. |
and
comiss [var],xmm0 is not compiling in ce 6.0..
If possible please give me the link to movss,addss,comiss instructions etc..
|
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Mon Mar 14, 2011 8:28 am Post subject: |
|
|
http://en.wikipedia.org/wiki/X86_instruction_listings
Try fld, fadd and fstp.
fld dword ptr [edi+34] //load value into fpu
fadd 5000.0 //add value to accumulator
fstp dword ptr [edi+34] //store value, pop fpu stack, rotate barrel
It's been a few months since I've used CE. Not 100% sure on the syntax atm, but that's the general idea.
For the missing instruction, you can always use a bytecode instead of relying on the assembler.
Cheers,
adude
|
|
| Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5627
|
Posted: Mon Mar 14, 2011 10:00 am Post subject: |
|
|
I am not sure it is possible to use
fadd 5000
I always allocate some space to store the value I need to add like this:
| Code: | alloc(plusamount,4)
plusamount:
dd (float)5000
fld dword ptr [edi+34] //load value into fpu
fadd dword ptr [plusamount] //add value to accumulator
fstp dword ptr [edi+34] //store value, pop fpu stack, rotate barrel |
_________________
|
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Mon Mar 14, 2011 11:38 am Post subject: |
|
|
| and how to add 5000.0 to xmm0?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25831 Location: The netherlands
|
Posted: Tue Mar 15, 2011 1:34 am Post subject: |
|
|
never used it, but I think addss xmm0, [addresswiththefloatvalue5000]
so:
| Code: |
alloc(plusamount,4)
plusamount:
dd (float)5000
...
addss xmm1,[plusamount]
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Tue Mar 15, 2011 11:10 am Post subject: |
|
|
this one will put 5000 to the lower 32bit..
i want to put it like this
| Code: | alloc(plusamount,32) // allocate 128 bits
plusamount:
dd (float)5000 // what should i write in this line
...
addps xmm1,[plusamount] // addps is a 128 bit addition |
|
|
| Back to top |
|
 |
|