943,724 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 7885
  • Assembly RSS
Mar 16th, 2008
0

NEED HELP! (hex to decimal output)

Expand 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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asurmen28 is offline Offline
1 posts
since Mar 2008
Mar 17th, 2008
0

Re: NEED HELP! (hex to decimal output)

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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Dec 3rd, 2008
1

Re: NEED HELP! (hex to decimal output)

Click to Expand / Collapse  Quote originally posted by asurmen28 ...
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.............
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zaigham_zam is offline Offline
1 posts
since Dec 2008
Dec 3rd, 2008
0

Re: NEED HELP! (hex to decimal output)

;try this
Attached Files
File Type: zip dwtoa.zip (1.4 KB, 1139 views)
Reputation Points: 40
Solved Threads: 4
Junior Poster in Training
low_coder is offline Offline
55 posts
since Nov 2008
Dec 3rd, 2008
0

Re: NEED HELP! (hex to decimal output)

;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, 709 views)
Reputation Points: 40
Solved Threads: 4
Junior Poster in Training
low_coder is offline Offline
55 posts
since Nov 2008
Dec 5th, 2008
0

Re: NEED HELP! (hex to decimal output)

Nice solutions guys but the question was posted about 8 months ago.... I hope he's figured out the solution by now.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abello00 is offline Offline
2 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: I need help with matrix color
Next Thread in Assembly Forum Timeline: String Concatenation Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC