Detailed reference for the BC instruction in PIC18 ISA.
BC – Branch if Carry. This instruction evaluates the Carry flag (C). If it is set, the Program Counter (PC) advances by two bytes, effectively skipping the following instruction. If the Carry flag is clear, PC advances by one byte so execution continues with the next instruction. This is a conditional skip, not an address‑relative branch.
C = 1 → PC += 2 (skip next instruction)C = 0 → PC += 1 (continue normally)
No operands are required.; Carry set, BC skips next instruction
MOVLW 0xFF
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; would be skipped; Carry set, BC skips next instruction
MOVLW 0xFF
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; would be skipped; Carry clear, BC does not skip
MOVLW 0x00
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; executed; Carry clear, BC does not skip
MOVLW 0x00
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; executed; Skip NOP after addition that overflows, then fall through
MOVLW 0xFF
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; skipped
GOTO 0x0100 ; executed; Skip NOP after addition that overflows, then fall through
MOVLW 0xFF
MOVWF 0x20
ADDWF 0x20, 1, 0
BC
NOP ; skipped
GOTO 0x0100 ; executed