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—Binary Floating-Point Constants To accommodate the definition of both hexadecimal and binary floating-point constants the syntax for coding a DC instruction is: | ►►──DC──┬────────────┬──┬─┬─E─┬──┬───┬─┬──┬──────────────┬──┬──────────┬────► └─dup_factor─ ┘ │ ├ ─D─ ┤ ├ ─B─┤ │ └─program_type─ ┘ └─modifier─┘ | │ └ ─L─ ┘ └ ─H─┘ │ └─LQ───────────┘ ►──┤ nominal_value ├───────────────────────────────────────────────────────►◄ nominal_value (no type extension): ┌─ + ─┐ ├──'──┼─────┼──value──┬──────────┬──'───────────────────────────────────────┤ └─ - ─┘ └─exponent─┘ nominal_value (type extension B): ┌─ + ─┐ ┌─R4───────┐ ├──'──┼─────┼──value──┬──────────┬──┼──────────┼──'─────────────────────────┤ └─ - ─┘ └─exponent─┘ └─R─┬─1─┬──┘ ├─5─┤ ├─6─┤ └─7─┘ nominal_value (type extension H): ┌─ + ─┐ ┌─R1───────┐ ├──'──┼─────┼──value──┬──────────┬──┼──────────┼──'─────────────────────────┤ └─ - ─┘ └─exponent─┘ └─R─┬─4─┬──┘ ├─5─┤ ├─6─┤ └─7─┘ Figure 53. DC Instruction Syntax dup_factor causes the constant to be generated the number of times indicated by the factor. type indicates that the constant is either short, long or extended floating point. type extension the type of conversion required to assemble the constant. Valid values are: null B H Hexadecimal floating-point constant which is converted using the conversion logic of rounding mode 1 and slightly less precise algorithms Binary floating-point constant which is converted allowing all rounding modes Hexadecimal floating-point constant which is converted allowing all rounding modes | program_type | assign a programmer determined 32-bit value to the symbol naming the DC | instruction, if a symbol was present. modifier describes the length, the scaling and the exponent of the nominal_value. The minimum length of the 'H' hexadecimal constant is 12 bits. The minimum length in bits of the binary constant is: 9 Short floating-point constant 168 HLASM V1R5 Language Reference

DC Instruction—Binary Floating-Point Constants 12 Long floating-point constant 16 Extended floating-point constant This minimum length allows for the sign, exponent, the implied unit bit which is considered to be one for normalized numbers and zero for zeros and denormalized numbers. The exponent modifier can be in the range from −2 31 to 2 31 −1 if either B or H is specified as a type extension nominal_value defines the value of the constant and can include the integer, fraction or mixed number followed by an optional signed exponent and an optional explicit rounding mode. The assembler imposes no limits on the exponent values that may be specified. The BFP architecture limits the actual values that can be represented; a warning message is issued whenever a specified value can not be represented exactly. The rounding mode identifies the rounding required when defining a floating-point constant. The valid values are those displayed in Figure 50 on page 162 Note: As binary floating-point does not support scaling, the scale modifier is ignored and a warning message issued if the scaling modifier is specified when | defining a binary floating-point constant. The H type extension causes HLASM to | uses a different conversion algorithm for hexadecimal floating-point data. The | results are correctly rounded for all values. Without the H type extension, some rare | values could be in error by 1 unit in the last place (ulp). Conversion to Binary Floating-Point For decimal to binary floating-point conversion, the assembler conforms to ANSI/IEEE Std 754-1985, IEEE Standard for Binary Floating-Point Arithmetic, dated August 12, 1985, with the following differences: exception status flags are not provided and traps are not supported. | Conversion of values within the represented range is correctly rounded. Conversion of values outside the represented range is as follows. If the resultant value before rounding is larger in magnitude than MAX (the maximum allowed value) as represented in the specified length, then, depending on the rounding mode, either MAX or infinity is generated, along with a warning | message. If the resultant nonzero value is less than Dmin (the minimum allowed value) as represented in the specified length, then, depending on the | rounding mode, either Dmin or zero is generated, along with a warning message. Chapter 5. Assembler Instruction Statements 169

DC Instruction—Binary Floating-Point Constants<br />

To accommodate the definition of both hexadecimal and binary floating-point<br />

constants the syntax for coding a DC instruction is:<br />

|<br />

►►──DC──┬────────────┬──┬─┬─E─┬──┬───┬─┬──┬──────────────┬──┬──────────┬────►<br />

└─dup_factor─ ┘ │ ├ ─D─ ┤ ├ ─B─┤<br />

│ └─program_type─ ┘ └─modifier─┘<br />

|<br />

│ └ ─L─ ┘ └ ─H─┘<br />

│<br />

└─LQ───────────┘<br />

►──┤ nominal_value ├───────────────────────────────────────────────────────►◄<br />

nominal_value (no type extension):<br />

┌─ + ─┐<br />

├──'──┼─────┼──value──┬──────────┬──'───────────────────────────────────────┤<br />

└─ - ─┘<br />

└─exponent─┘<br />

nominal_value (type extension B):<br />

┌─ + ─┐<br />

┌─R4───────┐<br />

├──'──┼─────┼──value──┬──────────┬──┼──────────┼──'─────────────────────────┤<br />

└─ - ─┘<br />

└─exponent─┘<br />

└─R─┬─1─┬──┘<br />

├─5─┤<br />

├─6─┤<br />

└─7─┘<br />

nominal_value (type extension H):<br />

┌─ + ─┐<br />

┌─R1───────┐<br />

├──'──┼─────┼──value──┬──────────┬──┼──────────┼──'─────────────────────────┤<br />

└─ - ─┘<br />

└─exponent─┘<br />

└─R─┬─4─┬──┘<br />

├─5─┤<br />

├─6─┤<br />

└─7─┘<br />

Figure 53. DC Instruction Syntax<br />

dup_factor<br />

causes the constant to be generated the number of times indicated by the<br />

factor.<br />

type<br />

indicates that the constant is either short, long or extended floating point.<br />

type extension<br />

the type of conversion required to assemble the constant. Valid values are:<br />

null<br />

B<br />

H<br />

Hexadecimal floating-point constant which is converted using the<br />

conversion logic of rounding mode 1 and slightly less precise algorithms<br />

Binary floating-point constant which is converted allowing all rounding<br />

modes<br />

Hexadecimal floating-point constant which is converted allowing all<br />

rounding modes<br />

| program_type<br />

| assign a programmer determined 32-bit value to the symbol naming the DC<br />

| instruction, if a symbol was present.<br />

modifier<br />

describes the length, the scaling and the exponent of the nominal_value. The<br />

minimum length of the 'H' hexadecimal constant is 12 bits. The minimum<br />

length in bits of the binary constant is:<br />

9 Short floating-point constant<br />

168 <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!