3.6.10. 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 3.6 lists the unary operators that return strings.

Table 3.6. 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.

: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 3.7 lists the unary operators that return numeric values.

Table 3.7. 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 program-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.

: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.[1]

:RCONST::RCONST:RnNumber of register, 0-15 corresponding to r0-r15.

[1] ~ is an alias for :NOT:, for example, ~A.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F
Non-Confidential