Справочник Пользователя для Mitsubishi Electronics QCPU
3-11
3
4
4
6
7
8
3
.2 Designa
ting D
ata
3
.2.5 Using
char
acte
r string data
3.2.5
Using character string data
Character string data is character data used by basic instructions and application instructions.
The target ranges from the designated character to the NULL code (00
H
) that indicates the end
of the character string.
(1) When designated character is the NULL code
One word is used to store the NULL code.
(2) When character string is even
Uses (number of characters/2 + 1) words, and stores character string and NULL code.
For example, if "ABCD" is transferred to D0, the character string ABCD is stored at D0 and
D1, and the NULL code is stored at D2. (The NULL code is stored as the last one word.)
For example, if "ABCD" is transferred to D0, the character string ABCD is stored at D0 and
D1, and the NULL code is stored at D2. (The NULL code is stored as the last one word.)
(3) When number of characters is odd
Uses (number of characters/2) words (rounds up decimal fractions) and stores the character
string and NULL code.
For example, if "ABCDE" is transferred to devices starting from D0, the character string
(ABCDE) and the NULL code are stored from D0 to D2. (The NULL code is stored into the
upper 8 bits of the last one word.)
string and NULL code.
For example, if "ABCDE" is transferred to devices starting from D0, the character string
(ABCDE) and the NULL code are stored from D0 to D2. (The NULL code is stored into the
upper 8 bits of the last one word.)
D
esignation of NULL code (00
H
)
M0
$MOV " "
D0
C
haracter string data transfer instruction
D0
NULL
D
esignation of a character string
composed of even numbers
M0
$MOV "ABCD" D0
D0
C
haracter string data transfer instruction
42
H
44
H
41
H
43
H
NULL
D1
D
2
D
esignation of a character string
composed of odd numbers
M0
$MOV "ABCDE" D0
D0
C
haracter string data transfer instruction
42
H
44
H
41
H
43
H
NULL
D1
D
2
45
H