On Jan 1, 2006, at 3:26 PM, Herbert Graf wrote: >> Try enabling "Integer Promotions" in the C18 >> preferences and see if that helps. > > BINGO! Good. If this is an ip checksum routing, you were missing the code that does the end-around carry folding in between the loop at the complement... Also, while this is a sort of standard unix ip checksum algorithm, it's a REALLY BAD algorithm to use on a CPU that doesn't natively support 32bit integers. It dates back to vaxen and 68000s, and is not good for PICs... (alas, C is not so good for implementing the IP checksum algorithm, because it doesn't give you access to the 'extra' carry bit..) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist