Tony, My copy of PIC16F87xA manual (DS39582A, page 158) indicates that C (and DC for that matter) are not affected by the INCF instruction. Note that because INCF only increments by one, Z can be tested as if it were the carry bit, for the INCF. Only ADD and SUB commands (ADDWF, SUBWF, ADDLW, SUBLW) affect C/DC. Note also that these commands do not USE the value of C/DC for the arithmetic calculation. This requires using bit-test functions when adding multiple-byte values, as in the numerous math routines available on piclist.com. On the other hand, it does not require clearing/setting the C/DC values prior to these functions. I would expect that other PICMicro processors are the similar, but I would check the Instruction Set Summary to be sure. Happy pic'n! --- Tony_K|bek wrote: > Hi, > I haven't read most if this thread so at the moment > I have no > code to post, however I saw this bit from Scott > Dattalo: > > >Here's a solution that saves one instruction: > > > > rlf TMR1L,W ; read the msb of tmr1L > --> Carry > > incf TMR1H,W ;Assume that the low byte > is about to > rollover > > movwf TMR1H_buff > > > > movf TMR1L,W > > movwf TMR1L_buff > > > > skpnc ;If TMR1L on the first > read was < 0x80 > > btfsc TMR1L_buff,7 ;or if the both reads are > between > > decf TMR1H_buff,F ;0x80 and 0xff then leave > the high byte alone > > Wouldn't the "incf TMR1H,W " possibly trash the > carry ? (if TMR1H is > 0xFF) > > > /Tony > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu