Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to convert hex to decimal in Auto Assembly? (Solved)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Wed Nov 16, 2016 9:32 am    Post subject: How to convert hex to decimal in Auto Assembly? (Solved) Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25804
Location: The netherlands

PostPosted: Wed Nov 16, 2016 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Wed Nov 16, 2016 9:48 am    Post subject: Reply with quote

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. Sad

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites