Baseline PIC MCU Special Instructions

Baseline devices can use the OPTION and TRIS SFRs, which are not memory mapped.

The definition of these registers use a special qualifier, __control, to indicate that the registers are write-only, outside the normal address space and must be accessed using special instructions.

When these SFRs are written in C code, the compiler will use the appropriate instruction to store the value. For example, to set the TRIS register, the following code:

TRIS = 0xFF;

would be encoded by the compiler as:

movlw 0ffh
TRIS

Those Baseline PIC devices which have more than one output port can have __control definitions for objects: TRISA, TRISB and TRISC, which are used in the same manner as described above.

Any register that uses the __control qualifier must be accessed as a full byte. If you need to access bits within the register, copy the register to a temporary variable first, then access that temporary variable as required.