-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jinx wrote: >> So the following is safe and will never introduce a transient? >> >> MOVLW B'100' >> IORWF PORTB,F > > I have a feeling that operations like IOR/AND/ADD/XOR etc would > read the register first, leading to a possible r-m-w > > 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. An operation that definitively sets the value of every single bit (e.g. movwf) is the *only* completely safe way to deal with RMW. 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 iEYEARECAAYFAkkOqvsACgkQiD2svb/jCb6ixgCfWWtfTwAiKS1dh2M573SUbv20 VQ0AnRoDqr6tEBt1SCV9DoZ5jF8z+KXl =CpLH -----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