The datasheet doesn't say anything about adding "bits.x" to the end of a register name in order to access the bits.
I know, but the generally it follows the datasheet name.
If you see a register named
ANSELA in the datasheet, it'll be called that way in xc8, and the bitfields will be
ANSELAbits.
This was exactly the issue you were having, not checking the registers and bit names in the datasheet, you would have found the differences in OPTION/OPTION_REG and RBPU/WPUEN.
You won't find a compiler guide for every PIC out there!
Maybe you should check
Microchip Online docs, specially
MPLABX and
XC8 user guides!
Also check
Program Files/Microchip/xc8/vx.xx/docs/.
The standard way is to check the header files, as stated in the
Device-specific features:
How Do I Access SFRs?How Do I Find The Names Used To Represent SFRs And Bits?.
You can quickly have a peek by writing i.e.
OPTION_REGbits, then right click, Navigate / Go to declaration/Definition.
And remember to make use of code autocompletion, makes life so much easier.
Example 1: Write
OPTION and do Ctrl+Space, anything starting with that will appear (
OPTION_REG,
OPTION_REGbits).
Example 2: Write
OPTION_REGbits. (Don't forget the dot), again Ctrl+Space, a list of the reg bits will appear, select the one you're searching for.
In this case
RBPU bit is called
nRBPU (n for negated).