Mosaic
Well-Known Member
Hi :
Observe this calc:
1234/100 = 12.34
A 16bit divide by 8 bit magnitude giving results in decimal is desired.
I can use the stock 16bit/8bit divisor code from the pic list to get the 8 bit integer quotient.
Then multiply the 8bit remainder by 10 to get another 16 bit number (Mult8X8 asm code).
Do another 16bit/8bit divisor .....to get the first decimal. Repeat for the 2nd etc.
Jolly, but, is there a more elegant way of doing this in fewer mcu cycles?
Observe this calc:
1234/100 = 12.34
A 16bit divide by 8 bit magnitude giving results in decimal is desired.
I can use the stock 16bit/8bit divisor code from the pic list to get the 8 bit integer quotient.
Then multiply the 8bit remainder by 10 to get another 16 bit number (Mult8X8 asm code).
Do another 16bit/8bit divisor .....to get the first decimal. Repeat for the 2nd etc.
Jolly, but, is there a more elegant way of doing this in fewer mcu cycles?