Datasheet

Propeller™ P8X32A Datasheet www.parallax.com
Copyright © Parallax Inc. Page 19 of 37 Rev 1.1 9/12/2008
6.3. Spin Language Summary Table
Spin Command
Returns
Value
Description
ABORT Value 9 Exit from PUB/PRI method using abort status with optional return value.
BYTE Symbol [Count] Declare byte-sized symbol in VAR block.
Symbol BYTE Data [Count] Declare byte-aligned and/or byte-sized data in DAT block.
BYTE [BaseAddress] [Offset] 9 Read/write byte of main memory.
Symbol.BYTE [Offset] 9 Read/write byte-sized component of word/long-sized variable.
BYTEFILL (StartAddress, Value, Count) Fill bytes of main memory with a value.
BYTEMOVE (DestAddress, SrcAddress, Count) Copy bytes from one region to another in main memory.
CASE CaseExpression
MatchExpression :
Statement(s)
MatchExpression :
Statement(s)
OTHER :
Statement(s)
Compare expression against matching expression(s), execute code block
if match found.
MatchExpression can contain a single expression or multiple comma-
delimited expressions. Expressions can be a single value (ex: 10) or a
range of values (ex: 10..15).
CHIPVER 9 Version number of the Propeller chip (Byte at $FFFF)
CLKFREQ 9 Current System Clock frequency, in Hz (Long at $0000)
CLKMODE 9 Current clock mode setting (Byte at $0004)
CLKSET (Mode, Frequency) Set both clock mode and System Clock frequency at run time.
CNT 9 Current 32-bit System Counter value.
COGID 9 Current cog’s ID number; 0-7.
COGINIT (CogID, SpinMethod (ParameterList), StackPointer) Start or restart cog by ID to run Spin code.
COGINIT (CogID, AsmAddress, Parameter) Start or restart cog by ID to run Propeller Assembly code.
COGNEW (SpinMethod (ParameterList), StackPointer) 9 Start new cog for Spin code and get cog ID; 0-7 = succeeded, -1 = failed.
COGNEW (AsmAddress, Parameter) 9
Start new cog for Propeller Assembly code and get cog ID; 0-7 =
succeeded, -1 = failed.
COGSTOP (CogID) Stop cog by its ID.
CON
Symbol = Expr ((, )) Symbol = Expr
Declare symbolic, global constants.
CON
#Expr ((, )) Symbol [Offset] ((, )) Symbol [Offset]
Declare global enumerations (incrementing symbolic constants).
CON
Symbol [Offset] ((, )) Symbol [Offset]
Declare global enumerations (incrementing symbolic constants).
CONSTANT (ConstantExpression) 9
Declare in-line constant expression to be completely resolved at compile
time.
CTRA 9 Counter A Control register.
CTRB 9 Counter B Control register.
DAT
Symbol Alignment Size Data [Count] ,Size Data [Count]〉〉
Declare table of data, aligned and sized as specified.
DAT
Symbol Condition Instruction Effect(s)
Denote Propeller Assembly instruction.
DIRA [Pin(s)] 9 Direction register for 32-bit port A. Default is 0 (input) upon cog startup.
FILE "FileName" Import external file as data in DAT block.
FLOAT (IntegerConstant) 9
Convert integer constant expression to compile-time floating-point value in
any block.
FRQA 9 Counter A Frequency register.
FRQB 9 Counter B Frequency register.