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
Another thing - you work with an 8-bit processor. Why do you then use a constant like 0xFFFFFF00 without specifying if it is an unsigned long constant using the ul suffix?