Jeff D. Pipkins wrote: >I'd much prefer writing "TRISA & 0x7F" instead [of TRISA ^ 0x80]. >This clears the problem bit, instead of assuming it's set to 1 and >flipping it. I realize that the end result is the same, but Mike's >goal was to develop _good_habits_ for writing better code. > .... >(Not teaching anymore, but not altogether successful in kicking the >soapbox habit, either...) Jeff: Perhaps you should try harder; XORing the hi-bit is a MUCH better way. Here's why: If you mistakenly apply my XOR to a register on page 0 (very easy to do on the larger PICs, whose registers are scattered over both pages), the assembler will warn you of the error, since the XOR sets the high bit instead of clearing it. This warning is important, because your code will also have switched the RP0 bit to page 1. Using your method, there's no way for the assembler to tell you that you've made this mistake. -Andy -- Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California