PICkit™ 3 Starter Kit User’s Guide
DS41628B-page 42 2012 Microchip Technology Inc.
3.2.5 New Instructions
All of the instructions for the enhanced mid-range or PIC18 can be studied in detail in
the “Instruction Set Summary” chapter in each corresponding PIC
®
microcontroller
data sheet. This document will briefly explain the importance of each.
3.2.5.1 BOTH
3.2.5.2 bsf
Set a bit in register.
EXAMPLE 3-1:
3.2.5.3 bcf
Clear a bit in register.
EXAMPLE 3-2:
3.2.5.4 clrf
This clears an entire register. It is useful during initialization to turn off all attached
peripherals such as LEDs.
EXAMPLE 3-3:
TABLE 3-3: NEW INSTRUCTIONS FOR BOTH DEVICES
Instruction English Purpose
bsf Bit Set Make the bit a ‘1’ (5V)
bcf Bit Clear Make the bit a ‘0’ (0V)
clrf Clear File Register Force the register to all 0’s
bsf LATC, 0
Before Instruction:
RC0 = 0
After Instruction:
RC0 = 1
bcf LATC, 0
Before Instruction:
RC0 = 1
After Instruction:
RC0 = 0
clrf LATC
Before Instruction:
LATC = b’11011000’
After Instruction:
LATC = b’00000000’