typedef signed long int S32;S32 b;S32 x1;S32 x2;...... b = x2 - x1;
As a result only lower 16 bits are present in b variable. Higher 16 bits are lost somewhere. I am observing it under CodeWarrior debugger (HiWave). Why?
It should be fine.
It is not clear what is storage class of b,x1 and x2. It is not clear what CW product version you are using? CW 4.6? Which compiler, C++ for XGATE?
Did you try disassembling C code? Does it look right? Could you show disassembled code for b = x2 - x1? (Use search to find commented C source line in disassembled code).
Retrieving data ...