AH500 Programming Manual 
6-484 
API    Instruction code  Operand 
Function 
2115    $SER  P 
S
1
, S
2
, n, D 
Searching the string 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (9-21 steps) 
AH500  AH500  - 
Symbol: 
S
1 
: 
String which is searched  Word 
S
2 
: 
String which is searched for  Word 
n 
: 
2
 from which the 
search begins 
Word 
D 
: 
Search result  Word 
Explanation: 
1.  The instruction is used to search the string from the n
th
 character in S
2
 for the string which is 
the same as the string in S
1
, and the search result is stored in D. 
2.  Suppose the string in S
2
 is “ABCDEFGHIJK”, the string in S
1
 is “EFGH”, and n is 3. The search 
begins from the third character in S
2
, and the value in D is 5.   
 b15
 b0
 b7 b8
 S1
16#45(E) 16#46(F)
 47(G)16# 48(H)16#
 +1
 S1
 +2
 S1
 0016#
 b15
 b0
 b7 b8
 S2
16#45(E) 46(F)16#
 47(G)16# 48(H)16#
 49(I)16#
 4A(J)16#
 4B(K)16#
 D
 After the instruction is executed
 +1
 S2
 +2
 S2
 +3
 S2
 +4
 S2
16#41(A) 42(B)16#
 43(C)16# 44(D)16#
 5
 +5 S2
 0016#
 Searching the string from the third character
Matching character
 忽略
 
Example: