Controlling a GPIO in Assembly

Question: I understand how to put a byte out to a register. How do I control P1(0) without effecting other pins ?

 

Answer:

You will have to mask the other bits of the register. You can do so in assembly by the following instructions:

To set bit 0: or reg[PRT1DR],1

To clear bit 0: and reg[PRT1DR],~1