| View previous topic :: View next topic |
| Author |
Message |
Gestalt Newbie cheater
Reputation: 0
Joined: 08 Sep 2011 Posts: 21
|
Posted: Wed Sep 28, 2011 1:04 pm Post subject: Auto Assambler Multiply value |
|
|
Hi, As the title say, how do you multiply a Value in auto assembler.
an example: add [esi+00000778],ebx
In the above example I would like to multiply and add value with say 10. So I want to get 10 times more that what i get with the above example.
Thank you!
|
|
| Back to top |
|
 |
haunted5 Cheater
Reputation: 1
Joined: 23 Aug 2011 Posts: 35
|
Posted: Wed Sep 28, 2011 6:39 pm Post subject: |
|
|
Hi,
I'm not sure which instruction is best but i normally use 'imul' for 4byte values
An Example:
push eax
mov eax,10
imul ebx,eax
pop eax
Last edited by haunted5 on Wed Sep 28, 2011 7:54 pm; edited 1 time in total |
|
| Back to top |
|
 |
Gestalt Newbie cheater
Reputation: 0
Joined: 08 Sep 2011 Posts: 21
|
Posted: Wed Sep 28, 2011 7:26 pm Post subject: |
|
|
Thank you, You really helped me there. I have thought on this simple task for some time now. It appeared I gotten it all wrong, I wrote [edx],10 all the time, no wonder my programs crashed.
I wonder if this will work with float data types as well. In my case it was needed for 4 byte. I will come back if I ever try this on float data type.
|
|
| Back to top |
|
 |
haunted5 Cheater
Reputation: 1
Joined: 23 Aug 2011 Posts: 35
|
Posted: Wed Sep 28, 2011 7:53 pm Post subject: |
|
|
Nice to know you got it workin,
For Floats you would have to load the value to be multiplied and the multiplier onto the stack and use fmul to multiply them. Look up its usage on the net and make sure you pop any extra values you put onto the stack.
|
|
| Back to top |
|
 |
|