beautypg.com

7 logical operators (unary), 8 relational operators (binary), Logical operators (unary) – Motorola HC12 User Manual

Page 152: Relational operators (binary), Assembler syntax

background image

User’s Manual

MCUez HC12 Assembler

152

Assembler Syntax

MOTOROLA

Assembler Syntax

7.7.7 Logical Operators (Unary)

Syntax:

Logical NOT: !

Description:

The ! (exclamation point) operator returns 1 (true) if the
operand is 0; otherwise, it returns 0 (false).

The operand can be any expression evaluating to an absolute
expression.

Example:

!(8<5) ; = $1 (TRUE)

7.7.8 Relational Operators (Binary)

Syntax:

Equal:

=

==

Not equal:

!=

<>

Less than:

<

Less than or equal: <=
Greater than: >
Greater than or equal: >=

Description:

These operators compare the two operands and return 1 if the
condition is true or 0 if the condition is false.

The operands can be any expression evaluating to an absolute
expression.

Example:

3 >= 4

; = 0 (FALSE)

label = 4

; = 1 (TRUE) if label is 4,

; 0 (FALSE) otherwise

9 < $B

; = 1 (TRUE)