Kaiyi — 6.21.2 Explanation of String Processing Instructions

Chapter 6 Applied Instructions API 2107 Symbol: S 1 : Initial device in which the number of characters is stored Word/Double word S 2 : Value which is converted Word/Double word D : Initial device in which the conversion result is stored Word Explanation: 1. A decimal point is added to the value in S 2 , the value in S 1 +1 indicates the number of decimal places, and the value in S 1 indicates the number of characters. The conversion result is stored in D . 2. $ STR : The value in S 1 should be within the range between 2 and 8. The value in S 1 +1 should be within the range between 0 and 5, 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 -32768 and 32767. S1+1 S1 b15 b0 b7 b8 D D+1 . D+3 D+2 Sign D+4 Automatically stored at the end of the string Suppose the number of characters is 5, the number of decimal places is 1, and the value is -123. The conversion result is as follows.

S2 Binary number 6-464 Instruction code Operand Function D $STR P S , S , D 1 2 Converting the binary number into the string Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1          S 2            D        Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (7 steps) AH AH AH Number of characters Number of decimal places First ASCII code Sign Third ASCII code Second ASCII code Fifth ASCII code Fourth ASCII code Seventh ASCII code Sixth ASCII code 16#00 (Ending character) First ASCII code Sign Third ASCII code Second ASCII code Fifth ASCII code Fourth ASCII code Seventh ASCII code Sixth ASCII code 16#00 (Ending character)