Date: Mon, 23 Mar 2009 05:28:17 -0700 On Mon, 23 Mar 2009 05:28:17 -0700, Vitality wrote: > Say you have this code: > > long int temp; > int shift; > > shift = 16; > > temp = 0x00000001 << shift; > > The value stored in temp is 0x00000000, instead of 0x00010000. Here's the > disassembly: > > [snip] Evening Vitality. I don't think that is a bug - you've specified an int literal, which would be 16 bits I'm presuming. Try something like: temp = 0x00000001l << shift; Or perhaps even use a 'ul' suffix. That should prevent the bits falling off the end, presuming of course that longs are more than 16 bits. A decent compiler would probably warn about that sort of thing though, so perhaps that's the real bug :) Regards, Pete Restall -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist