The PIC16F’s instruction set provides (individual) bit mapped access to I/O ports, so the code in post #1 could reach the same result, but I fully agree with you that in order to turn the whole code portable to other cores without this feature, if the sacrifice of some cycles is not any issue, I would prefer your suggestion.