From code generated from http://www.piclist.com/techref/piclist/codegen/constdivmul.htm I've got a piece of code that uses the following sequence: movlw 0x01 xorwf STATUS, f ;complement carry This works fine under the MPLAB simulator for a PIC16F871. However when I run that routine on chip, the carry isn't flipped. I observed this non-flippin' behavior using the Microchip ICD. As always with all things PIC, I'm assuming I'm missing something. The datasheet for the 871, however, says the XORWF instruction doesn't touch the C flag, so I don't see why the bit isn't set (or cleared as the case may be, in my case I was expecting to see it get set). I've coded around this by using bit test and bit set/clear instructions, so I can get on with the project, but if anyone has any insight on this I'd appreciate it. Thanks, Kevin -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads