Chapter 6 Applied Instructions S1 5 S1+1 1 b15 b0 b7 b8 D Sign - 1 2 3 . D+1 D+2 3. D$ STR : The value in S 1 should be within the range between 2 and 13. The value in S 1 +1 should be within the range between 0 and 10, and should be less than or equal to the value in S 1 minus 3. The value in S 2 should be within the range between -2147483648 and 2147483647. S2 -123 (S1+1, S1) b15 b0 b7 b8 (S1+2, S1+3) D D+2 D+1 . D+3 D+4 D+5 S2+1 Sign S2 D+6 32-bit binary number Automatically stored at the end of the string Suppose the number of characters is 8, the number of decimal places is 3, and the value is -654321. The conversion result is as follows.
(S1+1,S 1) (S1+3, S1+2) b15 b0 b7 b8 D D+1 - 6 5 4 2 3 1 . D+2 D+3 D+4 (S2+1, S2) 4. If the value in S 2 is a positive value, the sign code in D is 16#20. If the value in S 2 is a negative value, the sign code in D is 16#2D. 5. The code in D which represents the decimal point is 16#2E. 6. If the value in S 1 +1 is larger than the number of digits in S 2 , the missing digits are replaced by 0. 32-bit binary number Number of characters 13 Number of decimal places 10 0.0000054321 7. If the value in S 1 is larger than the number of digits in S 2 plus the number of characters which include the decimal point and the sign, the missing digits are replaced by 0.
Binary number 54321 The missing digits are replaced by 0. 6-461 16#31(1) 16#2D(-) 16#2E(.) 16#32(2) 16#00(Ending character) 16#33(3) Numbe r of ch aracters First ASCII code Third AS CII code Fifth ASCII code Seventh AS CII code Ninth ASCII code Elevnth A SCII code 16#00 (Ending character) Sign Third AS CII code Second A SCII code Fifth ASCII code Fourth ASCII code Seventh AS CII code Sixth ASCII code Ninth ASCII code Eighth AS CII code Elevnth A SCII code Tenth A SCII code 16#00 (Ending character) Twelfth AS CII code Number of dec imal places High word Low word 8 3 16#36(6) 16#2D(-) 16#34(4) 16#35(5) 16#33(3) 16#2E(.) 16#31(1) 16#32(2) 16#00 (Ending character) -65 432