Bob Ammerman wrote: >> long int temp; >> int shift; >> >> shift = 16; >> >> temp = 0x00000001 << shift; >> >> The value stored in temp is 0x00000000, instead of 0x00010000. Here's the >> disassembly: > > No bug at all. The value 0x00000001 is an "int", not a "long". You'd avoid > your error with 0x00000001L D'oh! :-S Thanks, of course it fixed the problem. I completely forgot about the L on the end, I'm guessing because in the same code right-shifting a 32-bit value worked just fine. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist