Unary operators

Unary operators have the highest precedence and are evaluated first. A unary operator precedes its operand. Adjacent operators are evaluated from right to left.

Table 27 lists the unary operators that return strings.

Table 27. Unary operators that return strings

Operator

Usage

Description

:CHR:

:CHR:A

Returns the character with ASCII code A.

:LOWERCASE::LOWERCASE:stringReturns the given string, with all uppercase characters converted to lowercase.
:REVERSE_CC::REVERSE_CC:cond_codeReturns the inverse of the condition code in cond_code, or an error if cond_code does not contain a valid condition code.

:STR:

:STR:A

Returns an 8-digit hexadecimal string corresponding to a numeric expression, or the string "T" or "F" if used on a logical expression.

:UPPERCASE::UPPERCASE:stringReturns the given string, with all lowercase characters converted to uppercase.

Table 28 lists the unary operators that return numeric values.

Table 28. Unary operators that return numeric or logical values

OperatorUsageDescription

?

?A

Number of bytes of executable code generated by line defining symbol A.

+ and -

+A

-A

Unary plus. Unary minus. + and - can act on numeric and PC-relative expressions.

:BASE:

:BASE:A

If A is a PC-relative or register-relative expression, :BASE: returns the number of its register component. :BASE: is most useful in macros.

:CC_ENCODING::CC_ENCODING:cond_codeReturns the numeric value of the condition code in cond_code, or an error if cond_code does not contain a valid condition code.

:DEF:

:DEF:A

{TRUE} if A is defined, otherwise {FALSE}.

:INDEX:

:INDEX:A

If A is a register-relative expression, :INDEX: returns the offset from that base register. :INDEX: is most useful in macros.

:LEN:

:LEN:A

Length of string A.

:LNOT:

:LNOT:A

Logical complement of A.

:NOT:

:NOT:A

Bitwise complement of A (~ is an alias, for example ~A).

:RCONST::RCONST:RnNumber of register, 0-15 corresponding to R0-R15.

Show/hideSee also

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