OPTION - Setup processor's OPTION register

Language reference ›› Built-in procedures ›› Implied PIC statements ››
Parent Previous Next


Usually PMP does not have special instructions to manipulate registers; to access to the OPTION register the OPTION_REG register should be directly assigned.

Unfortunately, some old and / or small devices do not have OPTION_REG register, but a special instruction OPTION that is a write-only instruction.

The OPTION built-in procedure will automatically map into an OPTION_REG register assignment if such an addressable register exists or into an OPTION instruction otherwise.

As said before, OPTION is write-only: you cannot read back the value, so it should be saved in a global variable if you want to manipulate / mask individual bits.

<expression> is a numeric expression that gives a BYTE range.