Crossware

Table of Contents        Previous topic       Next topic       

CROSS ASSEMBLER->Assembler Expressions->Assembler Expressions

Expressions are placed in the operand field and are evaluated by the cross-assembler to give a numerical integer value.  An expression may be used anywhere within the operand field where a numerical value is expected. The expression evaluator within the cross-assembler will use 32 bit integer arithmetic to calculate the value of the expression.

The expression may consist of symbols, numbers, literals and operators. Parentheses may be used to define a particular order of precedence. Parentheses can be nested.

The following operators are allowed:
    
Addition+
Subtraction-
Multiplication*
Integer division/
Modular divisionMOD
Logical OROR
Logical ANDAND
Logical exclusive ORXOR
ComplementNOT
Shift rightSHR
Shift leftSHL
Select high order byteHIGH
Select low order byteLOW
EqualEQ or =
Not equalNE or <>
Less thanLT or <
Less than or equal toLE or <=
Greater thanGT or >
Greater than or equal toGE or >=
    
These operators take the following precedence:
    
Parenthesized expression ()
HIGH, LOW
*, /, MOD, SHL, SHR
+, -
EQ, NE, LT, LE, GT, GE, =, <>, <, <=, >, >=
NOT
AND
OR, XOR

Operators with the same precedence are evaluated from left to right.