Hi list, I have managed to write this code to get the difference between two values in RAM. Pos_24: ;*Move to posistion#24 movlw d'24' ;*240Green movwf TARG_STAT ; save movf PRES_STAT,w ; present location sublw d'24' movwf DEF_STAT ; calculate setps to move goto ExitFunction But can this be done easier becourse repeating this for all 24 stations costs a lot of memory. Harry -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist