I am trying to write a bcd down counter. If i have a hex value of 0x81 and then decrement the file with 'decf file,f' the new value will be 0x80, if i dec again i will get 0x7f. I thought that the dc flag would be set when going from 0x80 to 0x7f. It doe's'nt appear to in mpasm using a pic18c84. Is'nt the dc flag a carry/borrow. whis is set when going up from 0x0f-0x10 and down from 0x80-0x7f. The data sheets say the the dc flag is effected by 'decf file' inst. part of my code is BCDDEC DECF DISPD1,F BTFSS STATUS,DC ;see if d3-d0 = 0x0f RETURN ;not yet so return MOVF DISPD1,W ;put count into w BTFSC STATUS,C ;see if d7-d4 gone from 0x00-0xf0 GOTO BCDDEC1 ;yep so go bcddec1 SUBLW 0x06 ;no just d3-d0 MOVWF DISPD1 ;sub 0x06 to return to 0x09 RETURN ;return Am i wrong in my assumption, the dc flag works for a bcd up counter , , , Kenny baby , , , , The Samaratans........They bring a smile to an empty heart.