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


Symbol definition

HLASM Language Reference
SC26-4940-06

An ordinary symbol is defined in:
  • The name entry in a machine or assembler instruction of the assembler language
  • One of the operands of an EXTRN or WXTRN instruction

Ordinary symbols can also be defined in instructions generated from model statements during conditional assembly.

In Figure 1, the assembler assigns a value to the ordinary symbol in the name entry according to the following rules:
  1. The symbol is assigned a relocatable address value if the first byte of the storage field contains one of the following:
    • Any machine or assembler instruction, except the EQU or OPSYN instruction (see  1  in Figure 1)
    • A storage area defined by the DS instruction (see  2  in Figure 1)
    • Any constant defined by the DC instruction (see  3  in Figure 1)
    • A channel command word defined by the CCW, CCW0, or CCW1 instruction

    The address value assigned is relocatable, because the object code assembled from these items is relocatable. The relocatability of addresses is described in Addresses.

  2. The symbol is assigned the value of the first or only expression specified in the operand of an EQU instruction. This expression can have a relocatable (see  4  in Figure 1) or absolute (see  5  in Figure 1) value, which is then assigned to the ordinary symbol.

    The value of an ordinary absolute symbol must lie in the range -231 through +231-1. Relocatable symbols have unsigned address values in the range 0 - 224-1, or 0 - 231-1 if the GOFF option is specified.

Figure 1. Transition from assembler language statement to object code
  Assembler LanguageAddress ValueObject Code
      Statementsof Symbolin Hexadecimal
─────────────────────────┼─────────────────┼──────────────────────────────────
                         │  Relocatable    │              ┌────── Address
                         │                 │              V       of AREA
                         │                 │     ┌──┬─┬─┬────┐
LOAD     L     3,AREA    1  LOAD ──────────┼────>│58│3│0│xxxx│
                         │                 │     └──┴─┴─┴────┘
                         │                 │
                         │                 │     ┌───────────┐
AREA     DS    F         2  AREA ──────────┼────>│xx x x xxxx│
                         │          ┌──────┼────>└───────────┘
                         │          │      │
                         │          │      │     ┌───────────┐
F200     DC    F'200'    3  F200 ──────────┼────>│00 0 0 00C8│
                         │          │   ┌──┼────>└───────────┘
─────────────────────────┼──────────┼───┼──┼───────────────────────────────────
FULL     EQU   AREA      │  FULL ───┘   │  │
                         4              │  │
TW00     EQU   F200      │  TW00 ───────┘  │
─────────────────────────┼─────────────────┼───────────────────────────────────
                         │    Absolute     │
                         │                 │
R3       EQU   3         5  R3=3           │              ┌────── Address
                         │                 │              V       of FULL
                         │                 │     ┌──┬─┬─┬────┐
         L     R3,FULL   │                 │     │58│3│0│xxxx│
                         │                 │     ├──┼─┼─┼────┤
         A     R3,TW00   │                 │     │5A│3│0│xxxx│
                         │                 │     └──┴─┴─┴────┘
                         │                 │                     Address
                         │                 │              └────── of TW00

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014