> 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 > = > eg > = > MOVF PORTB,W > MOVWF SHADOWB > MOVLW B'100' > IORWF SHADOWB,W > MOVWF PORTB > = One thing to watch out for here is interrupts. If you write to another pin = in = port B in the interrupt routine, a bit banged serial output for example, yo= u = have to make sure that the interrupt routine isn't executed between when yo= u = read the content of the port to the shadow register until you write it back= . = Otherwise the change made by the interrupt routine will be undone when you = write back the shadow register. One way to solve this is to never read the the value from the port to the = shadow register but keep the shadow register as a global variable and only = manipulate it with atomic operations (single instructions that can't be = interrupted or where an ongoing change in non interrupt code can't be undon= e by = interrupt code or vice versa) like IORWF, BSF, BCF and so on. Then just wri= te = the entire shadow register to the port when you have changed it. This would = have the same effect as using the LAT registers in higher end pics. Note that using the LAT register handles classic rmw issues with ouput port = pins but it doesn't automatically solve problems where main code and interr= upt = code uses the same port (or any register) unless changing of individual bit= s is = done with care (changed in what I call atomic, uninterruptable steps). Another way to put it is that interrupt routines can introduce rmw problems = where you normally wouldn't see it (or think about it). And this goes for a= ny = shared register, not just IO ports. /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist