Address constant—S

Use the S-type address constant to assemble an explicit address in base-displacement form. You can specify the explicit address yourself or let the assembler compute it from an implicit address, using the current base register and address in its computation.

The nominal values can be specified in two ways:
  1. As one absolute or relocatable expression (see 1  in Table 1) representing an implicit address.
  2. As two absolute expressions (see  2  in Table 1) the first of which represents the displacement and the second, enclosed in parentheses, represents the base register.
The address value represented by the expression in  1  in Table 1, is converted by the assembler into the correct base register and displacement value. An S-type constant is assembled as a halfword and aligned on a halfword boundary. An SY-type constant is assembled as 3 bytes and aligned on a halfword boundary. The leftmost four bits of the assembled constant represent the base register designation; the remaining 12 bits (S-type) or 20 bits (SY-type), the displacement value.
Notes:
  1. The value of the location counter (*) when specified in an S-type address constant varies from constant to constant if one or more the following is specified:
    • Multiple operands
    • Multiple nominal values
    • A duplication factor
    In each case the location counter is incremented with the length of the previously assembled constant, except when multiple S-type address constants are specified in a literal. In a literal, the same location counter value is used for each of the multiple values.
  2. If a length modifier is used, only 2 bytes for an S-type constant, or only 3 bytes for an SY-type constant, can be specified.
  3. S-type address constants can be specified as literals. The USING instructions used to resolve them are those in effect at the place where the literal pool is assembled, and not where the literal is used.
  4. The location counter value used in the literal is the value at the point where the literal is used, not where it is defined.
    For example:
        USING *,15
        DC    2S(*)        generates F000F002
        LA    1,=2S(*)     generated constants are F004F004
    This behavior is different from that in A-type address constants and Y-type address constants.
Table 1. S address constants
  Subfield Value Example Result
1. Duplication factor Allowed      
2. Type S      
3. Type Extension Y      
4. Program type Allowed      
5. Modifiers        
  Length: 2 (S) or 3(SY) only
(no bit length)
     
  Implicit length:
(Length modifier not present)
2 bytes (S-type)
3 bytes (SY-type)
     
  Alignment:
(Length modifier not present)
Halfword      
  Scale: Not allowed      
  Exponent: Not allowed      
6. Nominal value
Represented by:
 
Absolute or relocatable expression  1 
 
DC S(RELOC)
DC S(1024)
Base
X
0
Disp
YYY
400
    Two absolute expressions  2  DC S(512(12))
DC SY(-2(3))
C
3
200
FFEFF
  Enclosed by: Parentheses      
  Exponent allowed: No      
  Number of values per operand: Multiple      
  Padding: Not applicable      
  Truncation of assembled value: Not applicable