Language Elements
Elements marked with a superscript "a" are also available in Propeller Assembly.
Configuration
CHIPVER | Propeller chip version number. |
CLKMODE | Current clock mode setting. |
_CLKMODE | Application-defined clock mode (read-only). |
CLKFREQ | Current clock frequency. |
_CLKFREQ | Application-defined clock frequency (read-only). |
CLKSETa | Set clock mode and clock frequency. |
_XINFREQ | Application-defined external clock frequency (read-only). |
_STACK | Application-defined stack space to reserve (read-only). |
_FREE | Application-defined free space to reserve (read-only). |
Process Control
WAITCNTa | Wait for System Counter to reach a value. |
WAITPEQa | Wait for pin(s) to be equal to value. |
WAITPNEa | Wait for pin(s) to be not equal to value. |
WAITVIDa | Wait for video sync and deliver next color/pixel group. |
Flow Control
...ELSEIF | Conditionally execute one or more blocks of code. |
...ELSEIF | Conditionally execute one or more blocks of code. |
...OTHER | Evaluate expression and execute block of code that satisfies a condition. |
...FROM | Execute block of code repetitively an infinite or finite number of times with optional loop counter, intervals, exit and continue conditions. |
NEXT | Skip rest of REPEAT block and jump to next loop iteration. |
QUIT | Exit from REPEAT loop. |
RETURN | Exit PUB/PRI with normal status and optional return value. |
ABORT | Exit PUB/PRI with abort status and optional return value. |
Memory
BYTE | Declare byte-sized symbol or access byte of main memory. |
WORD | Declare word-sized symbol or access word of main memory. |
LONG | Declare long-sized symbol or access long of main memory. |
BYTEFILL | Fill bytes of main memory with a value. |
WORDFILL | Fill words of main memory with a value. |
LONGFILL | Fill longs of main memory with a value. |
BYTEMOVE | Copy bytes from one region to another in main memory. |
WORDMOVE | Copy words from one region to another in main memory. |
LONGMOVE | Copy longs from one region to another in main memory. |
LOOKUP | Get value at index (1..N) from a list. |
LOOKUPZ | Get value at zero-based index (0..N−1) from a list. |
LOOKDOWN | Get index (1..N) of a matching value from a list. |
LOOKDOWNZ | Get zero-based index (0..N−1) of a matching value from a list. |
STRSIZE | Get size of string in bytes. |
STRCOMP | Compare a string of bytes against another string of bytes. |
Directives
STRING | Declare in-line string expression; resolved at compile time. |
CONSTANT | Declare in-line constant expression; resolved at compile time. |
FLOAT | Declare floating-point expression; resolved at compile time. |
ROUND | Round compile-time floating-point expression to integer. |
TRUNC | Truncate compile-time floating-point expression at decimal. |
FILE | Import data from an external file. |
Registers
DIRAa | Direction Register for 32-bit port A. |
DIRBa | Direction Register for 32-bit port B (future use). |
INAa | Input Register for 32-bit port A (read only). |
INBa | Input Register for 32-bit port B (read only) (future use). |
OUTAa | Output Register for 32-bit port A. |
OUTBa | Output Register for 32-bit port B (future use). |
CNTa | 32-bit System Counter Register (read only). |
CTRAa | Counter A Control Register. |
CTRBa | Counter B Control Register. |
FRQAa | Counter A Frequency Register. |
FRQBa | Counter B Frequency Register. |
PHSAa | Counter A Phase-Locked Loop (PLL) Register. |
PHSBa | Counter B Phase-Locked Loop (PLL) Register. |
VCFGa | Video Configuration Register. |
VSCLa | Video Scale Register. |
PARa | Cog Boot Parameter Register (read only). |
SPR | Special-Purpose Register array; indirect cog register access. |
Constants
TRUEa | Logical true: -1 ($FFFFFFFF). |
FALSEa | Logical false: 0 ($00000000). |
POSXa | Maximum positive integer: 2,147,483,647 ($7FFFFFFF). |
NEGXa | Maximum negative integer: -2,147,483,648 ($80000000). |
PIa | Floating-point value for PI: ~3.141593 ($40490FDB). |
Variable
RESULT | Default result variable for PUB/PRI methods. |
Unary Operators
+ | Positive (+X); unary form of Add. |
- | Negate (-X); unary form of Subtract. |
-- | Pre-decrement (X) or post-decrement (X-) and assign. |
++ | Pre-increment (+X) or post-increment (X+) and assign. |
^^ | Square root. |
|| | Absolute Value. |
~ | Sign-extend from bit 7 (~X) or post-clear to 0 (X). |
~~ | Sign-extend from bit 15 (X) or post-set to -1(X~). |
? | Random number forward (?X) or reverse (X?). |
|< | Decode value (modulus of 32; 0-31) into single-high-bit long. |
>| | Encode long into magnitude (0 - 32) as high-bit priority. |
! | Bitwise: NOT. |
NOT | Boolean: NOT (promotes non-0 to -1). |
@ | Symbol address. |
@@ | Object address plus symbol value. |
Binary Operators
NOTE: All right-column operators are assignment operators.
= --or-- = | Constant assignment (CON blocks). |
:= -and- := | Variable assignment (PUB/PRI blocks). |
+ --or-- = | Add. |
- --or-- -= | Subtract. |
* --or-- *= | Multiply and return lower 32 bits (signed). |
** --or-- **= | Multiply and return upper 32 bits (signed). |
/ --or-- /= | Divide (signed). |
// --or-- //= | Modulus (signed). |
#> --or-- #>= | Limit minimum (signed). |
<# --or-- <#= | Limit maximum (signed). |
> --or-- >= | Bitwise: Shift arithmetic right. |
<< --or-- <<= | Bitwise: Shift left. |
>> --or-- >>= | Bitwise: Shift right. |
< --or- <-= | Bitwise: Rotate left. |
> --or- ->= | Bitwise: Rotate right. |
>< --or-- ><= | Bitwise: Reverse. |
& --or-- &= | Bitwise: AND. |
| --or-- |= | Bitwise: OR. |
^ --or-- ^= | Bitwise: XOR. |
AND --or-- AND= | Boolean: AND (promotes non-0 to -1). |
OR --or-- OR= | Boolean: OR (promotes non-0 to -1). |
== --or-- === | Boolean: Is equal. |
<> --or-- <>= | Boolean: Is not equal. |
< --or-- <= | Boolean: Is less than (signed). |
> --or-- >= | Boolean: Is greater than (signed). |
=< --or-- =<= | Boolean: Is equal or less (signed). |
=> --or-- =>= | Boolean: Is equal or greater (signed). |
Syntax Symbols
% | Binary number indicator, as in %1010. |
%% | Quaternary number indicator, as in %%2130. |
$ | Hexadecimal indicator, as in $1AF or assembly 'here' indicator. |
" | String designator "Hello". |
_ | Group delimiter in constant values, or underscore in symbols. |
# | Object-Constant reference: obj#constant. |
. | Object-Method reference: obj.method(param) or decimal point. |
.. | Range indicator, as in 0..7. |
: | Return separator: PUB method : sym, or object assignment, etc.. |
| | Local variable separator: PUB method | temp, str. |
\ | Abort trap, as in \method(parameters). |
, | List delimiter, as in method(param1, param2, param3). |
( ) | Parameter list designators, as in method(parameters). |
[ ] | Array index designators, as in INA[2]. |
{ } | In-line/multi-line code comment designators. |
{{ }} | In-line/multi-line document comment designators. |
' | Code comment designator. |
'' | Document comment designator. |
Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.