
Variable Types
In high-level languages, such as C, the variables to be used in a program must
be declared in advance, and the correct storage space allocated before running
the program. In PIC programs, all data locations (GPRs) are 8 bits, so they will
need to be used in groups to represent 16-bit (2 bytes) or even 32-bit
(4 bytes) numbers. In assembly language, these registers can be assigned using
label equates at the top of the program.
Integer
An 8-bit location can only store numbers from 0 to 255 in binary. This is an
obvious limitation in programs that may need to calculate results up to say, four
significant decimal digits (0–9999), with negati ...