> The behavior would imply a problem with the bank select command. If it > were not correctly switching to bank 1, then the clrf VRCON would be > clearing the value moved into CMCON in the first example. Have you > followed this code through on the simulator? It's usually a pretty good > way to check this sort of problem. Hmm, that's a possibility. Microchip did have a bug in an early version of the PAGESEL directive, so why not BANKSEL? You might also want to check out my DBANKIF and related macros in STD.INS.ASPIC at http://www.embedinc.com/pic. This is used to set the bank, but is more efficient. Assembler state is used to track the current bank and only those bank switching instructions that are necessary (perhaps none) are emitted. Another nice feature is that you pass the address of whatever it is you want to access. That eliminates mistakes in hard coding the bank and increases portability. For example: dbankif cmcon ;set banks for access to CMCON, wherever it is movlw b'00000111' ;get value to disalbe the comparators movwf cmcon ;stuff it ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads