User’s Manual MCUez HC12 Assembler
154 Assembler Syntax MOTOROLA
Assembler Syntax
The > (greater than) operator may be useful to force the 16-bitimmediate, indexed, or extended addressing mode for aninstruction.The operand can be any expressionevaluating to an absolute orrelocatable expression.Example:
<label ; label is an 8-bit address
label.B ; label is an 8-bit address
>label ; label is a 16-bit address
label.W ; label is a 16-bit address
Operator precedence follows the rules for ANSI C operators.See Table 7-3.Table 7-3. Operator PrecedenceOperator Description Associativity
() Parenthesis Right to left
<
>
.B
.W
PAG E
Force direct address, index, or immediate value
to 8 bits.
Force direct address, index, or immediate value
to 16 bits.
Force direct addressing mode for absolute
address.
Force extended addressing mode for absolute
address.
Access 4-bit page number (bits 16–23 of 20-bit
value).
Right to left
~
+
—
One’s complement
Unary plus
Unary minus Left to right
*
/
%
Integer multiplication
Integer division
Integer modulo Left to right
+
—Integer addition
Integer subtraction Left to right
<<
>> Shift left
Shift right Left to right