Chapter 6 Applied Instructions 
6-477 
API    Instruction code  Operand 
Function 
2112    $LEFT  P 
S, n, D 
The retrieve of the characters in the 
string begins from the left. 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (7-13 steps) 
Symbol: 
S
:
String  Word 
n
:
Number of characters which are 
retrieved 
Word 
D
:
Device in which the characters 
retrieved are stored 
Word 
Explanation: 
1.  The instruction is used to retrieve n characters in the string in S from the left, and the 
characters which are retrieved are stored in D. 
2.  If n is 0, the value in D is 0. 
 b15
 b0
 b7
 b8
 16#00
 S
 +1
 S
.....................
 ~
 ~
 D
 +1
 D
...........
 b15
 b0
 b7 b8
 ~
First ASCII code
Second ASCII code
Third ASCII code
Fourth ASCII code
First ASCII code
Second ASCII code
Third ASCII code
Fourth ASCII code
Last ASCII code
n   ASCII code from the last
th
n-2   ASCII code from the last
th
n-1   ASCII code from the last
th
n+1   ASCII code from the last
th
n   ASCII code from the last
th
n-2   ASCII code from the last
th
n-1   ASCII code from the last
th
 16#00
 
If the data in S is ABCDEF12345 and n is 7, seven characters in the string in S are retrieved 
from the left. The conversion result is as follows. 
 b15
 b0
 b7 b8
 0016#
 S
 +1
 S
 +2
 S
 +3
 S
16#41(A) 16#42(B)
 43(C)16# 44(D)16#
 46(F)16#
 45(E)16#
 31(1)16#
 32(2)16#
 34(4)16#
 33(3)16#
 +4
 S
 +5 S
 35(5)16#
 b15
 b0
 b7 b8
 D
 +1
 D
 +2
 D
16#41(A) 42(B)16#
 43(C)16# 44(D)16#
 46(F)16#
 45(E)16#
 Seventh character
 ABCDEF12345
 +3
 D
 31(1)16#
 0016#
 
Example: 
When M0 is ON, the instruction $LEFT is executed. The six characters starting from the character in 
D100 are retrieved, and stored in D10~D12.