Hello experts, to avoid a division, I use integer arithmetics. The unsigned int x which is in the range of 2000 is first multiplied by a number s which is 2048 plus/minus 1000 and then shifted by 11 digits which should replace a division by 2048.
unsigned int near x; unsigned int s x = ( (unsigned long) x * (unsigned long) s ) >> 11 ;
Brad, you are 100% right!
Meanwhile, back at the ranch, did Guenter ever get his integer math to work?
yes, now finally it works. The compiler worked correctly, and the type casting does what I expected, but... one of the variables was at an address where there was no physical memory. After that became clear, the solution was easy. Thanks to everyone for your comments on my problem.