[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Arithmetic expressions in GASP
------------------------------
There are two kinds of expressions, depending on their result:
"absolute" expressions, which resolve to a constant (that is, they do
not involve any values unknown to GASP), and "relocatable" expressions,
which must reduce to the form
ADDSYM+CONST-SUBSYM
where ADDSYM and SUBSYM are assembly symbols of unknown value, and
CONST is a constant.
Arithmetic for GASP expressions follows very similar rules to C.
You can use parentheses to change precedence; otherwise, arithmetic
primitives have decreasing precedence in the order of the following
list.
1. Single-argument `+' (identity), `-' (arithmetic opposite), or `~'
(bitwise negation). *The argument must be an absolute expression.*
2. `*' (multiplication) and `/' (division). *Both arguments must be
absolute expressions.*
3. `+' (addition) and `-' (subtraction). *At least one argument must
be absolute.*
4. `&' (bitwise and). *Both arguments must be absolute.*
5. `|' (bitwise or) and `~' (bitwise exclusive or; `' in C). *Both
arguments must be absolute.*
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson