HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Address constants—A and Y

HLASM Language Reference
SC26-4940-06

The following sections describe how the different types of address constants are assembled from expressions that normally represent storage addresses, and how the constants are used for addressing within and between source modules.

In the A-type and Y-type address constants, you can specify any of the three following types of assembly-time expressions whose values the assembler then computes and assembles into object code. Use this expression computation as follows:
  • Relocatable expressions for addressing
  • Absolute expressions for addressing and value computation
  • Complex relocatable expressions to relate addresses in different source modules

Literals, which are relocatable forms, are not allowed as operands, but length, scale, and integer attribute references to literals are allowed.

Here are some examples:
     DC   A(L'=F'1.23')
     DC   A(I'=F'3.45')
     DC   A(S'=FS6'7.89)
Notes:
  1. No bit-length modifier (see  1  in Table 1) is allowed when a relocatable or complex relocatable expression (see  2  in Table 1) is specified. The only explicit lengths that can be specified with relocatable or complex relocatable address constants are:
    • 2-8 bytes for AD-type constants
    • 2, 3, or 4 bytes for A-type constants
    • 2 bytes for Y-type constants
    The linkage editor or binder or loader you use determines which lengths are supported. Please see the appropriate product manual for more information.
    For absolute operands, you can specify byte or bit lengths:
    • Byte lengths 1 through 8, or bit lengths .1 through .128, for A-type constants
    • Byte lengths 1 or 2, or bit lengths .1 through .16, for Y-type constants
  2. The value of the location counter reference (*) when specified in an address constant varies from constant to constant, if any of the following, or a combination of the following, are specified:
    • Multiple operands
    • Multiple nominal values (see  3  in Table 1)
    • A duplication factor (see  4  in Table 1)

    The location counter is incremented with the length of the previously assembled constant.

  3. When the location counter reference occurs in a literal address constant, the value of the location counter is the address of the first byte of the instruction.

    The behavior of location counter references in A-type address constants is different from that in S-type address constants (Address constant—S).

Table 1. A and Y address constants
Subfield Value Example Result

1. Duplication factor

Allowed

A  DC  5AL1(*-A)  4 

Object code
X'0001020304'

2. Type A and Y    
3. Type Extension D permitted for A type only    
4. Program type Allowed    

5. Modifiers
   Implicit length:
   (length modifier
   not present)

 
A-type: 4 bytes
AD-type: 8 bytes
Y-type: 2 bytes

   

   Alignment:
   (Length modifier
   not present)

A-type: fullword
AD-type: doubleword
Y-type: halfword

   

  Range for length:

A-type:
2 to 4  1 
(byte length)
AD-type:
1 to 8
(byte length)
 
Y-type:
2 only
(byte length)

   
Range for scale: Not allowed    
Range for exponent: Not allowed    

6. Nominal value
   Represented by:

 
Absolute,
relocatable,
or complex
relocatable
expressions  2 

 
A-type:
DC  A(ABSOL+10)
 
Y-type:
   DC  Y(RELOC+32)
A  DC  Y(*-A,*+4)  3 

 
 
 
 
 
 
values=0,A+6

Enclosed by: Parentheses    
Exponent allowed: No    

   Number of values
   per operand:

Multiple

   
Padding: If an absolute term is present, by sign extension. Otherwise, with zeros at left.    

   Truncation of
   assembled value:

At left

   

Take care when using Y-type address constants and 2 byte A-type address constants for relocatable addresses, as they can only address a maximum of 65,536 bytes of storage. Using these types of address constants for relocatable addresses results in message ASMA066W being issued unless the assembler option RA2 is specified.

Here is how the A-type and Y-type address constants are processed:

  • If the nominal value is an absolute expression, it is computed to its 32 bit value> it is then truncated or sign-extended on the left to fit the implicit or explicit length of the constant.
  • If the nominal value is a relocatable or complex relocatable expression, it is not completely evaluated until linkage edit time. The relocated address values are then placed in the fields set aside for them at assembly time by the A-type and Y-type constants.
In the following examples, the field generated from the statement named ACON contains four constants, each of which occupies 4 bytes. The statement containing the LM instruction shows the same set of constants specified as literals (that is, address constant literals).
ACON     DC             A(108,LOP,END-STRT,*+4096)
         LM             4,7,=A(108,LOP,END-STRT,*+4096)

A location counter reference (*) appears in the fourth constant (*+4096). The value of the location counter is the address of the first byte of the fourth constant. When the location counter reference occurs in a literal, as in the LM instruction, the value of the location counter is the address of the first byte of the instruction.

Note: It is important to remember that expression evaluation for address constants is restricted to using 32 bit internal arithmetic. The result is then sign-extended to the length of the constant. This means that certain expressions in AD-type constants might not yield expected results, especially if the resulting value is negative.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014