Operator reference
September 27, 2024 ยท View on GitHub
Integer and fixed point operators
Several operators can be used to build up integer expressions. In order of precedence they are:
| Operator | Meaning |
|---|---|
| ( ) | Precedence override |
| string comparison (~= == <= >= < >), string member function | String operations returning int |
| FunctionName(...) | Function call |
| ~ + - | Unary bitwise not, plus, negation |
| * / ~/ ** // | Multiply, divide, modulo, fixedpoint multiply and divide |
| << >> | Shift left, shift right |
| & ^ | | Bitwise and, bitwise exclusive or, bitwise or |
| + - | Add, subtract |
| ~= == <= >= < > | Comparison operators: not equal, equal, less than or equal, greater than or equal, less than, greater than |
| && | |
| ~! | Unary boolean not |
The result of the boolean operators and comparison operators is zero if when false and non-zero when true.
String operators
There are only a couple of operators available that return new strings. One is the string
concatenation operator, +. The other is the "to string" operator - |expression|.
The string comparison operators (~= == <= >= < >) all return an integer, the result comparison operators is zero if when false and non-zero when true.
Further reading
- Introduction, goals and background
- Invoking the assembler and basic syntax
- Symbols and labels
- Control structures like
INCLUDE,MACROs and conditional assembling. - Expressions and how they're built
- Printing diagnostic messages, warnings and errors
- Organising code into sections. How to define data.
- The linker