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 |
|
.-,-------. V | >>-+--------+--DC----operand-+--------------------------------->< '-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.
>>-+--------------------+--type--+----------------+-------------> '-duplication_factor-' '-type_extension-' >--+--------------+--+----------+--nominal_value--------------->< '-program_type-' '-modifier-'
10EBP(7)L2'12'
the six
subfields are: 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.