PIC Microcontroller Radix Math Method

BCD packed to binary 2 digit to 8 bit

From: Scott Dattalo

         rrf   bcd, W 
        andlw 01111000b  ;W = tens*8 
        movwf temp 
        clrc 
        rrf   temp, F    ;temp = tens*4 
        rrf   temp, F    ;temp = tens*2 
        subwf bcd, W     ;W = tens*16 + ones - tens*8 
                         ;W = tens*8 + ones 
        addwf temp, W    ;W = tens*10 + ones