DC instruction
You use the DC instruction to define the data constants you need for program execution. The DC instruction causes the assembler to generate the binary representation of the data constant you specify into a particular location in the assembled source module; this is done at assembly time.
The DC instruction's name — Define Constant — is misleading:
DC simply creates initial data in an area of the program. The contents
of that area might be modified during program execution, so the original
data is not truly constant
. If you want to declare values that
are more likely to behave like constants, use literals (Literals); the assembler attempts to detect and
diagnose instructions that might change the contents of a field defined
by a literal. If a control section has not been established previously,
DC initiates an unnamed (private) control section.
The DC instruction can generate the following types of constants:
Type of Constant | Function | Example |
---|---|---|
Address | Defines address mainly for the use of fixed-point and other instructions |
|
Binary | Defines bit patterns |
|
Character | Defines character strings or messages |
|
Decimal | Used by decimal instructions |
|
Fixed-point | Used by the fixed-point and other instructions |
|
Floating-point | Used by floating-point instructions |
|
Graphic | Defines character strings or messages that contain pure double-byte data |
|
Hexadecimal | Defines large bit patterns |
|
Zoned | Defines numeric characters |
|
- symbol
- Is one of the following:
- An ordinary symbol
- A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol
- A sequence symbol
If symbol denotes an ordinary symbol, the ordinary symbol represents the address of the first byte of the assembled constant. If several operands are specified, the first constant defined is addressable by the ordinary symbol. The other constants can be reached by relative addressing.
- operand
- An operand of six subfields. The first five subfields describe the constant. The sixth subfield provides the nominal values for the constants.
- duplication_factor
- Causes the nominal_value to be generated the number of times indicated by this factor. See Subfield 1: Duplication Factor.
- type
- Further determines the type of constant the nominal_value represents. See Subfield 2: Type.
- type_extension
- Determines some of the characteristics of the constant. See Subfield 3: Type Extension.
- program_type
- assign a programmer determined 32 bit value to the symbol naming the DC instruction, if a symbol was present. See Subfield 4: Program type.
- modifier
- Describes the length, the scaling, and the exponent of the nominal_value. See Subfield 5: Modifier.
- nominal_value
- Defines the value of the constant. See Subfield 6: Nominal Value.
10EBP(7)L2'12'
the six
subfields are: - Duplication factor is
10
- Type is
E
- Type extension is
B
- Program type is
P(7)
- Modifier is
L2
- Nominal value is
12
If all subfields are specified, the order given above is required. The first, third, fourth, and fifth subfields can be omitted, but the second and sixth must be specified in that order.