September 2012

PIC18: branch instructions

binary codeSkimming through the PIC 18F4550 istruction set we can see, among others, a bunch of branch instructions.

What are they for and what's their relationship with the STATUS register? Let's see them in practice using some assembly code examples. This will also be a nice occasion to do a bit of simple HEX math.

Branch instructions

BC - Branch if Carry

BN - Branch if Negative