In PICs such as the 16F84 and the 16F877A, the BSF instruction is executed like all 8 bit instructions:-
1) Collect 8 bit word from memory into ALU
2) perform operation in ALU
3) Store 8 bit word from ALU back into memory
The internal architecture on the PIC has to be able to do those operations so that it can perform all the usual instructions like add, rotate, xor etc etc. Microchip have used the same addressing structures to do BSF. The only alternative would have been to build register addressing that was able to write to an individual bit rather than a whole byte, which would have made the whole addressing system far more complicated.
So the BSF instruction does this:-
1) Collect 8 bit work from memory into ALU
2) Set just one of the bits and leave all the other bits unchanged
3) Store 8 bit word from ALU back into memory
That's fine for registers, but when the bit is in PORTA, the same thing happens. All the bits that are not supposed to change are read, and then written back to PORTA. If something stops them being read correctly, they will be overwritten with an incorrect value.
Two things can stop them being read correctly. One is that the pins are configured as analogue or comparator inputs, which disables the digital reading. The other thing is that the voltage on the pin has not had enough time to get to the correct value.
Where you have got:-
Code:
movlw b'00000011' ;RA0 & RA1 high
movwf PORTA
bsf PORTA,2 ;RA2 high
the movwf line will write to PORTA at the end of the second instruction. Very shortly after that, at the beginning of the third instruction, PORTA voltages are read. If the voltages on PORTA, 0 and PORTA, 1 have not got high enough in that very short time interval, then the BSF instruction will read them as low, so the pins will drive low as soon as the BSF instruction finishes.