Comparisons between two expression values are used in conditional If, Do, Assertion, and conditional assignment commands. These expressions are self-typing in that their type is derived from the type of variables or function results within the expressions. Mixing types in a comparison and comparisons containing only constants is not permited. Evaluating a conditional exprassion has no side effects.
An integer comparison can have either signed or unsigned comparators. A comparison that is just a single integer expression is met when the resulting value is non-zero.
IntegerComparison := IntegerExpression [MixedInequality IntegerExpression] Inequality := '=' | '~=' | '>' | '<' | '<=' | '=<' | '>=' | '=>' UnsignedInequality := '=' | '~=' |'_>' | '_<' | '_<=' | '_=<' | '_<=' | '_=>' MixedInequality := Inequality | UnsignedInequality
When comparing real number expressions only signed comparators are used. If the comparison is just a single real expression it is also met when the result is non-zero.
RealComparison := RealExpression [Inequality RealExpression]
String comparisons are based on the ordering of bytes in two strings. The comparison is performed as a byte-wise comparison until two bytes differ or one or both strings have no more bytes to compare.
StringComparison := StringExpression [Inequality StringExpression]
Comparisons of Enumerated types are based on the position within the type operands. For inequalities use signed comparators. Since they always represent positive numbers the use of unsigned inequalities is not necessary.
EnumeratedComparison := Enumeration [Inequality Enumeration]
Structures of the same type can be compared field by field for equality. When comparing large structures performance can be degraded.
StructureComparison := Structure [{'=' | '~='} Structure]
A pointer can either contain an address or a 16 bit unsigned integer value. Pointers can be compared to a 16 bit unsigned constant or to each other using comparators. Since they always represent positive numbers the use of unsigned inequalities is not necessary.
@Pointer [Inequality @Pointer] @Pointer Inequality IntegerExpression IntegerExpression Inequality @Pointer
Arithmetic_Expression
Compound Condition
![]()