On Tue, 23 Dec 1997 00:25:09 +0000 Philip Martin writes: >Taa for the replies to the MPLAB question. I also RTFM and found the >way >to alter the INTCON bit to force the interrupt. > >Next, Ohhh what a night: > >Take this snipet- > movf rmax,w ; load w with max time count > xorwf r1,f > btfsc _z ; has the max time been reached > >What I want to do is compare the value in rmax (value increasing each >interrupt) with a fixed value in r1, read in at the beginning of the >program from some BCD switches. > >What I've realised is that the result of the XOR is then placed in r1, >overwriting the original data. My thinking now is to first transfer >the >data from r1 to w and on to a temporary register and then test the >match. This would however mean doing this every pass (and in quite a >few >locations). How about just setting the destination of the XOR to w instead of file? this destroys w, but leaves your memory fine. > movf rmax,w ; load w with max time count > xorwf r1,0 ; Set Z if equal, destroys W, maintains r1 > btfsc _z ; has the max time been reached > Harold