22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DC Instruction<br />

ROUTINE B<br />

GAMMA DXD 5D<br />

DELTA DXD 1F<br />

ZETA DXD XL22<br />

.<br />

.<br />

DC<br />

Q(GAMMA)<br />

DC<br />

Q(DELTA)<br />

.<br />

.<br />

ROUTINE C<br />

EPSILON DXD<br />

4H<br />

ZETA DXD 4F<br />

.<br />

.<br />

DC<br />

Q(EPSILON,ZETA)<br />

.<br />

.<br />

Each of the three routines is requesting an amount of work area. Routine A wants<br />

| 2 doublewords and 4 fullwords; Routine B wants 5 doublewords, 10 fullwords, and<br />

| 22 bytes; Routine C wants 4 halfwords and 4 fullwords. During program linking,<br />

| identically named dummy sections are combined, retaining their strictest alignment<br />

| and longest length. For example, Routines B and C both request storage named<br />

| ZETA: the resulting allocation will be 22 bytes on a fullword boundary. When<br />

| program linking is complete, the sum of these individual dummy external section<br />

| lengths is placed in the location of the CXD instruction labeled OMEGA. Routine A<br />

| can then allocate the amount of storage that is specified in the CXD location, and<br />

| each dummy external section's offset within the allocated storage is found in the<br />

| Q-type offset constant referencing its name. Q-type offset constants are described<br />

| at “Offset Constant—Q” on page 159.<br />

DC Instruction<br />

You specify the DC instruction to define the data constants you need for program<br />

execution. The DC instruction causes the assembler to generate the binary<br />

representation of the data constant you specify into a particular location in the<br />

assembled source module; this is done at assembly time.<br />

| Note that the DC instruction's name — Define Constant — is somewhat misleading:<br />

| DC simply creates initial data in an area of the program. The contents of that area<br />

| may be modified during program execution, so the original data isn't truly<br />

| “constant.” If you want to declare values that are more likely to behave like<br />

| constants, use literals (“Literals” on page 40); the assembler attempts to detect and<br />

| diagnose instructions that might change the contents of a field defined by a literal.<br />

If a control section has not been established previously, DC will initiate an unnamed<br />

(private) control section.<br />

The DC instruction can generate the following types of constants:<br />

126 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!