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—Graphic Constant results in the assembled character string value of: D1D1D1 Examples of graphic constants are: DBCS1 DC G'' DBCS2 DC GL1'' DBCS3 DC GL4'' Because the length attribute does not include the SO and SI, the length attribute of DBCS1 is 6. The length modifier of 10 for DBCS2 causes padding of 2 double-byte spaces at the right of the nominal value. The length modifier of 4 for DBCS3 causes truncation after the first 2 double-byte characters. The length attribute of a graphic constant must be a multiple of 2. Type Attribute of G-Type Constant: Don't confuse the G-type constant character with the type (data) attribute of a graphic constant. The type attribute of a graphic constant is @, not G. See the general discussion about data attributes on page 324, and “Type Attribute (T')” on page 328. Figure 40. Graphic Constants Subfield Value Example Result 1. Duplication factor Allowed DC 3G'' Object code X'42C142C142C1' 2. Type G 3. Type Extension Not allowed | 4. Program type Allowed 5. Modifiers Implicit length: (length modifier not present) Alignment: Range for length: 6. Nominal value Represented by: Enclosed by: Number of values per operand: Padding: Truncation of assembled value: As needed (twice the number of DBCS characters) Byte 2 to 256, must be multiple of 2 (byte length) bit length not allowed DBCS characters delimited by SO and SI Single quotation marks One With DBCS spaces at right (X'4040') At right GC DC G'' L'GC = 4 DC G'

DC Instruction—Hexadecimal Constant Hexadecimal Constant—X Hexadecimal constants generate large bit patterns more conveniently than binary constants. Also, the hexadecimal values you specify in a source module let you compare them directly with the hexadecimal values generated for the object code and address locations printed in the program listing. Each hexadecimal digit (see ▌1▐ in Figure 41) specified in the nominal value subfield is assembled into four bits (their binary patterns can be found in “Self-Defining Terms” on page 34). The implicit length in bytes of a hexadecimal constant is then half the number of hexadecimal digits specified (assuming that a high-order hexadecimal zero is added to an odd number of digits). See ▌2▐ and ▌3▐ in Figure 41. An 8-digit hexadecimal constant provides a convenient way to set the bit pattern of a full binary word. The constant in the following example sets the first and third bytes of a word with all 1 bits. DS F TEST DC X'FFFF' The DS instruction sets the location counter to a fullword boundary. (See “DS Instruction” on page 174.) The next example uses a hexadecimal constant as a literal and inserts a byte of all 1 bits into the rightmost 8 bits of register 5. IC 5,=X'FF' In the following example, the digit A is dropped, because 5 hexadecimal digits are specified for a length of 2 bytes: ALPHACON DC 3XL2'A6F4E' Generates 6F4E 3 times The resulting constant is 6F4E, which occupies the specified 2 bytes. It is duplicated three times, as requested by the duplication factor. If it had been specified as: ALPHACON DC 3X'A6F4E' Generates A6F4E 3 times the resulting constant would have a hexadecimal zero in the leftmost position. A6F4EA6F4EA6F4E Figure 41 (Page 1 of 2). Hexadecimal Constants Subfield Value Example Result 1. Duplication factor Allowed 2. Type X 3. Type Extension Not allowed | 4. Program type Allowed 5. Modifiers Implicit length: (length modifier not present) As needed Alignment: Byte X DC X'FFA2' Y DC X'FA2' L'X = 3 ▌2▐ L'Y = 3 ▌2▐ Chapter 5. Assembler Instruction Statements 147

DC Instruction—Hexadecimal Constant<br />

Hexadecimal Constant—X<br />

Hexadecimal constants generate large bit patterns more conveniently than binary<br />

constants. Also, the hexadecimal values you specify in a source module let you<br />

compare them directly with the hexadecimal values generated for the object code<br />

and address locations printed in the program listing.<br />

Each hexadecimal digit (see ▌1▐ in Figure 41) specified in the nominal value<br />

subfield is assembled into four bits (their binary patterns can be found in<br />

“Self-Defining Terms” on page 34). The implicit length in bytes of a hexadecimal<br />

constant is then half the number of hexadecimal digits specified (assuming that a<br />

high-order hexadecimal zero is added to an odd number of digits). See ▌2▐ and<br />

▌3▐ in Figure 41.<br />

An 8-digit hexadecimal constant provides a convenient way to set the bit pattern of<br />

a full binary word. The constant in the following example sets the first and third<br />

bytes of a word with all 1 bits.<br />

DS<br />

F<br />

TEST DC X'FFFF'<br />

The DS instruction sets the location counter to a fullword boundary. (See “DS<br />

Instruction” on page 174.)<br />

The next example uses a hexadecimal constant as a literal and inserts a byte of all<br />

1 bits into the rightmost 8 bits of register 5.<br />

IC<br />

5,=X'FF'<br />

In the following example, the digit A is dropped, because 5 hexadecimal digits are<br />

specified for a length of 2 bytes:<br />

ALPHACON DC 3XL2'A6F4E' Generates 6F4E 3 times<br />

The resulting constant is 6F4E, which occupies the specified 2 bytes. It is<br />

duplicated three times, as requested by the duplication factor. If it had been<br />

specified as:<br />

ALPHACON DC 3X'A6F4E' Generates A6F4E 3 times<br />

the resulting constant would have a hexadecimal zero in the leftmost position.<br />

A6F4EA6F4EA6F4E<br />

Figure 41 (Page 1 of 2). Hexadecimal Constants<br />

Subfield Value Example Result<br />

1. Duplication factor Allowed<br />

2. Type X<br />

3. Type Extension Not allowed<br />

| 4. Program type Allowed<br />

5. Modifiers<br />

Implicit length:<br />

(length modifier<br />

not present)<br />

As needed<br />

Alignment:<br />

Byte<br />

X DC X'FFA2'<br />

Y DC X'FA2'<br />

L'X = 3 ▌2▐<br />

L'Y = 3 ▌2▐<br />

Chapter 5. Assembler Instruction Statements 147

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

Saved successfully!

Ooh no, something went wrong!