Blocks
Each Propeller object is a Spin file that has an inherent structure consisting of up to six different special-purpose blocks: CON, VAR, OBJ, PUB, PRI, and DAT.
- CON — Declare a Constant Block. to add global constants to your object.
- VAR — Declare a Variable Block to add global variables to your object.
- OBJ — Include external objects in your object.
- PUB — Define functions that will be accessible to objects that include this one.
- PRI — Define functions that will be private to this object.
- DAT — Define data and assembly code.
Valid Keywords
These blocks are shown below (in the order that they typically appear in objects) along with the set of keywords usable within each.
For detailed examples of the object (Spin) structure and usage, refer to the Propeller Programming Tutorial in the Propeller Tool Help.
CON: Constant blocks define global constants
_CLKFREQ | NEGX | PLL16X | XINPUT |
_CLKMODE | Operators* | POSX | XTAL1 |
_FREE | PI | RCFAST | XTAL2 |
_STACK | PLL1X | RCSLOW | XTAL3 |
_XINFREQ | PLL2X | ROUND |
|
FALSE | PLL4X | TRUE |
|
FLOAT | PLL8X | TRUNC |
|
*Non-assignment operators only.
VAR: Variable blocks define global variables
BYTE | LONG | ROUND | TRUNC |
FLOAT | Operators* | WORD |
|
*Non-assignment operators only.
OBJ: Object blocks define referenced objects
FLOAT | Operators* | ROUND | TRUNC |
*Non-assignment operators only.
PUB / PRI: Public and Private method blocks define Spin routines
ABORT | FLOAT | Operators | ROUND |
BYTE | FRQA | OUTA | SPR |
BYTEFILL | FRQB | OUTB | STRCOMP |
BYTEMOVE | IF | PAR | STRING |
CASE | IFNOT | PHSA | STRSIZE |
CHIPVER | INA | PHSB | TRUE |
CLKFREQ | INB | PI | TRUNC |
CLKMODE | LOCKCLR | PLL1X | VCFG |
CLKSET | LOCKNEW | PLL2X | VSCL |
CNT | LOCKRET | PLL4X | WAITCNT |
COGID | LOCKSET | PLL8X | WAITPEQ |
COGINIT | LONG | PLL16X | WAITPNE |
COGNEW | LONGFILL | POSX | WAITVID |
COGSTOP | LONGMOVE | QUIT | WORD |
CONSTANT | LOOKDOWN | RCFAST | WORDFILL |
CTRA | LOOKDOWNZ | RCSLOW | WORDMOVE |
CTRB | LOOKUP | REBOOT | XINPUT |
DIRA | LOOKUPZ | REPEAT | XTAL1 |
DIRB | NEGX | RESULT | XTAL2 |
FALSE | NEXT | RETURN | XTAL3 |
DAT: Data blocks define data and Propeller Assembly code
Assembly | FRQB | PI | TRUNC |
BYTE | INA | PLL1X | VCFG |
CNT | INB | PLL2X | VSCL |
CTRA | LONG | PLL4X | WORD |
CTRB | NEGX | PLL8X | XINPUT |
DIRA | Operators* | PLL16X | XTAL1 |
DIRB | OUTA | POSX | XTAL2 |
FALSE | OUTB | RCFAST | XTAL3 |
FILE | PAR | RCSLOW |
|
FLOAT | PHSA | ROUND |
|
FRQA | PHSB | TRUE |
|
*Non-assignment operators only.
Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.