'Op code Help'
I am working on some code that uses PortB interrupt on change feature.
I know that
bit test are dangerous because of the read-modify-write sequence. A few
weeks ago, I remember seeing a list of instructions that did not use
read-modify-write. Now I cannot locate the list in the data books.
Target device is 16C621.
Question 1: Can anyone point we to the list?
Question 2: Does the plain vanilla move instruction do a
Question 3: What about movf portB,w ; retrieve a copy of PortB to W
movwf temp ; save the copy in temp
btfss temp,7 ; test if Bit 7 of Port B is set
Will this keep PortB from getting screwed up?
Thanks for your help.
Miller, Steve <MITVMA.MIT.EDU> wrote: PICLIST
> I am working on some code that uses PortB interrupt on change
> feature. I know that bit test are dangerous because of the
> read-modify-write sequence.
> What about:
> movf portB,w ; retrieve a copy of PortB to W
> movwf temp ; save the copy in temp
> btfss temp,7 ; test if Bit 7 of Port B is set
> Will this keep PortB from getting screwed up?
No, it won't... The problem isn't with modifying or writing the port;
it's with READING the port. Any instruction that reads port B (which
means "any instruction that accesses port B", since every "write"
instruction does a read first) can potentially make you miss
=== Andrew Warren - ix.netcom.comfastfwd
=== Fast Forward Engineering - Vista, California
=== Custodian of the PICLIST Fund -- For more info, see:
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...