Program Structure

Expressions

base register, needs only 11 bits for the remainder of the address. The Assembler provides special operators, called field selectors, that extract the appropriate bits from the result of an expression. With the field selectors L' and R', the previous example can be recoded as follows:

 

LDIL

L'START,%r1

;put left part into r1

 

LDW

R'START(%r1),%r2

;add r1 and right part

 

The field selectors are always applied to the final result of the

 

expression. They cannot be used in the interior of an expression.

 

“Available Field Selectors” on page

31 shows all the available field

 

selectors and their meanings.

 

Table 2-11

Available Field Selectors

 

 

 

 

 

 

 

Field

 

 

Meaning

 

Selector

 

 

 

 

 

 

 

 

 

 

 

 

F' or F%

 

Full 32 bits (default).

 

 

 

 

 

 

L' or L%

 

Right-justified, high-order 21 bits.

 

 

 

 

 

 

R' or R%

 

Low-order 11 bits.

 

 

 

 

 

 

LS' or

 

High-order 21 bits after rounding to nearest multiple of

 

LS%

 

2048.

 

 

 

 

 

 

RS' or

 

Low-order 11 bits, sign extended.

 

RS%

 

 

 

 

 

 

 

 

LD' or

 

Right-justified, high-order 21 bits after rounding to next

 

LD%

 

multiple of 2048.

 

 

 

 

 

 

RD' or

 

Low-order 11 bits, with negative sign.

 

RD%

 

 

 

 

 

 

 

 

LR' or

 

L% value with constant rounded to nearest multiple of

 

LR%

 

8192.

 

 

 

 

 

 

RR' or

 

R% value with constant rounded to nearest multiple of

 

RR%

 

8192, plus the difference of the constant and the rounded

 

 

 

constant.

 

 

 

 

 

 

T' or T%

 

F% value offset of data linkage table slots from linkage

 

 

 

table pointer. In 32-bit mode, the linkage table pointer is

 

 

 

%r19. In 64-bit mode, the linkage table pointer is %r27.

 

 

 

 

 

Chapter 2

31