Digital Output: LED on P1.0
Configures P1.0 as output through P1DIR and drives the LED with the three bit instructions: BIS sets the bit (LED on), XOR toggles it, BIC clears it (LED off).
What to watch as you step
- A 1 in P1DIR makes the pin an output
- BIS.B sets bits, BIC.B clears them, XOR.B toggles them
- &P1OUT is absolute addressing: the literal address of the port register
- Bit operations leave the other pins of the port untouched