You copied the Doc URL to your clipboard.

Unaryoperators

Unary operators return a string, numeric, or logical value. They have higher precedence than other operators and are evaluated first.

A unary operator precedes its operand. Adjacent operators are evaluated from right to left.

The following table lists the unary operators that return strings:

Table 12-1 Unary operators that return strings

Operator

Usage

Description

:CHR:

:CHR:A

Returns the character with ASCII code A.

:LOWERCASE: :LOWERCASE:string Returns the given string, with all uppercase characters converted to lowercase.
:REVERSE_CC: :REVERSE_CC:cond_code Returns 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

In A32 and T32 code, returns an 8-digit hexadecimal string corresponding to a numeric expression, or the string "T" or "F"" if used on a logical expression. In A64 code, returns a 16-digit hexadecimal string.

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

The following table lists the unary operators that return numeric values:

Table 12-2 Unary operators that return numeric or logical values

Operator Usage Description

?

?A

Number of bytes of 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_code Returns 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:Rn Number of register. In A32/T32 code, 0-15 corresponds to R0-R15. In A64 code, 0-30 corresponds to W0-W30 or X0-X30.

Related concepts

Was this page helpful? Yes No