dave.w.turner@gmail.com wrote: > Oh, and also, if you are storing currently recieved bits in W, make > sure you don't use W for anything else which might clear it before you > put it in memory - some instructions use W without telling you, I > think. Uhhh, WHICH instructions would that be? And it's pretty hard to move -any- data on the PIC without going through W. The one notable instruction that has 'funny' behaviour is CLRW. As coded, it reads whatever INDF is pointing to, and if that happens to be PORTB your int-on-change gets messed up. (Ask me how I know about this little GOTACH!) And speaking of opcodes, has anyone found any useful 'hidden' op codes? e.g. NOP is listed as 00 0000 0xx0 0000 for 16 series parts. If you look at the bit pattern you see that it looks like a movwf, with W as the destination (movww) and 0 for file register. The ICE2k uses 61 as 'breakpoint' 00 0000 0110 0001 For comparison CLRWDT 00 0000 0110 0100 SLEEP 00 0000 0110 0011 so there are sure to be other functional opcodes in 006x block, not that they're useful. The Z80 had quite a number of 'hidden' opcodes that did useful things, although there was no guarantee that those codes would work on different revisions. Just something to tinker with... Robert -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist