Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The GNU Assembler Preprocessor - <b>arithmetic expressions in gasp</b> http://www.X-Hacker.org [<<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.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson