DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   NEED HELP! (hex to decimal output) (http://www.daniweb.com/forums/thread114214.html)

asurmen28 Mar 16th, 2008 1:25 pm
NEED HELP! (hex to decimal output)
 
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?

Narue Mar 17th, 2008 10:03 am
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.

zaigham_zam Dec 3rd, 2008 9:00 am
Re: NEED HELP! (hex to decimal output)
 
Quote:

Originally Posted by asurmen28 (Post 562314)
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.............

low_coder Dec 3rd, 2008 12:53 pm
Re: NEED HELP! (hex to decimal output)
 
1 Attachment(s)
;try this

low_coder Dec 3rd, 2008 1:06 pm
Re: NEED HELP! (hex to decimal output)
 
1 Attachment(s)
;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

abello00 Dec 5th, 2008 1:53 pm
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.


All times are GMT -4. The time now is 9:40 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC