From a8f70ccc0193a0b5ab48de1fa28ad2c881bce2d4 Mon Sep 17 00:00:00 2001
From: mrexodia
Operators
You can use the
-following operators in your expression. They are processed in the following order:
0:negative - : Negative numbers can be prefixed by a -'-' sign.
-1:brackets: '(' and ')' Brackets are -resolved first, there is no need for a terminating bracket, unless you want to -use one.
-2:not: '~' The not operator can be used before a -number of a variable, like in C.
-3:muliplication/devision: '*' = regular -multiplication (signed/unsigned), '`' = get the higher part of the -multiplication, '/' = regular devision (signed/unsigned, devide by zero=error) -and '%' = get the modulo (remainder) of the devision.
-4:addition/substraction: '+' and '-'
-5:shift: '<' = shift left (shl for unsigned, -sal for signed), '>' = shift right (shr for unsigned, sar for signed).
-6:and: '&' Just the regular AND operation like -in C.
-7:xor: '^' Just the regular XOR operation like in -C.
-8:or: '|' Just the regular OR operation like in -C.
-Quick-Assigning
Changing memory, a
+
Operators
You can use the following operators in your expression.
+They are processed in the following order (source):
1:parentheses/brackets: (1+2), [1+6] have +priority over other operations.
+2:unary minus/binary not/logical not: -1 (negative 1), ~1 (binary not of 1), !0 +(logical not of 0).
++3:multiplication/division: +2*3 (regular multiplication), 2`3 (gets high part of the +multiplication), 6/3 (regular division), 5%3 (modulo/remainder of +the division).
+4:addition/subtraction: +1+3 (addition), 5-2 + (subtraction).
+5:left/right +shift: 1<<2 (shift left, shl for unsigned, sal for +signed), 10>>1 (shift right, shl +for unsigned, sal for signed).
+6:smaller (equal)/bigger (equal): 4<10, 3>6, +1<=2, 6>=7 (resolves to 1 if true, + 0 if false).
+7:equal/not equal: 1==1, 2!=6 + (resolves to 1 if true, 0 if +false).
+8:binary and: 12&2 + (regular binary +and).
+9:binary xor: 2^1 + (regular binary +xor).
+10:binary or: 2|8 + (regular binary +or).
+11:logical and: 0&&3 + (resolves to 1 if true, 0 if +false).
+12:logical or: 0||3 + (resolves to 1 if true, 0 if +false).
+Quick-Assigning
Changing memory, a
variable, register or flag can be easily done using a C-like
syntax:
a?=b: '?' can be any mathematical operation. 'a' -can be any register, flag, variable or memory location. 'b' can be anything that is recognized as a mathmatical -input.
-a++/a--: 'a' can be any register, flag, variable or memory +
a?= b: '?' can be any non-logical operator. +'a' can be any register, flag, variable or memory location. 'b' can be anything that is recognized as an +expression.
+a++/a--: 'a' can be any register, flag, variable or memory location.