www.piclist.com/techref/microchip/math/index.htm?key=math

Matthew Rhys-Roberts wrote:

> I've been trying to port the PIC16x math library to PIC18x with little

> success. Among other things, it's not obvious to me exactly how to

> modify MATH16.INC to suit the PIC18. Perhaps I should just declare all

> the variables in a CBLOCK, but

>

> I'm avoiding using a C compiler as the rest of my code is in assembly.

>

> All help appreciated!

I converted the 32-bit version to PIC18. I don't think I used all of the

functions, but the ones I used worked well.

In the file are also my INTEGER->BCD conversion functions.

Int24_Flo32 - 24 bit integer to 32 bit floating point conversion

Flo32_Int24 - 32 bit floating point to 24 bit integer conversion

Int32_Flo32 - 32 bit integer to 32 bit floating point conversion

Flo32_Int32 - 32 bit floating point to 32 bit integer conversion

Flo32_Add - 32 bit floating point add

Flo32_Sub - 32 bit floating point subtract

Flo32_Mul - 32 bit floating point multiply

Flo32_Div - 32 bit floating point divide

Bin24_BCD - 24-BIT BINARY TO EIGHT BCD DIGITS (230 cycles)

WordBCD - 16-BIT BINARY TO FIVE BCD DIGITS (65 cycles)

Hope this helps,

Djula

In reply to: <47BD969F.9020907@nu-ins.com>

See also: www.piclist.com/techref/microchip/math/index.htm?key=math