PIC Microcontoller Math Method

48 by 24 bit division by Andy Lee

Hi

I've made very good use of the code posted on your site so I'd like to give my thanks to the many contributers from whome I have learnt loads and who have save me a lot of time and head-scratching.

By way of thanks, I offer the following adaptation of Tony Nixons 24x24 bit division routine. I have expanded it to perform 48x24 bit division. While a little lardier than Nikolai Golovchenko's routine, it uses big-ended format (my preference) and provides a remainder (unfortunetly at the cost of a bit more ram). Anyway, I hope this may save someone a bit of time, as mine has been. Thanks all.

Code:

Comments:

Lewis Paul Lineberger of Alternate Energies Says:

I've provided a version of this code that fixes an overflow error, illustrated by
0x34631A9FC / 0xDD39E9. Also, the code is provided for PIC12/PIC16 assembly. Thanks so much for the original work! See
http://www.piclist.com/techref/member/LPL-AEA-Z85/index.htm