Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

8086, hex to decimal program

Hi im trying to make a program to the following specifications:

0) initialise a temporary numerical value to 00H, base value to 10H and count value to 00H
1) Read in a character
2) Apply series of checks against


  • fangxifangxi Posts: 13Member
    for decimal to hex you can just divide your number by 16 until it is 0, the remainder is the value of hex
    ex: our decimal is 32
    32/16 = 2 R 0
    2/ 16 = 0 R 2
    0/16 = 0 R 0

    your hex is 020
    the general format is base * digit ^ n-1 (n is the the position ones digits= 1 , tens digit = 2...etc)

    which you can use to check your conversion

Sign In or Register to comment.