#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2006
    Posts
    1
    Rep Power
    0

    Converting hex to decimal in 8051 assembly code


    Hi,

    It would be great if someone could explain to me how to convert hex to decimal (0-99). I know i need to use the mnemonic "DA A", but hiw dun really know how it works. Can some please help thanx.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    1
    Rep Power
    0
    Originally Posted by kashyap
    Hi,

    It would be great if someone could explain to me how to convert hex to decimal (0-99). I know i need to use the mnemonic "DA A", but hiw dun really know how it works. Can some please help thanx.
    DA A instruction is only for conversion to BCD. For decimal number you take first character (MSD) convert to value 0 - 15 (char 0-F), multiply by 16 and then add second character (LSD) value 0 - 15 (char 0-F).

IMN logo majestic logo threadwatch logo seochat tools logo