261
4
4 Instructions 4.6.4 Matrix Rotation and Shift
◆
Function
A number (indicated by [S2+1]) of characters starting from the character indicated by [S2] are retrieved
at the left end (beginning) of a string from head address [S1]. The result is stored in elements from head
address [D].
1. If [S2+1] is an odd number, 00H is stored in the higher byte of the element that stores the last character.
2. If [S2+1] is an even number, 0000H is stored in the element after the one that stores the last character.
The source string starts with [S1] and ends with 00H.
When the value in [S2+1] is 0, the instruction is not executed.
If the value in [S2+1] is –1, all data within the range from the character indicated by [S2] to the last
character from head address [S1] is stored in elements from head address [D].
42H(B)
44H(D)
46H(F)
S+1
S+2
EE
48H(H)
S+3
41H(A)
43H(C)
47H(G)
EE
S+4
45H(E)
4AH(J)
49H(I)
S+5
00H
4BH(K)
S
ć$%&'()*+,-.Ĉ
S2
5
S2+1
-1
S2: location of the fifth character
46H(F)
48H(H)
4AH(J)
D+1
D+2
EE
00H
D+3
45H(E)
47H(G)
4BH(K)
EE
49H(I)
D
An error is returned in the following conditions. The error ag M8067 is set to ON to identify this error and
the error code is stored in D8067.
1. Error 6705 is returned due to out-of-range search when 00H is not found in elements from head address
[S1].
2. Error 6706 is returned when the value in [S2] is greater than the number of characters from head address
[S1].
3. Error 6705 is returned when elements from head address [D] cannot fully store the read characters
whose number is indicated by [S2+1].
4. Error 6706 is returned when the value of n in [S2] is negative.
5. Error 6706 is returned when the value in [S2+1] is –2 or less.
6. Error 6706 is returned when the value in [S2+1] exceeds the number of characters from head address [S1].
◆
Application