'convert the bin number to packed bcd for RTC write
'enter with temp1 holding the binary byte
'exit with temp1 holding the packed BCD byte
'also ascbfr1,ascbfr0 hold the ASCII value
bin2bcd:
tens = temp1 / 10
units = temp1 Mod 10
ascbfr1 = tens Or 0x30
ascbfr0 = units Or 0x30
tens = ShiftLeft(tens, 4)
temp1 = tens Or units
Return
If you dont want the digits to be ASCII, delete the two lines 0f OR 0x30
'convert the bin number to packed bcd for RTC write
'enter with temp1 holding the binary byte
'exit with temp1 holding the packed BCD byte
'also ascbfr1,ascbfr0 hold the ASCII value
bin2bcd:
tens = temp1 / 10
units = temp1 Mod 10
ascbfr1 = tens Or 0x30
ascbfr0 = units Or 0x30
tens = ShiftLeft(tens, 4)
temp1 = tens Or units
Return
If you dont want the digits to be ASCII, delete the two lines 0f OR 0x30