Keil Logo

- Assembler Operator

Arguments
- operand
operand1 - operand2


Description

The minus sign ('-') is used as the unary minus operator and as the subtraction operator.

The unary minus operator is used to change the sign of the specified operand. If the value of the operand is positive, the sign is changed to negative. If the value is negative, it is changed to positive.

The subtraction operator is used to subtract the value of operand2 from the value of operand1. The specified operands may be absolute or relocatable. The type of the resulting expression is determined by the operand types as shown in the following table:

Operand Types Resulting Expression Type
absolute - absolute absolute
absolute - relocatable Error: Not allowed.
relocatable - absolute relocatable
relocatable - relocatable absolute1

1. Relocatable operands are allowed if both are defined in the same parent section. External operands are not allowed.

Note

  • As a general rule, relocatable expressions must evaluate to a relocatable symbol plus or minus an optional constant value (displacement).
See Also

+

Example
labx:   MOV     R1, #5678-1234
laby:   MOV     R2, laby-labx
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.