Propeller Manual

Table Of Contents
Operators – Assembly Language Reference
Operators
Propeller Assembly code can contain expressions using any operators that are allowed in
constant expressions. Table 3-4 summarizes all the operators allowed in Propeller Assembly
code. Please refer to the Spin Language Reference Operators section on page 143 for
detailed descriptions of their functions; page numbers are given in the table.
Table 3-4: Constant Expression Math/Logic Operators
Normal Operato
r
Is Unary Description, Page Numbe
r
+
Add, 149
+
9
Positive (+X); unary form of Add, 150
-
Subtract, 150
-
9
Negate (-X); unary form of Subtract, 150
*
Multiply and return lower 32 bits (signed), 153
**
Multiply and return upper 32 bits (signed), 153
/
Divide (signed), 154
//
Modulus (signed), 154
#>
Limit minimum (signed), 155
<#
Limit maximum (signed), 155
^^
9
Square root, 156
||
9
Absolute value, 156
~>
Shift arithmetic right, 158
|<
9
Bitwise: Decode value (0-31) into single-high-bit long, 160
>|
9
Bitwise: Encode long into value (0 - 32) as high-bit priority, 160
<<
Bitwise: Shift left, 161
>>
Bitwise: Shift right, 161
<-
Bitwise: Rotate left, 162
->
Bitwise: Rotate right, 162
><
Bitwise: Reverse, 163
&
Bitwise: AND, 164
|
Bitwise: OR, 165
^
Bitwise: XOR, 165
!
9
Bitwise: NOT, 166
AND
Boolean: AND (promotes non-0 to -1), 167
OR
Boolean: OR (promotes non-0 to -1), 168
NOT
9
Boolean: NOT (promotes non-0 to -1), 168
==
Boolean: Is equal, 169
<>
Boolean: Is not equal, 170
<
Boolean: Is less than (signed), 170
>
Boolean: Is greater than (signed), 171
=<
Boolean: Is equal or less (signed), 171
=>
Boolean: Is equal or greater (signed), 172
@
9
Symbol address, 173
Page 326 · Propeller Manual v1.1