C operators and PIC instructions
All the following instructions, shown with their C equivalent,
set bits of the
STATUS file register.
PIC status register
The PIC status register contains five flags, or bits, that can be set my PIC operations.
C: Set when a carry occurs
Z: Set when the result is zero
N: Set when the result is negative, msb of 1
OV: Set when an overflow occurs
DC: Set when a digit carry occurs in the 4 lsb bits
In general, all five bits are set by the addition, subtraction, increment, and decrement instructions. For subtraction, the carry bit is set as if the minuend is added to the twos complement of the subtrahend.
The bit-wise instructions and the MOV where a file register
is the source set the
All shift instructions set the
Some shift instructions also set the
Take a look a the MSU ECE 3724 chapter 4 notes to see how the bits of the status register are used for shift operators and common control structures.