Chapter 6 Applied Instructions API 2108 Symbol: S : Source value Word D 1 : Device in which the number of characters is stored Word/Double word 2 n D : Device in which the binary umber is stored Word/Double word Explanation: 1. The string in S is converted into binary number. The number of characters is stored in D 1 , the number of decimal places is stored in D 1 +1, and the binary number is stored in D 2 . 2. $ VAL : The operand S occupies five word devices at most. The number of characters contained in the string in S should be within the range between 2 and 8.
If there is a decimal point in the string in S , 16#2E should be stored between the first character after the sign character and the last character. D1 S b15 b0 b7 b8 D1+1 S+1 D2 S+2 S+3 S+4 S i g n F i r s t A S C I I c o d e .................... S e v e n t h A S C I I c o d e 6-468 Instruction code Operand Function D $VAL P S, D , D 1 2 Converting the string into the binary number Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S D 1 D 2 Pulse 16-bit instruction (7-13 steps) 32-bit instruction (7-13 steps) i t ti AH AH AH Number of characters Number of decimal places Binary number .
Number of characters Number of decimal places Binary number First ASCII code Sign Third A SCII code Second ASCII code Fifth ASCII code Fourth ASCII code Seventh ASCII code Sixth ASCII code 16#00