On 2010-09-22 15:05, ivp wrote: >>> operations other than 'clrf' on PORTx will/may produce a different >>> result than the same operation on LATx >> >> Sorry, you're confusing me now! How would MOVWF PORTx >> and MOVWF LATx ever end in a different result? > > Bit operations like BCF/BSF to LAT are not the same as to PORT, > because PORT does a read, so there is a possibility of read-modify- > write errors "PORT does a read" ? So does doing BCF/BSF on LATx also. There is no difference in that way. BCF/BSF *always* reads. And it's not only bit operations. There are a lot of instructions that starts with a read of the FSR, AND/OR/XOR -WF, COM/INC/DEC -F are some of them. They all have the same "problem". *Any* operation that begins with a read of the actual FSR has the same "problem". And that is, generaly speaking, all operations whos result depends of the previous value of the FSR. I think that CLRF and MOVWF are the *only* two operations that are not depedning on the old value of the FSR, and are thus "safe" from an R-M-W point of view since they do not read the FSR. Jan-Erik. > > * > * > ********** > Quality PIC programmers > http://www.embedinc.com/products/index.htm --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .