Chapter 6 Instruction Details
XBC E-Type Main Unit
6-256
Ver. 1
6.34.14 REPLACE, REPLACEP
Instruction
Area Available
Step
Flag
P M K
F
L
T
C
S
Z D.x R.x
Con
st
U
N
D
R
Error
(F110)
Zero
(F111)
Carry
(F112)
REPLACE(P)
S1 O O O
-
O
-
-
-
O
-
-
-
O O O O
4~6
O
-
-
D O O O
-
O
-
-
-
O
-
-
-
O O O O
S2 O O O
-
O
-
-
-
O
-
-
-
O O O O
Operand
Description
Data Type
S1
Start address of string to replace
STRING
D
Start address of string
STRING
S2
Position (S2+0) and replaced size (S2+1) of the string to be replaced in D
WORD
[Flag Setting]
Flag
Description
Device Number
Error
1. If S2+1’s value exceeds D’s string length
2. If S2’s value exceeds D’s string length
F110
1) REPLACE
(1) Replaces string data (from the left) saved in device number D including specified S2 and S2+1’s number
of characters data, with specified S1’s string.
(2) If S2+1 is 0, S1 will be inserted in specified S2 position of string specified in D.
(3) If S1’s string length is different from S2+1’s string size, D’s string may keep increasing or deceasing,
which needs user’s precaution.
2) Program Example
P00000
REPLACE P1000 P1100 P1200
REPLACE
means REPLACE
P S1
D
REPLACEP
S1
D
S2
S2
S
S+1
S+2
h31 (I)
h33 (3)
h35 (5)
h00
h30 (0)
h32 (2)
h34 (4)
h36 (6)
b15
b8 b7
b0
"0123456"
S2
S2+1
3
2
Position from the left of D’s string data
The number of characters to be replaced
from S2
h42 (B)
h44 (D)
h46 (F)
h48 (H)
h41 (A)
h43 (C)
h45 (E)
h47 (G)
b15
b8 b7
b0
"ABCDEFGHI"
h00
h49 (I)
D
D+1
D+2
D+3
D+4
Before
h42 (B)
h31 (I)
h33 (3)
h35 (5)
h41 (A)
h30 (0)
h32 (2)
h34 (4)
b15
b8 b7
b0
"AB0123456EFGHI"
h45 (E)
h36 (6)
D
D+1
D+2
D+3
D+4
After
h47 (G)
h46 (F)
h49 (I)
h48 (H)
h00
h00
D+5
D+6
D+7
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...