Re: [Sdcc-user] error sdcc 2.9

2014-10-14 Thread Bodo Wenzel
Hi Ricardo, If you multiply 25586 by 4, you would get 102344... if your calculation is done with "long". But you're using "int", so the intermediate result is cut to 16 bits width, giving 102344 % (1 << 16) = 36808. This results after the division by 5 to 7361. HTH, Bodo

[Sdcc-user] error sdcc 2.9

2014-10-14 Thread Ricardo
Good personal later I'm having a problem in the calculation below, the result is coming out wrong, signed long int xdata Resultado; Resultado = 512; Resultado = Resultado * EEPROM93xx_read( DesenhoCamadas ); // Resultado * 50 = 25600 Resultado = Resultado + ( EEPROM93xx_