> Yes, the code is not complete. There is a series of > instructions to be run if the bit is set in the a/d reading. > and these instructions are the ones the program outputted. > This removes the tedium and error proness of doing each > calculation and writing the code by hand. > > It is early and no coffee yet, This post is short. > > Bill > > ; for bit 9 100 > test9 bftss adhigh;1 ***** inserted by jand > goto test8 ***** > > movlw D'1' > addwf CVD0,F > > for bit 8 50 > > test8 bftss adhigh;0 **** > goto test7 ***** > > Bill > Ahh... Excellent, thank you. So in your BASIC program, something like the following could be added after the PRINT "; for bit" line... if bit>8 then ad="adhigh;" & cstr(bit-8) else ad="adlow;" & cstr(bit) PRINT "test" & CSTR(bit) &" bftss" & vbTab & ad PRINT vbTab & "goto test" & cstr(bit-1) Now, there is also some "fix up" code at the end that corrects for registers that may have accumulated more than 10? May I impose on you to also share that code? --- James Newton: PICList webmaster/Admin mailto:jamesnewton@piclist.com 1-619-652-0593 phone http://www.piclist.com/member/JMN-EFP-786 PIC/PICList FAQ: http://www.piclist.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist