-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jan-Erik Soderholm wrote: [snip] >>>> You should be safe with BSF and MOVWF though. Particularly if the >>>> port contents are read into a buffer or shadow register, modified, and >>>> then written back with MOVWF > With respect to read-modify-write, BSF is not safe. BSF/BCF operate by > reading the port, altering the relevant bit, and writing the port. > >> But what Jinx talked about was to execute the BSF/BCF against >> *another* register, not the PORTx register. And in that case it's >> "safe", of course. And "IORWF PORTx,F" isn't better than BSF/BCF >> in this regard. Whoops, looks like I took the wrong one of the two possible meanings of Jinx's post: I took it to mean "You should be safe with BSF, and you should be safe with MOVWF" (not true) when what was actually meant was "You should be safe with BSF to a shadow **followed by** MOVWF to the port" (true). But your other points still stand, though: you do NOT want to "read [the port] into a buffer... modif[y] it, and then [write] it back"; rather, you want to NOT do the first of those operations - you only ever want to modify the shadow and copy it to the port. If you ever read the port into the shadow, you've just spaced out the problem, not solved it. Chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: GnuPT 2.7.2 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkPuaYACgkQiD2svb/jCb6UvgCgpeUEBY8bz3PDxEvzNexp9IGx HD0Ani/S7O0XV8EFx8GGA64bV/kg0IGM =mJfi -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist