Chapter 6 Applied Instructions b15 b0 b7 b8 b15 b0 b7 b8 S1 S1+1 D+1 D S1+2 S1+3 D+2 D+3 S1+4 After the instruction is executed D+4 S1+5 S2 S2+1 S3 4 Number of characters which are replaced S4 6 Character which is replaced 3. If the string in S 2 is 16#00, the instruction deletes the matching characters. 4. If the value in S 3 is larger than the number of characters that the instruction can replace in the string in S 1 , the instruction replaces the characters in S 1 starting from the character indicated by the value in S 4 to the last character in S 1 . 5. If the value in S 3 is equal to 0, the instruction is not executed.
Example When M0 is ON, the data in D0–D7 is “1234ABAB1234AB”, and the data in D10–D11 is “CDEF”. When the $RPLC instruction executes, the instruction replaces the characters in D0–D7 starting from the character indicated by the value in 6_ D51 with the characters in D10–D11. The number of characters to replace is indicated by the value in D50, and the instruction stores the result in D20–D27. 6-687 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#36(6) 16#35(5) 16#38(8) 16#37(7) 16#30(0) 16#39(9) Ignored 16#00 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#4D(M) 16#35(5) 16#30(0) 16#4E(N) 16#0000 16#4E(N) 16#4D(M) Ignored 16#00