Multiplicative operators

Multiplicative operators have the highest precedence of all binary operators. They act only on numeric expressions.

Table 29 shows the multiplicative operators.

Table 29. Multiplicative operators

OperatorAliasUsageExplanation

*

 

A*B

Multiply

/

 

A/B

Divide

:MOD:

%

A:MOD:B

A modulo B


You can use the :MOD: operator on PC-relative expressions in the form of PC-relative:MOD:Constant. This enables easier code alignment checks in assembler. For example:

    AREA x,CODE
    ASSERT ({PC}:MOD:4) == 0
    DCB 1
y   DCB 2
    ASSERT (y:MOD:4) == 1
    ASSERT ({PC}:MOD:4) == 2
    END

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0473C
Non-ConfidentialID080411