Friday, April 13, 2007

Variables

Variables are where temporary data is stored in a PicBasic Pro program. They are created using the VAR keyword. Variables may be bits, bytes or words. Space for each variable is automatically allocated in the microcontrollers RAM by PBP. The format for creating a variable is as follows:

Label VAR Size{.Modifiers}

Label is any identifier, excluding keywords, as described above. Size is BIT, BYTE or WORD. Optional Modifiers add additional control over how the variable is created. Some examples of creating variable are:

dog VAR byte
cat VAR bit
w0 VAR word

No comments: