converting hexadecimal to decimal in Oshonsoft

Status
Not open for further replies.
how do i do it ?

Its this subr from snippets

'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
 
thanks .....

also , watch my new video

https://www.electro-tech-online.com/threads/4017-running-led.112715/#post921693
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…