255
4
4 Instructions 4.6.4 Matrix Rotation and Shift
INSTR: String retrieval
◆
Overview
The INSTR instruction retrieves one string from another.
INSTR S1 S2 D n
String
retrieval
Applicable model:
H3U
S1 Source data
Start number of elements that store the string to be
retrieved
16-bit instruction (7
steps)
INSTR: Continuous
execution
INSTRP: Pulse
execution
S2
Retrieval
source
Start number of elements that store the string from
which another string will be retrieved
D
Retrieval
result
Start number of elements that store the retrieval
result
n
Retrieval
start point
Position from which a string will be retrieved
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
n X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The INSTR instruction searches from the nth character on the left (beginning of a string) of a range of
elements from the retrieval source [S2], to identify the same string as that stored in elements from head
address [S1]. Information about the beginning (position of the rst matched character on the left) of the
retrieved string is stored in [D].
42H(B)
44H(D)
46H(F)
S2+1
S2+2
b7-----b0
48H(H)
S2+3
41H(A)
43H(C)
47H(G)
b15-----b8
S2+4
45H(E)
4AH(J)
49H(I)
S2+5
00H
4BH(K)
S2
“ABCDEFGHIJK”
Source string
46H(F)
S1
48H(H)
S1+1
47H(G)
45H(E)
S1+2
00H(0)
b7-----b0
b15-----b8
Search starting from the third
character (n = 3)
Fifth character counted from
the initial character
“EFGH”
5
D
The n characters counted
from the initial character of
the string in [S2] are stored.
Source string to be
retrieved
If no portion of the string from head address [S2] matches the string from head address [S1], 0 is stored in [D].
If n (retrieval start point) is negative or 0, the instruction is not executed.