Delta AH500 — 6.21.2 Explanation of String Processing Instructions

AH500 Programming Manual Symbol: S : Source value Word/Double word D : Device in which the conversion result is stored Word Explanation: 1. The binary-coded decimal number in S is converted into the ASCII code, and the conversion result is stored in D . 2. The instruction supports SM690, which controls the ending character. 3. The binary-coded decimal value in S used in the 16-bit instruction should be within the range between 0 and 9999, and should be a four-digit binary-coded decimal value. The operand D occupies three word devices. The data is converted as follows.

b3 b4 b7 b8 b11 b12 b15 b0 b7 b8 D b15 b0 S D +1 Thousands place +2 Hundreds place Tens place Units place D If SM690 is OFF, 16#0000 is stored in D +2. If SM690 is ON, the value in D +2 is unchanged. 4. The binary-coded decimal value in S used in the 32-bit instruction should be within the range between 0 and 99999999, and should be an eight-digit binary-coded decimal value. The operand D occupies five word devices. The data is converted as follows.

b15 b0 b7 b8 b15 b12 b11 b8 b7 b4 b3 b0 b15 b12 b11 b8 b7 b4 b3 b0 S +1 S D D +1 Ten millions place Millions place Hundred thousands place Ten thousands place Thousands place Hundreds place Tens place Units place D +2 D +3 D +4 If SM690 is OFF, 16#0000 is stored in D +5. If SM690 is ON, the value in D +5 is unchanged. 5. Take the binary-coded decimal number 12098 in S for example.

The digit in the hundred thousands place of the number, the digit in the millions place of the number, and the digit in the 6-446 API Instruction code Operand Function 2102 D BCDDA P S, D Converting the binary-coded decimal number into the ASCII code Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S            D        Pulse instruction 16-bit instruction (5 steps) 32-bit instruction (5 steps) AH500 AH500 AH500 ASCII code in the hundreds place ASCII code in the thousands place ASCII code in the units place ASCII code in the tens place Ending character (16#0000 or unchanged) ASCII code in the millions place ASCII code in the ten millions place ASCII code in the ten thousands place ASCII code in the hundred thousands place ASCII code in the hundreds place ASCII code in the thousands place ASCII code in the units place ASCII code in the tens place Ending character (16#0000 or unchanged)