Page 1 of 1

errors for enhanced series

Posted: 05 Feb 2018 16:16
by janni
I've just learned that an upgrade is coming in few days, so it's a bit late, but some of the errors I found lately should be easy to fix.

- signed 8-bit multiplication routine (Mul_8x8_S) produces errors that are, in addition, dependent on order of operands:
-128*-1=-128, -1*-128=0
1*-128=0, while -128*1=-128
(same for PIC16 processors),

- copy procedure, __CA2A from System lib, is called instead of __CA2AW though registers are prepared for the latter - it will lead to memory overwrite when blocks of data bigger than 255 bytes are handled,

- compiler assumes that all routines in Math and MathDouble libs end with Bank0 (apparently a quick & dirty solution was applied to free R14 register - it was replaced by variable tempb in Div_32x32_U and Div_32x32_S and by tempbD in MathDouble libs). In conjunction with another quick fix (to division by zero error) some math routines (Div_8x8_U, Div_16x16_S and Div_32x32_S) may end up with banks above 0, though, if divisor is zero and dividend is in higher bank. This, obviously, may lead to uncontrolled user program behaviour.

There are other errors in math libraries for all PIC processors, but those are known for years so I won't list them here.

Re: errors for enhanced series

Posted: 07 Feb 2018 11:54
by filip
Hi,

Thanks for the report.

We are now on a tight schedule with PIC compiler release, but I'm sure this will be seriously taken into account with the next one.

Regards,
Filip.