Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.6 LEFT / Extracting Character String Data from the Left
638
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (LEFT/LEFTP)
"n" characters are extracted from the left end (that is, from the head) 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.
LEFT
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
"n-1"th character
ASCII code for
"n-2"th character
+1
ASCII code for
"n+1"th character
ASCII code for
"n"th character
00H
ASCII code for
last character
ASCII code for
2nd character
ASCII code for
4th character
ASCII code for
1st character
ASCII code for
3rd character
ASCII code for
"n-1"th character
ASCII code for
"n-2"th character
00H
ASCII code for
"n"th character
+0 +0
s
d
b15 b8 b7 b0 b15 b8 b7 b0
31H(1)
42H(B) 41H(A)
44H(D) 43H(C)
46H(F) 45H(E)
31H(1)
ASCII code for 7th character
+1
+2
+4
+3
+5
In the case of "n = 7"
32H(2)
34H(4) 33H(3)
00H 35H(5)
"ABCDEF12345"
+1
+2
42H(B) 41H(A)
44H(D) 43H(C)
46H(F) 45H(E)
"ABCDEF1"
00H
+3
ASCII code for 1st character
+0 +0
s d
b15 b8 b7 b0b15 b8 b7 b0 b15 b8 b7 b0