Propeller Manual

Table Of Contents
2: Spin Language Reference
Spin Language Elements
The remainder of this chapter describes the elements of the Spin Language, shown above, in
alphabetical order. A few elements are explained within the context of others for clarity; use
the page references from the categorical listing, above, to find those discussions. Many
elements are available both in Spin and Propeller Assembly. Those elements are described in
detail within this section, with references to them, and any differences, in the appropriate
areas of Chapter 3: Assembly Language Reference beginning on page 238.
Symbol Rules
Symbols are case-insensitive, alphanumeric names either created by the compiler (reserved
word) or by the code developer (user-defined word). They represent values (constants or
variables) to make source code easier to understand and maintain. Symbols must fit the
following rules:
1) Begins with a letter (a – z) or an underscore ‘_’.
2) Contains only letters, numbers, and underscores (a – z, 0 – 9, _ ); no spaces allowed.
3) Must be 30 characters or less.
4) Is unique to the object; not a reserved word (p. 379) or previous user-defined symbol.
Value Representations
Values can be entered in binary (base-2), quaternary (base-4), decimal (base-10),
hexadecimal (base-16), or character formats. Numerical values can also use underscores, ‘
_’,
as a group separator to clarify numbers. The following are examples of these formats.
Table 2-1: Value Representations
Base Type of Value Examples
2 Binary %1010 –or– %11110000_10101100
4 Quaternary %%2130_3311 –or– %%3311_2301_1012
10 Decimal (integer) 1024 –or– 2_147_483_647 –or– -25
10 Decimal (floating-point) 1e6 –or– 1.000_005 –or– -0.70712
16 Hexadecimal $1AF –or– $FFAF_126D_8755
n/a Character "A"
Separators can be used in place of commas (in decimal values) or to form logical groups,
such as nibbles, bytes, words, etc.
Propeller Manual v1.1 · Page 45