7.21 Multiplicative operators

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

The following table shows the multiplicative operators:

Table 7-3 Multiplicative operators

Operator Alias Usage Explanation
*
 
A*B
Multiply
/
 
A/B
Divide
:MOD:
%
A:MOD:B
A modulo B
You can use the :MOD: operator on PC-relative expressions to ensure code is aligned correctly. These alignment checks have the form PC-relative:MOD:Constant. 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
Related concepts
7.20 Binary operators
7.5 Register-relative and PC-relative expressions
7.14 Numeric expressions
Related reference
7.15 Syntax of numeric literals
Non-ConfidentialPDF file icon PDF versionARM DUI0379G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.