The following operators are available in Spin. There is a separate table for Propeller Assembly Operators.
Operator
Assignment Usage
Constant Expressions1
Is Unary
Description
Integer
Float
always
n/a1
Constant assignment (CON blocks only)
Variable assignment (PUB/PRI blocks only)
ü
Add
never
Positive (+X); unary form of Add
Subtract
if solo
Negate (-X); unary form of Subtract
Pre-decrement (--X) or post-decrement (X--)
Pre-increment (++X) or post-increment (X++)
Multiply and return lower 32 bits (signed)
Multiply and return upper 32 bits (signed)
Divide (signed)
Modulus (signed)
Limit minimum (signed)
Limit maximum (signed)
Square root
Absolute value
Sign-extend from bit 7 (~X) or post-clear to 0 (X~); all bits low
Sign-extend from bit 15 (~~X) or post-set to -1 (X~~); all bits high
Shift arithmetic right
Random number forward (?X) or reverse (X?)
Bitwise: Decode value (0 - 31) into single-high-bit long
Bitwise: Encode long into value (0 - 32) as high-bit priority
Bitwise: Shift left
Bitwise: Shift right
Bitwise: Rotate left
Bitwise: Rotate right
Bitwise: Reverse
Bitwise: AND
Bitwise: OR
Bitwise: XOR
Bitwise: NOT
Boolean: AND (promotes non-0 to -1)
Boolean: OR (promotes non-0 to -1)
Boolean: NOT (promotes non-0 to -1)
Boolean: Is equal
Boolean: Is not equal
Boolean: Is less than (signed)
Boolean: Is greater than (signed)
Boolean: Is equal or less (signed)
Boolean: Is equal or greater (signed)
Symbol address
Object address plus symbol
Note 1: Assignment forms of operators are not allowed in constant expressions.
Propeller Help Version 1.1
Copyright © Parallax Inc.
5/13/2009