COMMANDS CLRF AND CLRW

Coming back to Listing 2, command CLRF stands for CLeaR File and is always followed by a single number or name which indicates the file on which the action is to be performed. The command instructs the PICmicro that all bits within the stated file are to be cleared, i.e. it clears the whole byte.

The allied command CLRW (CLeaR Working register) simply clears the contents of the working register and is used on its own without a subsequent number or name. In practice, this command may be seldom used, the commands MOVLW 0 and RETLW 0 probably finding preference (these commands are discussed in Tutorials 4 and 16, respectively). Command CLRW has, in fact, been dropped from the PICmicro 17xx series of microcontrollers.

There are no direct opposites of CLRF and CLRW which will set all bits high; other techniques have to be used for this action.

Using names for files instead of numbers will be dealt with in Tutorial 3.

Now use the contents tree to navigate to Tutorial 2.6.