Chapter 6 Applied Instructions Suppose the number of characters is 8, the number of decimal places is 2, and the value is -1.23456. The calculation is as follows. 0 S2 8 +1 S2 3 +2 S2 b15 b0 b7 b8 D +1 D +2 D - 1 2 3 5 . +4 D +3 D Sign Automatically stored at the end of the string The value in S 2 +1: If the value in S 2 +2 is 0, the value in S 2 +1 should be within the range between 2 and 24, and the number of characters which the integer part contains should be less than or equal to 23.
(S1+1, S1) If the value in S 2 +2 is not 0, the value in S 2 +1 should be within the range between the value in S 2 +2 plus 3 and 24, and the number of characters which the integer part contains should be less than or equal to 22 minus the value in S 2 +2. The value in S 2 +2 should be within the range between 0 and 7. If the value in S 2 +2 is not 0, it should be less than or equal to the value in S 2 +1 minus 3. If the floating-point number in S 1 is a positive number, the sign code in D is 16#20. If the floating-point number in S 1 is a negative number, the sign code in D is 16#2D.
If the length of the floating-point number is larger than the value in S 2 +1, the floating-point number is rounded off, and the redundant characters are deleted. If the value in S 2 +2 is larger than 0, 16#2E (“.”) is stored in front of the specified character automatically. If the length of the conversion result is less than the value in S 2 +1, the codes between the sign character and the real number are 16#20. The conversion result ends with 16#00. 0 (Decimal foramt ) 8 (Number of characters ) S2 +1 S2 . 3 (Number of deci mal places) +2 S2 - 1 2 3 4 5 6 (S1+1, S1) The floating-point number is rounded off, and the redundant characters are deleted.
Automatically stored Becoming 16#20 6-469 16#20( ) 16#2D(-) 16#31(1) 16#20( ) 16#32(2) 16#2E(.) 16#35(5) 16#33(3) 16#00 (Ending character) -1 .2 34 56 -1. 23 4 56