22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Terms, Literals, and Expressions<br />

The following examples show absolute expressions.<br />

are relocatable terms with the same relocatability:<br />

A-Y+X<br />

A<br />

AA<br />

X-Y+A<br />

| (+)-(+)<br />

| -<br />

A is an absolute term; X and Y<br />

A reference to the location counter must be paired with another relocatable term<br />

from the same control section; that is, with the same relocatability. For example:<br />

-Y<br />

Relocatable Expression: A relocatable expression is one whose value changes<br />

by n if the origin of the control section in which it appears is relocated n bytes.<br />

A relocatable expression can be a single relocatable term. The assembler reduces<br />

a relocatable expression to a single relocatable value if the expression:<br />

1. Is composed of a single relocatable term, or<br />

2. Contains relocatable terms, alone or in combination with absolute terms, and<br />

a. All the relocatable terms but one are paired. Note that the unpaired term<br />

gives the expression a relocatable value; the paired relocatable terms and<br />

other absolute terms constitute increments or decrements to the value of<br />

the unpaired term.<br />

b. The relocatability attribute of the whole expression is that of the unpaired<br />

term.<br />

c. The sign preceding the unpaired relocatable term must be positive, after all<br />

unary operators have resolved.<br />

The following examples show relocatable expressions. A is an absolute term, W<br />

and X are relocatable terms with the same relocatability attribute, and Y is a<br />

relocatable term with a different relocatability attribute.<br />

Y–32A W–X+ =F'1234' (literal)<br />

(reference to W–X+W Y<br />

location counter) W–X+Y AA+W–W+Y<br />

Complex Relocatable Expressions: Complex relocatable expressions, unlike<br />

relocatable expressions, can contain:<br />

Two or more unpaired relocatable terms<br />

An unpaired relocatable term preceded by a negative sign<br />

| Using the same symbols, the following are examples of complex relocatable<br />

| expressions:<br />

| W+X +<br />

| X-Y A-W+Y<br />

Complex relocatable expressions are used in A-type and Y-type address constants<br />

to generate address constant values. For more details, refer to “Complex<br />

Relocatable Expressions”, and “Address Constants—A and Y” on page 153.<br />

V-type and S-type constants may not contain complex relocatable expressions.<br />

48 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!