518
Floating-point Math Instructions Section 3-14
S
S+1
2D 20 31 2E 32 33 34 35 36
(−) (SP) (1) (,) (2) (3) (4) (5) (6)
15 87 0
2D 20 31 2E 32 33 45 2B 30 30
(−) (SP) (1) (,) (2) (3) (E) (+) (0) (0)
15 87 0
D: 20
26
33
00
00
2D
31
32
33
00
20
2E
33
2B
30
00
2D
31
32
45
30
00
Decimal notation (C=0000 hex)
−1.23456
Conversion to
ASCII text
Rounded off
(SP represents a space.)
Stored in destination words beginning with D.
Total characters = 8 (C+1 = 0008 hex)
Fractional digits = 3 (C+2 = 0003 hex)
Example: −1.23456
Floating-point
data
ASCII characters are stored in order.
(Leftmost byte → rightmost byte)
Scientific notation (C= 0001 hex)
− 1.23E+00
Conversion to
ASCII text
(SP represents a space.)
Stored in destination words beginning with D.
Total characters = 10 (C+1 = 000A hex)
Fractional digits = 2 (C+2 = 0002 hex)
ASCII characters are stored in order.
(Leftmost byte → rightmost byte)
.
Decimal notation (C=0000 hex)
Integer part
Positive number: Space (20 hex)
Negative number: Minus sign (2D hex)
Sign
Total number of characters
If there are more fractional digits in the source data than specified in C+1, the extra digits will be rounded
off. If there are fewer fractional digits, zeroes (ASCII: 30 hex) will added to the end of the source data.
A decimal point (ASCII: 2E hex) is added if the number fractional digits is greater than 0.
Spaces (ASCII: 20 hex) are added if the integer part of the floating-point data is shorter than the integer part of the result
(total number of characters - sign digit - decimal point - fractional digits).
Fractional part
Decimal point
Storage of ASCII Text
After the floating-point number is converted to ASCII text, the ASCII characters are stored in the destination
words beginning with D, as shown in the following diagrams. Different storage methods are used for decimal
notation and scientific notation.