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:
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:
- 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
- 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.
- 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.
- 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:
This behavior is different from that in A-type address constants and Y-type address constants.USING *,15 DC 2S(*) generates F000F002 LA 1,=2S(*) generated constants are F004F004
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) |
BaseX 0 |
DispYYY 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 |