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 The length attribute value of the symbol naming a DC instruction with a specified bit length is equal to the minimum number of integral bytes needed to contain the bit length specified for the constant. Consider the following example: TRUNCF DC FL.12'276' L'TRUNCF is equal to 2. Thus, a reference to TRUNCF addresses both the two bytes that are assembled. When more than one operand is specified in a DC instruction, or more than one nominal value in a DC operand, the above rules about bit-length modifiers also apply, except: 1. The first field allocated starts at a byte boundary, but the succeeding fields start at the next available bit. For example, BL1 DC FL.12'-1,1' generates X'FFF3E8'. 2. After all the constants have been assembled into their respective fields, the bits remaining to make up the last byte are filled with zeros. For example, BL2 DC FL.12'-1,1,-2' generates X'FFF3E8FFE' If duplication is specified, filling with zeros occurs once at the end of all the fields occupied by the duplicated constants. For example, BL3 DC 3FL.12'-2' generates X'FFEFFEFFE'. 3. The length attribute value of the symbol naming the DC instruction is equal to the number of integral bytes needed to contain the bit length specified for the first constant to be assembled. For example, the symbols BL1, BL2, and BL3 in the preceding examples each have length attribute 2. For Double-Byte Data in C-Type Constants: If bit-lengths are specified, with a duplication factor greater than 1, and a bit-length which is not a multiple of 8, then the double-byte data is no longer valid for devices capable of presenting DBCS characters. No error message is issued. Storage Requirement for Constants: The total amount of storage required to assemble a DC instruction is the sum of: 1. The requirements for the individual DC operands specified in the instruction. The requirement of a DC operand is the product of: The sum of the lengths (implicit or explicit) of each nominal value The duplication factor, if specified 2. The number of bytes skipped for the boundary alignment between different operands; such skipped bytes are filled with binary zeros. Scale Modifier The scale modifier specifies the amount of internal scaling that you want for: Binary digits for fixed-point constants (H, F) Hexadecimal digits for floating-point constants (E, D, L) The scale modifier can be used only with the above types of constants. It cannot be used with EB, DB, and LB floating point constants. The range for each type of constant is: Fixed-point constant H −187 to +346 Fixed-point constant F −187 to +346 138 HLASM V1R5 Language Reference

DC Instruction Floating-point constant E, EH 0 to 14 Floating-point constant D, DH 0 to 14 Floating-point constant L, LH 0 to 28 The scale modifier is written as Sn, where n is either a decimal self-defining term, or an absolute expression enclosed in parentheses. Both forms of the modifier's value n can be preceded by a sign; if no sign is present, a plus sign is assumed. Scale Modifier for Fixed-Point Constants: The scale modifier for fixed-point constants specifies the power of two by which the fixed-point constant must be multiplied after its nominal value has been converted to its binary representation, but before it is assembled in its final scaled form. Scaling causes the binary point to move from its assumed fixed position at the right of the rightmost bit position. Notes: 1. When the scale modifier has a positive value, it indicates the number of binary positions occupied by the fractional portion of the binary number. 2. When the scale modifier has a negative value, it indicates the number of binary positions deleted from the integer portion of the binary number. 3. When low-order positions are lost because of scaling (or lack of scaling), rounding occurs in the leftmost bit of the lost portion. The rounding is reflected in the rightmost position saved. Scale Modifier for Hexadecimal Floating-Point Constants: The scale modifier for hexadecimal floating-point constants must have a positive value. It specifies the number of hexadecimal positions that the fractional portion of the binary representation of a floating-point constant is shifted to the right. The hexadecimal point is assumed to be fixed at the left of the leftmost position in the fractional field. When scaling is specified, it causes an unnormalized hexadecimal fraction to be assembled (unnormalized means the leftmost positions of the fraction contain hexadecimal zeros). The magnitude of the constant is retained, because the exponent in the characteristic portion of the constant is adjusted upward accordingly. When non-zero hexadecimal positions are lost, rounding occurs in the leftmost hexadecimal position of the lost portion. The rounding is reflected in the rightmost position saved. Exponent Modifier The exponent modifier specifies the power of 10 by which the nominal value of a constant is to be multiplied before it is converted to its internal binary representation. It can only be used with the fixed-point (H and F) and floating-point (E, D, and L) constants. The exponent modifier is written as En, where n can be either a decimal self-defining term, or an absolute expression enclosed in parentheses. The decimal self-defining term or the expression can be preceded by a sign. If no sign is present, a plus sign is assumed. The range for the exponent modifier is −85 to +75. If a type extension is used to define a floating-point constant, the exponent modifier can be in the range −2 31 to 2 31 −1. If the nominal value cannot be represented exactly, a warning message is issued. Chapter 5. Assembler Instruction Statements 139

DC Instruction<br />

Floating-point constant E, EH 0 to 14<br />

Floating-point constant D, DH 0 to 14<br />

Floating-point constant L, LH 0 to 28<br />

The scale modifier is written as Sn, where n is either a decimal self-defining term,<br />

or an absolute expression enclosed in parentheses. Both forms of the modifier's<br />

value n can be preceded by a sign; if no sign is present, a plus sign is assumed.<br />

Scale Modifier for Fixed-Point Constants: The scale modifier for fixed-point<br />

constants specifies the power of two by which the fixed-point constant must be<br />

multiplied after its nominal value has been converted to its binary representation,<br />

but before it is assembled in its final scaled form. Scaling causes the binary point<br />

to move from its assumed fixed position at the right of the rightmost bit position.<br />

Notes:<br />

1. When the scale modifier has a positive value, it indicates the number of binary<br />

positions occupied by the fractional portion of the binary number.<br />

2. When the scale modifier has a negative value, it indicates the number of binary<br />

positions deleted from the integer portion of the binary number.<br />

3. When low-order positions are lost because of scaling (or lack of scaling),<br />

rounding occurs in the leftmost bit of the lost portion. The rounding is reflected<br />

in the rightmost position saved.<br />

Scale Modifier for Hexadecimal Floating-Point Constants: The scale modifier<br />

for hexadecimal floating-point constants must have a positive value. It specifies the<br />

number of hexadecimal positions that the fractional portion of the binary<br />

representation of a floating-point constant is shifted to the right. The hexadecimal<br />

point is assumed to be fixed at the left of the leftmost position in the fractional field.<br />

When scaling is specified, it causes an unnormalized hexadecimal fraction to be<br />

assembled (unnormalized means the leftmost positions of the fraction contain<br />

hexadecimal zeros). The magnitude of the constant is retained, because the<br />

exponent in the characteristic portion of the constant is adjusted upward<br />

accordingly. When non-zero hexadecimal positions are lost, rounding occurs in the<br />

leftmost hexadecimal position of the lost portion. The rounding is reflected in the<br />

rightmost position saved.<br />

Exponent Modifier<br />

The exponent modifier specifies the power of 10 by which the nominal value of a<br />

constant is to be multiplied before it is converted to its internal binary<br />

representation. It can only be used with the fixed-point (H and F) and floating-point<br />

(E, D, and L) constants. The exponent modifier is written as En, where n can be<br />

either a decimal self-defining term, or an absolute expression enclosed in<br />

parentheses.<br />

The decimal self-defining term or the expression can be preceded by a sign. If no<br />

sign is present, a plus sign is assumed. The range for the exponent modifier is −85<br />

to +75. If a type extension is used to define a floating-point constant, the exponent<br />

modifier can be in the range −2 31 to 2 31 −1. If the nominal value cannot be<br />

represented exactly, a warning message is issued.<br />

Chapter 5. Assembler Instruction Statements 139

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

Saved successfully!

Ooh no, something went wrong!