Ahhh, If anyone reads my last post, thanks but I solved the problem of Simu input to pins inn MPLAB-SIM. Next problem though has got me. decfsz count_ts ; decrease counter if not zero ; addlw .0 ; put 0 in w reg xorlw count_ts ; is counter at 0 btfsc status,Z bcf flag,0 ; yes so set flag,0 to 0 ; As you van see, I'm decreasing a counter on a program loop. When the counter reaches 0, I want to set the flag,0 bit to 0. Thing is the xorlw or the btfsc is not picking up the 0 in count_ts. Earlier in the program a similar slice of code works to detect a value greater than 0 in the file count_ts. So the problem has got to be xoring the two 0's and then checking the Z status, hasn't it ? If so, how do I check for the 0 state in the file. TIA. -- Philip Martin ---------------------------------------------------------------- Royal Quays If at first you don't succeed, try again. Then quit: North Shields. no use being a damn fool about it ! W.C. Fields email philip@philmart.demon.co.uk