Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
645
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
4) When " + 1" (the number of characters to be overwritten) is "-1", the entire character string stored in
and later is stored to the device specified by and later.
Cautions
1) When handling character codes other than ASCII codes, note the following contents:
a) The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes
in which two bytes express one character such as shift JIS codes, the length of one character is
detected as "2".
b) When extracting characters from a character string including character codes in which two bytes
express one character such as shift JIS codes, consider the number of characters to be extracted in
units of character codes for one character.
Note that the expected character code is not given if only one byte is extracted out of a 2-byte
character code.
Error
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is
stored in D8067.
1) When "00H" is not set within the corresponding device range after a device specified by or .
(Error code: K6706)
2) When the value of the device specified by exceeds the number of characters specified by .
(Error code: K6706)
3) When the value of the device specified by " + 1" exceeds the number of characters specified by
.
(Error code: K6706)
4) When the value of the device specified by is a negative value (Error code: K6706)
5) When the value of the device specified by " + 1" is "-2" or less
35H(5) 34H(4)
31H(1) 30H(0)
33H(3) 32H(2)
+1
+2
+3
"012345"
+1
-1
2
Position from the left end in the character
string stored in and later
Number of characters from the left end in
the character string stored in and later
1st
character
Last character
+0
+0
00H
d
s1
s2
s1
42H(B)
44H(D) 43H(C)
46H(F) 45H(E)
47H(G)
+1
+2
41H(A)
"ABCDEFGHIJK"
+3
+4
48H(H)
4AH(J) 49H(I)
Before execution
+5
00H 4BH(K)
1st
characte
r
2nd character
+0
d
b15 b8 b7 b0
30H(0)
35H(5)
32H(2) 31H(1)
34H(4) 33H(3)
+1
+2
41H(A)
"A012345HIJK"
+3
+4
4AH(J) 49H(I)
After execution
48H(H)
+5
00H 4BH(K)
2nd character
Six characters from the 2nd character are overwritten.
+0
d
b15 b8 b7 b0
b15 b8 b7 b0