Just to clarify a point (and be exceedingly anal). > SUBLW 0x06 ;no just d3-d0 > >does NOT subtract 6 from the W register. > >this really subtracts the W register from 6, not exactly what you wish. Actually, subtraction in the PIC adds the Negative to the number: SUBLW 0x06 Is Actually: w = 6 + (( w ^ 0x0FF ) + 1 ) This leads to all kinds of wild and wonderful things. Before using either subtract in the PIC, write a few of simple programs to experiment with subtract and see what the results are before using them in the program. >the trick i use to get around this one is to add -6 > > ADDLW 0x00-0x06 ; subtract 6 from W Good Trick and one that is more intuitive than using the "SUBLW" instruction. myke "One must invoke enough raw truth to punch a hole in the world" - Darl Af