Keil Logo

Numeric expressions

7.14 Numeric expressions

Numeric expressions consist of combinations of numeric constants, numeric variables, ordinary numeric literals, binary operators, and parentheses.

Numeric expressions can contain register-relative or program-relative expressions if the overall expression evaluates to a value that does not include a register or the PC.
Numeric expressions evaluate to 32-bit integers. You can interpret them as unsigned numbers in the range 0 to 232-1, or signed numbers in the range -231 to 231-1. However, armasm makes no distinction between -n and 232-n. Relational operators such as >= use the unsigned interpretation. This means that 0 > -1 is {FALSE}.

Example

a   SETA    256*256           ; 256*256 is a numeric expression
    MOV     r1,#(a*22)        ; (a*22) is a numeric expression
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  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.