NEED HELP! (hex to decimal output)

Reply

Join Date: Mar 2008
Posts: 1
Reputation: asurmen28 is an unknown quantity at this point 
Solved Threads: 0
asurmen28 asurmen28 is offline Offline
Newbie Poster

NEED HELP! (hex to decimal output)

 
0
  #1
Mar 16th, 2008
guys! i realy need your help! i have this big problem of how to convert hex to decmal. theoreticaly it is very easy but the problem is that in assembly, everything is done in hex example if u add 10d+10d, assembly will add it as Ah+Ah = 14h. thats where the problem comes in! how do i display 20 and not 14h?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,625
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 714
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: NEED HELP! (hex to decimal output)

 
0
  #2
Mar 17th, 2008
Do you know how to convert a hexadecimal value to decimal on paper? That's the first step, then you can convert the paper algorithm into something better suited for assembly.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1
Reputation: zaigham_zam is an unknown quantity at this point 
Solved Threads: 0
zaigham_zam zaigham_zam is offline Offline
Newbie Poster

Re: NEED HELP! (hex to decimal output)

 
1
  #3
Dec 3rd, 2008
Originally Posted by asurmen28 View Post
guys! i realy need your help! i have this big problem of how to convert hex to decmal. theoreticaly it is very easy but the problem is that in assembly, everything is done in hex example if u add 10d+10d, assembly will add it as Ah+Ah = 14h. thats where the problem comes in! how do i display 20 and not 14h?
If you get value in some register let ax ,divide it by mov bx,0xa
divide ax by bx the remainder will be in dx,take this and store at last index of memeory that you will use,and loop will run 4 time or till that ax becomes zero finally result will be in memory.
Try this it.s so easy.............
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 23
Reputation: low_coder is an unknown quantity at this point 
Solved Threads: 2
low_coder low_coder is offline Offline
Newbie Poster

Re: NEED HELP! (hex to decimal output)

 
0
  #4
Dec 3rd, 2008
;try this
Attached Files
File Type: zip dwtoa.zip (1.4 KB, 80 views)
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 23
Reputation: low_coder is an unknown quantity at this point 
Solved Threads: 2
low_coder low_coder is offline Offline
Newbie Poster

Re: NEED HELP! (hex to decimal output)

 
0
  #5
Dec 3rd, 2008
;try this one too - it takes two numbers in ascii, converts them to hex ;and adds them together, then it converts the result to ascii and ;displays it in MessageBox
Attached Files
File Type: zip atodw_dwtoa.zip (1.6 KB, 56 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 2
Reputation: abello00 is an unknown quantity at this point 
Solved Threads: 0
abello00 abello00 is offline Offline
Newbie Poster

Re: NEED HELP! (hex to decimal output)

 
0
  #6
Dec 5th, 2008
Nice solutions guys but the question was posted about 8 months ago.... I hope he's figured out the solution by now.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC