View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Wed Nov 16, 2016 9:32 am Post subject: How to convert hex to decimal in Auto Assembly? (Solved) |
|
|
The example and questions are in the code. Thanks in advance for your time.
Code: |
//*****Divide 60(hex) by 4, and get the result in decimal
push eax
xor eax,eax
mov al,60h
mov bl,4
div bl
//*****Now "al" has the result I want, but it's in hex(18)
//*****how to convert it to decimal(24)? I want to use this number
//*****as an index of a loop.
pop eax
|
Update:
Now, I know I can do this 1*16 + 8 = 24, but how to only get the 1 in 18, which is stored in al?
Last edited by Dr.Disrespect on Wed Nov 16, 2016 9:49 am; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Wed Nov 16, 2016 9:45 am Post subject: |
|
|
ehrm, there is no difference between hex and decimal to assembler code (al isn't 18, it's 11000, ce just shows it as 18 )
the cpu sees both 18 in hexadecimal and 24 in decimal as 11000
_________________
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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Wed Nov 16, 2016 9:48 am Post subject: |
|
|
Dark Byte wrote: | ehrm, there is no difference between hex and decimal to assembler code (al isn't 18, it's 11000, ce just shows it as 18 )
the cpu sees both 18 in hexadecimal and 24 in decimal as 11000 |
Thanks for the reply. Yeah, I made a basic mistake.
_________________
**************
A simple example is better then ten links.  |
|
Back to top |
|
 |
|