WH Tan wrote: > I read from datasheet regarding OV flag. > > "This bit is used for signed arithmetic. It indicates an overflow > of the 7-bit magnitude, which causes the sign bit to change." > > Is that mean whenever the MSB toggled (not include the result from > bsf & bcf), this flag will be set? No. The Overflow flag indicates that the result is too large to fit in 8 bits; it should be set whenever: 1. There was an internal carry generated between bit 6 and bit 7 of the result, but NO carry was generated out of bit 7 of the result. OR 2. There was NO internal carry generated between bit 6 and bit 7 of the result, but there WAS a carry generated out of bit 7. -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads