Symbol definition

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). F004 is the address of the area.
    • A storage area defined by the DS instruction (see  2  in Figure 1). Symbol AREA is 4 byte storage area at location counter 00000004.
    • Any constant defined by the DC instruction (see  3  in Figure 1). Symbol F200 is a 4 byte constant defined at location counter 00000008, with the object code initialized to a value of x'000000c8'.

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

  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 one of the following values, which is then assigned to the ordinary symbol:
    relocatable
    See  4  in Figure 1. Symbols FULL and TWO00 are relocatable symbols whose value is set by the location counters of AREA and FULL respectively.
    absolute
    See  5  in Figure 1. Symbol R3 is an absolute symbol, whose value is 3.

    See  6  in Figure 1. Statements 26, 27 illustrate the relocatable symbols being used. The object code and ADDR2 value show the resolved values of the two relocatable symbols

    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

LPSAMP04 Assembler source to Object code                                                               Page    4
  Active Usings: None
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                  HLASM R6.0  2015/02/24 13.32
00000000                00000000 00000014     16 LPSAMP04 CSECT
                        0000000E              17 R14      EQU  14
                        0000000F              18 R15      EQU  15
                    R:F 00000000              19          USING *,R15
00000000 5830 F004               00000004     20 LOAD     L    R3,AREA  1 
00000004 00000000                             21 AREA     DS   F'0'     2 
00000008 000000C8                             22 F200     DC   F'200'   3 
                        00000004              23 FULL     EQU  AREA  4 
                        00000008              24 TWO00    EQU  F200  4 
                        00000003              25 R3       EQU  3     5 
0000000C 5830 F004               00000004     26  6       L    R3,FULL
00000010 5A30 F008               00000008     27  6       A    R3,TWO00
                                              28          END