Shift right is one way.

Code:
DEC_Out Var Byte
BCD_In Var Byte


DEC_Out=(BCD_In>>4*10)+(BCD_In & %00001111)
This should in theory take the 4 Highbits and shift them right 4 times. Then multiply this result with 10 and add the 4 low bits putting the result in DEC_Out.


To do the DEC to BCD you can use the DIG command it is really good for this.