[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

Operators

All operators evaluate from left to right except for the unary operators, which evaluate from right to left.

The assembler provides the following unary operators:

+ unary positive
- unary negative
~ one's complement (unary)

The assembler provides the following binary operators:

* multiplication
/ division
> right shift
< left shift
| bitwise inclusive or
& bitwise AND
^ bitwise exclusive or
+ addition
- subtraction

Parentheses can be used in expressions to change the order in which the assembler evaluates the expression. Operations within parentheses are performed before operations outside parentheses. Where nested parentheses are involved, processing starts with the innermost set of parentheses and proceeds outward.

Operator Precedence

Operator precedence for 32-bit expressions is shown in the following figure.

In 32-bit mode, all the operators perform 32-bit signed integer operations. In 64-bit mode, all computations are performed using 64-bit signed integer operations.

The division operator produces an integer result; the remainder has the same sign as the dividend. For example:

Operation Result Remainder
8/3 2 2
8/-3 -2 2
(-8)/3 -2 -2
(-8)/(-3) 2 -2

The left shift (<) and right shift (>) operators take an integer bit value for the right-hand operand. For example:

.set mydata,1
.set newdata,mydata<2
# Shifts 1 left 2 bits.
# Assigns the result to newdata.

Related Information

Character Set

Reserved Words

Line Format

Statements

Symbols

Constants

Expressions

The atof subroutine.

The .comm pseudo-op, .csect pseudo-op, .double pseudo-op, .dsect pseudo-op, .float pseudo-op, .lcomm pseudo-op, .tc pseudo-op, .toc pseudo-op, .tocof pseudo-op.


[ Previous | Next | Contents | Home | Search ]