Szymon Mroczek

S12XEP signed 32 substraction issue

Discussion created by Szymon Mroczek on Jul 11, 2011
Latest reply on Jul 11, 2011 by kef
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?

Outcomes