
543
Conversion Instructions
Section 3-12
Examples
■
Example 1: Converting 3 Sets of 4 ASCII Characters to the Equivalent
Hexadecimal Digits
When CIO 000000 is ON in the following example, the 6 words of ASCII data
starting at D00010 are converted, two words at a time, to numerical data. The
converted numerical data is stored in the DM Area starting at D00100.
■
Example 2: Converting ASCII Data in BCD Format to Hexadecimal Data
When CIO 000001 is ON in the following example, the ASCII characters in
D00000 and D00001 are converted to BCD data and the result is stored tem-
porarily in D00010. Next, the BCD data is converted to hexadecimal and the
result is output to D00100.
8
9
F
E
1
2
B
A
0
0
0
0
15 8
7
11
12 3
4 0
NEXT
NUM4
,IR0++
FOR
&3
,IR1+
MOVR
D00010
IR0
MOVR
D00100
IR1
000000
000000
000000
31
32
41
42
38
39
45
46
30
30
30
30
15 8
7 0
S
D
Hexadecimal
S: D00010
S+1: D00011
S+2: D00012
S+3: D00013
S+4: D00014
S+5: D00015
ASCII
D: D00100
D+1: D00101
D+2: D00102
31
32
33
34
1
2
4
15 8
7
11
12 3
4 0
15 8
0
BIN
D00010
D00100
NUM4
D00000
D00010
S
D
000001
0
4
2
D
15 8
7
11
12 3
4
7
0
3
BCD
S: D00000
S+1: D00001
Binary (hexadecimal)
ASCII (BCD)
BCD
D: D00010
D00100
&1234 Decimal
(#04D2 hexadecimal)
Содержание SYSMAC CS Series
Страница 2: ......
Страница 4: ...iv ...
Страница 30: ...xxx ...
Страница 186: ...146 List of Instructions by Function Code Section 2 4 ...
Страница 194: ...154 3 35 4 MOVE BIT MOVBC 568 1273 3 35 5 BIT COUNTER BCNTC 621 1275 3 35 6 GET VARIABLE ID GETID 286 1277 ...
Страница 1320: ...1280 Model Conversion Instructions Unit Ver 3 0 or Later Section 3 35 ...
Страница 1390: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Страница 1391: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits ...
Страница 1392: ...1352 ASCII Code Table Appendix A ...
Страница 1404: ...1364 Revision History ...