Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.5 RIGHT / Extracting Character String Data from the Right
635
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)
Function and operation explanation
1. 16-bit operation (RIGHT/RIGHTP)
"n" characters are extracted from the right end (that is, from the end) of the character string data stored in the
device specified by and later, and stored to the device specified by and later.
If the number of characters specified by "n" is "0", the NULL code (0000H) is stored to the device specified by
.
When characters are extracted from a character string, "00H" is automatically added at the end of the
extracted characters.
1) When the number of extracted characters is odd, "00H" is stored in the high-order byte of a device storing
the last character.
2) When the number of extracted characters is even, "0000H" is stored in the device after the last character.
a) A character string stored in the device specified by and later indicates data stored in devices
from the specified device until "00H" is first detected in byte units.
RIGHT
EN ENO
d
s
n
Command
input
Head device storing
a character string
Head device storing extracted character string
Number of characters
to be extracted
+1
ASCII code for
2nd character
ASCII code for
4th character
ASCII code for
1st character
ASCII code for
3rd character
ASCII code for "(last character
- n + 2)"th character
ASCII code for "(last character
- n + 1)"th character
+1
ASCII code for "(last character
- n + 4)"th character
ASCII code for "(last character
- n + 3)"th character
ASCII code for "(last character
- 1)"th characte
ASCII code for "(last character
- 2)"th character
00H
ASCII code for
last character
ASCII code for "(last character
- n + 2)"th character
ASCII code for "(last character
- n + 4)"th character
ASCII code for "(last character
- n + 1)"th character
ASCII code for "(last character
- n + 3)"th character
ASCII code for "(last character
- 1)"th character
ASCII code for "(last character
- 2)"th character
00H
ASCII code for
last character
+0 +0
s d
b15 b8 b7 b0 b15 b8 b7 b0
34H(4)
32H(2) 31H(1)
33H(3)
35H(5)
31H(1)32H(2)
34H(4) 33H(3)
35H(5)
ASCII code for 5th character
+1
+2
+4
+3
+5
In the case of "n = 5"
42H(B) 41H(A)
44H(D) 43H(C)
46H(F) 45H(E)
00H
"ABCDEF12345"
+1
+2
00H
"12345"
ASCII code for 1st character
+0 +0
s d
b15 b8 b7 b0 b15 b8 b7 b0