ON 20071207@6:10:01 PM at page: http://www.piclist.com/microchip/math/radix/b2bp-32b10d.htm#39423.7142476852 James Newton[JMN-EFP-786] Published and replied to post 39423.7142476852 by btjlynch |Insert 'See 8 bit to BCD (half packed) and then just seperate out the nibbles by making a copy, then anding one with 0F and the other with F0 followed by a nibble swap.' at: '' btjlynch@gmail.com asks: " How do you convert an 8 bit unsigned binary number into a BCD number ?
Brent" |Delete 'P-' before: '' but after: 'dic_cosmin@yahoo.com " Sa te fut in cur Mike pentru treaba asta: "r=dec"
Translate this for yourself, it is in Romanian language"
  • ' ON 20071222@7:14:41 PM at page: http://www.piclist.com/microchip/math/radix/ah2b-1d4b.htm#39437.2358333333 James Newton[JMN-EFP-786] published post 39437.2358333333 tamas.rudnai@gmail.com asks:
    This one does not care if the A-F is upper or lower case:

    hex2bin ; expects '0'-'9','A'-'F','a'-'f' in W
    btfsc WREG,6 ; not all PICs can do this...
    addlw 9 ; that's A-F (0x4? or 0x6?)
    andlw 0x0F ; we need only the low nibble
    return

    Yes, that's 3 instructions + the return :-)
    Tamas
    |Delete 'P-' before: '' but after: '