This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with 8052 addtion

Hi,
please look into this code
Code:
#include "REG52.h"
#include "intrins.h"

void main()
{ long int data1 = 0xFF000000;
char shift = 0xA0; data1 = _lrol_(data1,8); data1 = data1 & 0xFFFFFF00; data1 = data1 + shift;
}

the value of data1 i expect is 0x000000A0, but when i execute the above code, it shows a value of data1 = 0xFFFFFFA0. I am not understanding why it should add 0xFFFFFF in its previous byte.

I am using Keil IDE-Version: µVision3 V3.60 and C Compiler: C51.Exe V8.12

Can anyone tell me, if something is wrong ?

regards,
Kume

Parents Reply Children
No data