HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

DC Instruction ROUTINE B GAMMA DXD 5D DELTA DXD 1F ZETA DXD XL22 . . DC Q(GAMMA) DC Q(DELTA) . . ROUTINE C EPSILON DXD 4H ZETA DXD 4F . . DC Q(EPSILON,ZETA) . . Each of the three routines is requesting an amount of work area. Routine A wants | 2 doublewords and 4 fullwords; Routine B wants 5 doublewords, 10 fullwords, and | 22 bytes; Routine C wants 4 halfwords and 4 fullwords. During program linking, | identically named dummy sections are combined, retaining their strictest alignment | and longest length. For example, Routines B and C both request storage named | ZETA: the resulting allocation will be 22 bytes on a fullword boundary. When | program linking is complete, the sum of these individual dummy external section | lengths is placed in the location of the CXD instruction labeled OMEGA. Routine A | can then allocate the amount of storage that is specified in the CXD location, and | each dummy external section's offset within the allocated storage is found in the | Q-type offset constant referencing its name. Q-type offset constants are described | at “Offset Constant—Q” on page 159. DC Instruction You specify 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. | Note that the DC instruction's name — Define Constant — is somewhat misleading: | DC simply creates initial data in an area of the program. The contents of that area | may be modified during program execution, so the original data isn't truly | “constant.” If you want to declare values that are more likely to behave like | constants, use literals (“Literals” on page 40); 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 will initiate an unnamed (private) control section. The DC instruction can generate the following types of constants: 126 HLASM V1R5 Language Reference

DC Instruction Figure 32. Types of Data Constants Type of Constant Function Example Address Defines address mainly for the use of fixed-point and other instructions L 5,ADCON ADCON DC A(SOMWHERE) Binary Defines bit patterns FLAG DC B'1' Character Decimal Fixed-point Floating-point Graphic Defines character strings or messages Used by decimal instructions Used by the fixed-point and other instructions Used by floating-point instructions Defines character strings or messages that contain pure double-byte data CHAR DC C'string of characters' ZAP AREA,PCON PCON DC P'1' AREA DS PL3 L 3,FCON FCON DC F'1' LE 2,ECON ECON DC E'1.5' DBCS DC G'' Hexadecimal Defines large bit patterns PATTERN DC X'FFFF' ┌─,───────┐ ►►──┬────────┬──DC─── ▼ ─operand─┴────────────────────────────────────►◄ └─symbol─┘ 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. operands An operand of six subfields. The first five subfields describe the constant. The sixth subfield provides the nominal values for the constants. A DC operand has this format: ►►──┬────────────────────┬──type──┬────────────────┬────────────────► └─duplication_factor─┘ └─type_extension─┘ ►──┬──────────────┬──┬──────────┬──nominal_value───────────────────►◄ | └─program_type─┘ └─modifier─┘ Chapter 5. Assembler Instruction Statements 127

DC Instruction<br />

Figure 32. Types of Data Constants<br />

Type of<br />

Constant Function Example<br />

Address<br />

Defines address mainly<br />

for the use of fixed-point<br />

and other instructions<br />

L 5,ADCON<br />

ADCON DC A(SOMWHERE)<br />

Binary Defines bit patterns FLAG DC B'1'<br />

Character<br />

Decimal<br />

Fixed-point<br />

Floating-point<br />

Graphic<br />

Defines character strings<br />

or messages<br />

Used by decimal<br />

instructions<br />

Used by the fixed-point<br />

and other instructions<br />

Used by floating-point<br />

instructions<br />

Defines character strings<br />

or messages that contain<br />

pure double-byte data<br />

CHAR DC C'string of characters'<br />

ZAP AREA,PCON<br />

PCON DC P'1'<br />

AREA DS PL3<br />

L 3,FCON<br />

FCON DC F'1'<br />

LE 2,ECON<br />

ECON DC E'1.5'<br />

DBCS DC G''<br />

Hexadecimal Defines large bit patterns PATTERN DC X'FFFF'<br />

┌─,───────┐<br />

►►──┬────────┬──DC─── ▼ ─operand─┴────────────────────────────────────►◄<br />

└─symbol─┘<br />

symbol<br />

is one of the following:<br />

An ordinary symbol<br />

A variable symbol that has been assigned a character string with a value<br />

that is valid for an ordinary symbol<br />

A sequence symbol<br />

If symbol denotes an ordinary symbol, the ordinary symbol represents the<br />

address of the first byte of the assembled constant. If several operands are<br />

specified, the first constant defined is addressable by the ordinary symbol. The<br />

other constants can be reached by relative addressing.<br />

operands<br />

An operand of six subfields. The first five subfields describe the constant. The<br />

sixth subfield provides the nominal values for the constants.<br />

A DC operand has this format:<br />

►►──┬────────────────────┬──type──┬────────────────┬────────────────►<br />

└─duplication_factor─┘<br />

└─type_extension─┘<br />

►──┬──────────────┬──┬──────────┬──nominal_value───────────────────►◄<br />

| └─program_type─┘<br />

└─modifier─┘<br />

Chapter 5. Assembler Instruction Statements 127

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

Saved successfully!

Ooh no, something went wrong!