How about: movf rmax,W xorwf r1,F skpz .set flag... xorwf r1,F Xor a register twice with same W and, voila, the original data is back. I don't see any reason to xor though... Why not just: movf rmax,w subwf r1,W skpnz ??? ---------- > From: Philip Martin > To: PICLIST@MITVMA.MIT.EDU > Subject: MPLAB & XORing > Date: Monday, December 22, 1997 5:25 PM > > 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). > > Is this the best way of preserving the data in r1, or is there a better > way? > > 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